/* ==========================================================================
   IAE — Participant Registration
   Institutional letterhead styling. Navy / gold, hairline rules, no gradients.
   ========================================================================== */

:root {
    --navy: #142B4A;
    --navy-deep: #0F2139;
    --blue: #245B85;
    --blue-soft: #EAF1F7;
    --gold: #086a91;
    --gold-ink: #086a91;
    --gold-wash: #E8F4F8;
    --gold-line: #B9DDE8;
    --bg: #F4F6F9;
    --surface: #FFFFFF;
    --ink: #263445;
    --ink-soft: #4B5768;
    --muted: #6F7B8C;
    --line: #E4E8EE;
    --line-strong: #D3DAE3;
    --danger: #A8261F;
    --success: #1F6E45;

    --font-sans: 'Roboto', 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-serif: 'Roboto', 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

    --radius-card: 14px;
    --radius-control: 6px;
    --shadow-card: 0 1px 2px rgba(20, 43, 74, .04), 0 24px 48px -34px rgba(20, 43, 74, .45);
}

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    font-feature-settings: 'kern' 1;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--navy);
    color: #fff;
    padding: .6rem 1rem;
    font-size: .875rem;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
    position: relative;
    overflow: hidden;
    background: #f7f9fb;
    border-bottom: 1px solid rgba(8, 106, 145, 0.12);
    isolation: isolate;
}

.masthead__flag {
    position: absolute;
    inset: -6% -2%;
    background: url('../images/tz-flag.svg') center/cover no-repeat;
    opacity: 0.16;
    filter: saturate(1.05) contrast(1.02);
    transform: scale(1.03);
    z-index: 0;
}

.masthead__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.86) 22%, rgba(255, 255, 255, 0.78) 50%, rgba(255, 255, 255, 0.86) 78%, rgba(255, 255, 255, 0.96) 100%),
        linear-gradient(180deg, rgba(8, 106, 145, 0.06) 0%, rgba(255, 255, 255, 0) 45%, rgba(20, 43, 74, 0.04) 100%),
        url('../images/iae-header-bg.jpg') center/cover no-repeat;
    background-blend-mode: normal, normal, soft-light;
    z-index: 1;
}

.masthead__container {
    position: relative;
    z-index: 2;
    padding-top: 0.55rem;
    padding-bottom: 1.15rem;
}

.masthead__topline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4a6074;
    padding: 0.2rem 0 0.7rem;
    border-bottom: 1px solid rgba(8, 106, 145, 0.12);
    margin-bottom: 0.85rem;
}

.masthead__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
    opacity: 0.8;
}

.masthead__row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    min-height: 92px;
}

.masthead__brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.masthead__brand--left {
    justify-content: flex-start;
}

.masthead__brand--center {
    justify-content: center;
}

.masthead__brand--right {
    justify-content: flex-end;
}

.masthead__logo {
    width: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 1px 4px rgba(20, 43, 74, 0.10));
}

.masthead__logo--partner {
    height: 46px;
    max-width: 168px;
}

.masthead__logo--emblem {
    height: 82px;
}

.masthead__logo--iae {
    height: 74px;
}

.masthead__identity {
    text-align: center;
    padding-top: 0.8rem;
    margin-top: 0.75rem;
    border-top: 1px solid rgba(8, 106, 145, 0.10);
}

.masthead__eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-ink);
}

.masthead__title {
    margin: 0;
    font-family: var(--font-sans);
    font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.03em;
    color: #065979;
    text-transform: uppercase;
}

.masthead__subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.84rem;
    font-weight: 500;
    color: #4a6074;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.masthead__accent {
    position: relative;
    z-index: 2;
    height: 4px;
    background: linear-gradient(90deg, #065979 0%, #086a91 45%, #1c86ad 70%, #086a91 100%);
}

/* -------------------------------------------------------------------- hero */

.hero {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 2.5rem 0 2.25rem;
}

.hero__inner {
    max-width: 880px;
    margin: 0 auto;
}

.hero__eyebrow {
    margin: 0 0 .85rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold-ink);
}

.hero__title {
    margin: 0;
    max-width: 26ch;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: clamp(1.5rem, 1rem + 1.9vw, 2.25rem);
    line-height: 1.28;
    letter-spacing: -.01em;
    color: var(--navy);
    text-wrap: balance;
}

.hero__meta {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 2rem;
    margin: 1.6rem 0 0;
    padding: 1.15rem 0 0;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: .93rem;
}

.hero__meta li {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.hero__meta i {
    color: var(--gold-ink);
    font-size: 1rem;
}

/* -------------------------------------------------------------------- main */

.main {
    padding: 2.75rem 0 3.5rem;
}

/* --------------------------------------------------------------- form card */

.form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    max-width: 880px;
    margin: 0 auto;
    padding: clamp(1.5rem, 1rem + 2.4vw, 2.75rem);
}

.form-card__head {
    padding-bottom: 1.6rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 2rem;
}

.form-card__title {
    margin: 0 0 .5rem;
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--navy);
}

.form-card__intro {
    margin: 0;
    color: var(--muted);
    font-size: .97rem;
    max-width: 58ch;
}

.form-card__note {
    margin: .95rem 0 0;
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.req-mark {
    color: var(--gold-ink);
    margin-left: .25rem;
    font-weight: 700;
}

/* ---------------------------------------------------------------- sections */

.form-section {
    border: 0;
    padding: 0;
    margin: 0 0 2.15rem;
    min-width: 0;
}

.form-section + .form-section,
.bank-panel + .form-section {
    border-top: 1px solid var(--line);
    padding-top: 1.9rem;
}

.form-section__legend {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    padding: 0;
    margin-bottom: 1.35rem;
    float: left;
}

.form-section__index {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--gold-ink);
    background: var(--gold-wash);
    border: 1px solid var(--gold-line);
    border-radius: 3px;
    padding: .18rem .45rem;
    line-height: 1;
}

.form-section__name {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--navy);
}

.form-section__legend::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
    margin-left: .35rem;
}

/* ----------------------------------------------------------------- fields */

.field {
    min-width: 0;
}

.field__label {
    display: block;
    margin-bottom: .45rem;
    font-size: .84rem;
    font-weight: 600;
    color: var(--ink-soft);
    letter-spacing: .005em;
}

.field__input {
    display: block;
    width: 100%;
    height: 46px;
    padding: .5rem .85rem;
    font-family: inherit;
    font-size: .955rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-control);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.field__input::placeholder {
    color: #9AA4B2;
}

.field__input:hover:not(:disabled) {
    border-color: #BFC9D6;
}

.field__input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36, 91, 133, .14);
    background: #fff;
}

.field__input:disabled,
.field__input[readonly] {
    background: #F7F9FB;
    color: var(--muted);
}

.field__input--select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%236F7B8C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    padding-right: 2.4rem;
    cursor: pointer;
}

.field__input.is-invalid {
    border-color: var(--danger);
    background: #FDF6F5;
}

.field__input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(168, 38, 31, .12);
}

.field__error {
    margin: .4rem 0 0;
    font-size: .81rem;
    color: var(--danger);
    display: flex;
    gap: .3rem;
}

.field__error[hidden] {
    display: none;
}

.row {
    --bs-gutter-x: 1.1rem;
    --bs-gutter-y: 1.15rem;
}

/* ------------------------------------------------------------- bank panel */

.bank-panel {
    background: var(--gold-wash);
    border: 1px solid var(--gold-line);
    border-left: 3px solid var(--gold);
    border-radius: 10px;
    padding: clamp(1.15rem, 1rem + .6vw, 1.6rem);
    margin: -.35rem 0 2.15rem;
}

.bank-panel[hidden] {
    display: none;
}

.bank-panel__head {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    margin-bottom: 1.35rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px dashed var(--gold-line);
}

.bank-panel__icon {
    color: var(--gold-ink);
    font-size: 1.1rem;
    line-height: 1.4;
}

.bank-panel__title {
    margin: 0 0 .3rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--navy);
}

.bank-panel__text {
    margin: 0;
    font-size: .9rem;
    color: var(--ink-soft);
    max-width: 62ch;
}

.bank-panel .field__input {
    background: #fff;
}

/* ------------------------------------------------------------------ foot */

.form-foot {
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    margin-top: .35rem;
}

.privacy-notice {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    margin: 0 0 1.5rem;
    font-size: .82rem;
    line-height: 1.55;
    color: var(--muted);
    background: #F8FAFC;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    padding: .85rem 1rem;
}

.privacy-notice i {
    color: var(--blue);
    font-size: .95rem;
    margin-top: .12rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .85rem;
}

/* ---------------------------------------------------------------- buttons */

.btn {
    border-radius: var(--radius-control);
    font-size: .94rem;
    font-weight: 600;
    letter-spacing: .01em;
    padding: 0 1.6rem;
    height: 47px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.btn-primary {
    background: var(--navy);
    border: 1px solid var(--navy);
    color: #fff;
    min-width: 218px;
    box-shadow: 0 10px 20px -16px rgba(20, 43, 74, .9);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--navy-deep);
    border-color: var(--navy-deep);
    color: #fff;
}

.btn-primary:active {
    background: #0B1A2D;
}

.btn-primary:disabled {
    background: #5C6C82;
    border-color: #5C6C82;
    box-shadow: none;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
}

.btn-ghost:hover,
.btn-ghost:focus {
    background: #F2F5F8;
    border-color: #BFC9D6;
    color: var(--navy);
}

.btn .spinner-border {
    width: .95rem;
    height: .95rem;
    border-width: 2px;
}

/* ----------------------------------------------------------- success state */

.success-panel {
    text-align: center;
    padding: 1.5rem .5rem .75rem;
}

.success-panel[hidden] {
    display: none;
}

.success-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #EEF6F1;
    border: 1px solid #CFE6DA;
    color: var(--success);
    font-size: 1.9rem;
    margin-bottom: 1.25rem;
}

.success-panel__title {
    margin: 0 0 .6rem;
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--navy);
}

.success-panel__text {
    margin: 0 auto 1.6rem;
    max-width: 46ch;
    color: var(--ink-soft);
}

.reference-block {
    display: inline-flex;
    flex-direction: column;
    gap: .4rem;
    border: 1px dashed var(--line-strong);
    background: #F8FAFC;
    border-radius: var(--radius-control);
    padding: .9rem 1.9rem;
    margin-bottom: 1.85rem;
}

.reference-block__label {
    font-size: .7rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.reference-block__value {
    font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.32rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--navy);
    background: transparent;
}

/* --------------------------------------------------------------- closed */

.closed-notice {
    display: flex;
    gap: 1.15rem;
    align-items: flex-start;
    padding: .35rem 0;
}

.closed-notice__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 50%;
    background: var(--gold-wash);
    border: 1px solid var(--gold-line);
    color: var(--gold-ink);
    font-size: 1.35rem;
}

.closed-notice__title {
    margin: .35rem 0 .55rem;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--navy);
}

.closed-notice__text {
    margin: 0 0 1.35rem;
    color: var(--ink-soft);
    max-width: 58ch;
}

.closed-notice__meta {
    margin: 0;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    display: grid;
    gap: .75rem;
}

.closed-notice__meta dt {
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.closed-notice__meta dd {
    margin: .15rem 0 0;
    color: var(--ink);
    font-size: .95rem;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
    background: var(--navy);
    border-top: 3px solid var(--gold);
    color: #C9D2DE;
    padding: 2.4rem 0 1.8rem;
    font-size: .88rem;
}

.site-footer__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .13);
}

.site-footer__name {
    margin: 0 0 .45rem;
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .02em;
}

.site-footer__line {
    margin: 0 0 .3rem;
    color: #AEB9C8;
    max-width: 62ch;
}

.site-footer__meta {
    min-width: 220px;
}

.site-footer__meta span {
    display: inline-block;
    min-width: 58px;
    color: var(--gold);
    font-size: .7rem;
    letter-spacing: .13em;
    text-transform: uppercase;
    font-weight: 700;
    margin-right: .5rem;
}

.site-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer__copy {
    margin: 1.25rem 0 0;
    font-size: .78rem;
    color: #8593A6;
    letter-spacing: .03em;
}

.site-footer__admin-link {
    margin-top: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .7rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    color: #AEB9C8;
    font-size: .76rem;
    letter-spacing: .03em;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.site-footer__admin-link i {
    color: var(--gold);
    font-size: .8rem;
}

.site-footer__admin-link:hover,
.site-footer__admin-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .35);
    text-decoration: none;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 991.98px) {
    .masthead__caption {
        display: none;
    }

    .masthead__rule::before,
    .masthead__rule::after {
        width: 18px;
        margin: 0 .5rem;
    }
}

@media (max-width: 767.98px) {
    .hero {
        padding: 1.85rem 0 1.7rem;
    }

    .hero__title {
        max-width: none;
    }

    .hero__meta {
        flex-direction: column;
        gap: .7rem;
    }

    .main {
        padding: 1.6rem 0 2.5rem;
    }

    .form-card {
        border-radius: 12px;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions .btn {
        width: 100%;
    }

    .masthead__container {
        padding-top: 0.45rem;
        padding-bottom: 0.9rem;
    }

    .masthead__topline {
        font-size: 0.58rem;
        letter-spacing: 0.1em;
        gap: 0.45rem;
        margin-bottom: 0.65rem;
    }

    .masthead__row {
        grid-template-columns: auto 1fr auto;
        gap: 0.6rem;
        min-height: 72px;
    }

    .masthead__logo--partner {
        height: 34px;
        max-width: 120px;
    }

    .masthead__logo--emblem {
        height: 62px;
    }

    .masthead__logo--iae {
        height: 56px;
    }

    .masthead__identity {
        padding-top: 0.65rem;
        margin-top: 0.6rem;
    }

    .masthead__title {
        font-size: 1.1rem;
    }
}

@media (max-width: 575.98px) {
    .masthead__topline {
        flex-wrap: wrap;
        row-gap: 0.2rem;
    }

    .masthead__dot {
        display: none;
    }

    .masthead__row {
        gap: 0.4rem;
        min-height: 60px;
    }

    .masthead__logo--partner {
        height: 28px;
        max-width: 92px;
    }

    .masthead__logo--emblem {
        height: 52px;
    }

    .masthead__logo--iae {
        height: 46px;
    }

    .masthead__eyebrow {
        font-size: 0.58rem;
        letter-spacing: 0.14em;
    }

    .masthead__subtitle {
        font-size: 0.78rem;
    }

    .form-card__title {
        font-size: 1.18rem;
    }

    .success-panel__title {
        font-size: 1.45rem;
    }

    .reference-block {
        padding: .85rem 1.1rem;
        display: flex;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
