/*
 * Public Affiliate Membership pages (/affiliate/apply, submitted, closed).
 * Builds on member.css tokens and components.
 */
.a-header { background: var(--m-surface); border-bottom: 1px solid var(--m-line); }
.a-header__in { max-width: 1180px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.a-header img { height: 36px; width: auto; display: block; }

.a-hero { background: var(--m-green); color: #fff; position: relative; overflow: hidden; }
.a-hero::after { content: ''; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(233, 196, 106, .12); pointer-events: none; }
.a-hero__in { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 40px 24px 96px; display: flex; flex-direction: column; gap: 14px; }
.a-hero h1 { margin: 0; font-family: var(--m-display); font-size: 38px; line-height: 1.15; font-weight: 700; letter-spacing: -.4px; max-width: 720px; }
.a-hero p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--m-on-green); max-width: 640px; }
.a-hero__pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.a-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); font-size: 13px; font-weight: 700; color: #fff; }
.a-pill svg { color: var(--m-gold-bright); flex-shrink: 0; }

.a-wrap { max-width: 1180px; margin: -64px auto 0; padding: 0 24px 56px; position: relative; z-index: 2; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.a-wrap--single { grid-template-columns: minmax(0, 1fr); max-width: 720px; }

.a-aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.a-sponsor { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; background: var(--m-gold-soft); border: 1px solid #EBD9A6; }
.a-sponsor__label { font-size: 12px; font-weight: 700; color: var(--m-gold-ink); }
.a-sponsor__name { font-size: 15px; font-weight: 800; color: var(--m-ink); }

.a-progress { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.a-progress li { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: 14px; font-weight: 700; color: var(--m-faint); }
.a-progress li:not(:last-child)::after { content: ''; position: absolute; left: 14px; top: 38px; bottom: -10px; width: 2px; background: var(--m-line); }
.a-progress__no { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--m-surface); border: 2px solid var(--m-line); font-size: 13px; font-weight: 800; color: var(--m-faint); position: relative; z-index: 1; }
.a-progress li.is-current { color: var(--m-ink); }
.a-progress li.is-current .a-progress__no { border-color: var(--m-gold-bright); background: var(--m-gold-bright); color: var(--m-ink); }
.a-progress li.is-done { color: var(--m-ink-2); }
.a-progress li.is-done .a-progress__no { border-color: var(--m-green); background: var(--m-green); color: #fff; }
.a-progress li.is-done:not(:last-child)::after { background: var(--m-green); }

.a-needs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--m-ink-2); }
.a-needs li { display: flex; gap: 10px; align-items: flex-start; }
.a-needs svg { color: var(--m-green); flex-shrink: 0; margin-top: 1px; }
.a-note { padding: 16px; border-radius: 16px; background: var(--m-green-soft); color: var(--m-success); font-size: 13px; line-height: 1.55; font-weight: 600; }
.a-note strong { display: block; font-size: 14px; color: var(--m-green); margin-bottom: 2px; }

.a-form { padding: 0; gap: 0; overflow: hidden; box-shadow: 0 18px 50px rgba(20, 32, 26, .08); }
.a-form__head { padding: 26px 32px 20px; border-bottom: 1px solid var(--m-line); display: flex; flex-direction: column; gap: 14px; }
.a-form__eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--m-gold); }
.a-form__title { margin: 2px 0 0; font-family: var(--m-display); font-size: 26px; font-weight: 700; letter-spacing: -.2px; }
.a-form__lead { margin: 4px 0 0; font-size: 14px; color: var(--m-muted); line-height: 1.55; }
.a-form__body { padding: 28px 32px; }
.a-form__foot { padding: 18px 32px; border-top: 1px solid var(--m-line); background: var(--m-surface-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.a-form__foot .m-muted { font-size: 13px; }

.a-panel { display: none; flex-direction: column; gap: 22px; }
.a-panel.is-active { display: flex; animation: a-in .25s ease-out; }
@keyframes a-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .a-panel.is-active { animation: none; } }
.a-section { display: flex; flex-direction: column; gap: 14px; }
.a-section + .a-section { padding-top: 22px; border-top: 1px dashed var(--m-line); }
.a-section__title { margin: 0; font-size: 15px; font-weight: 800; color: var(--m-ink); }
.a-section__lead { margin: -6px 0 0; font-size: 13px; color: var(--m-muted); line-height: 1.55; }
.a-span-2 { grid-column: 1 / -1; }

.m-field label, .m-field > span:first-child { font-size: 13px; font-weight: 700; color: var(--m-ink-2); }
.m-field .a-req { color: var(--m-danger-ink); margin-left: 2px; }
.a-hint { font-size: 12px; font-weight: 500; color: var(--m-muted); line-height: 1.45; }
.m-error:empty { display: none; }
.m-input.is-invalid, .m-select.is-invalid { border-color: var(--m-danger-ink); box-shadow: 0 0 0 3px rgba(180, 35, 24, .1); }
.m-check.is-invalid { background: var(--m-danger-bg); box-shadow: inset 0 0 0 1px #F5C2BC; }
.m-check.is-checked { background: var(--m-green-tint); box-shadow: inset 0 0 0 1px var(--m-green-line); }
.a-upper { text-transform: uppercase; }
.a-upper::placeholder { text-transform: none; }

.a-checks { display: flex; flex-direction: column; gap: 10px; }
.a-checkline { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
.a-checkline input { width: 20px; height: 20px; margin: 0; accent-color: var(--m-green); }

.a-uploads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.a-uploads .m-field { gap: 8px; }
.a-uploads .m-upload { min-height: 128px; padding: 18px 14px; transition: border-color .15s, background .15s; }
.a-uploads .m-upload:hover { border-color: var(--m-green); background: var(--m-green-tint); }
.a-uploads .m-upload:focus-within { outline: 3px solid rgba(11, 79, 51, .3); outline-offset: 2px; }
.a-uploads .m-upload.is-selected { border-style: solid; border-color: var(--m-green); background: var(--m-green-soft); }
.a-uploads .m-upload.is-invalid { border-color: var(--m-danger-ink); background: var(--m-danger-bg); }
.a-uploads .m-upload__title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-upload__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--m-surface); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(20, 32, 26, .08); }

.a-legal { font-size: 13.5px; line-height: 1.6; color: var(--m-ink-2); }
.a-alert { padding: 14px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; background: var(--m-danger-bg); color: #7A1A12; border: 1px solid #F5C2BC; margin-bottom: 20px; }
.a-alert[hidden] { display: none; }
.a-help { margin: 0 4px; font-size: 13px; color: var(--m-muted); }
.a-wrap > .a-help { grid-column: 2; margin-top: -8px; }

.a-foot { border-top: 1px solid var(--m-line); padding: 20px 24px; text-align: center; font-size: 12.5px; color: var(--m-faint); }

/* Result pages (submitted / closed) */
.a-result { align-items: center; text-align: center; padding: 40px 36px; gap: 18px; box-shadow: 0 18px 50px rgba(20, 32, 26, .08); }
.a-result__icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--m-green-soft); color: var(--m-green); }
.a-result__icon--wait { background: var(--m-gold-soft); color: var(--m-gold); }
.a-result h2 { margin: 0; font-family: var(--m-display); font-size: 28px; font-weight: 700; letter-spacing: -.2px; }
.a-result p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--m-muted); max-width: 520px; }
.a-appno { display: inline-flex; flex-direction: column; gap: 4px; padding: 14px 26px; border-radius: 14px; background: var(--m-ground); border: 1px dashed var(--m-green-line); }
.a-appno small { font-size: 12px; font-weight: 700; color: var(--m-muted); text-transform: uppercase; letter-spacing: .8px; }
.a-appno strong { font-family: var(--m-mono); font-size: 22px; color: var(--m-green); letter-spacing: .5px; }
.a-next { list-style: none; margin: 6px 0 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; text-align: left; }
.a-next li { padding: 16px; border-radius: 14px; background: var(--m-surface-2); border: 1px solid var(--m-line); display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--m-muted); line-height: 1.5; }
.a-next strong { font-size: 14px; color: var(--m-ink); }
.a-next .m-step__no { width: 26px; height: 26px; font-size: 12px; }
.a-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.a-warn { width: 100%; padding: 14px 16px; border-radius: 14px; background: var(--m-warn-tint); border: 1px solid var(--m-warn-line); color: #7C4A22; font-size: 13px; font-weight: 600; line-height: 1.55; text-align: left; }

@media (max-width: 1023px) {
    .a-wrap { grid-template-columns: minmax(0, 1fr); padding: 0 16px 40px; margin-top: -56px; }
    .a-aside { position: static; }
    .a-wrap > .a-help { grid-column: auto; }
    .a-aside .a-steps-card, .a-aside .a-needs-card { display: none; }
    .a-hero__in { padding: 28px 16px 84px; }
    .a-hero h1 { font-size: 29px; }
    .a-hero p { font-size: 15px; }
    .a-header__in { padding: 12px 16px; }
    .a-header img { height: 30px; }
    .a-form__head, .a-form__body { padding-left: 20px; padding-right: 20px; }
    .a-form__foot { padding: 14px 20px; position: sticky; bottom: 0; z-index: 5; }
    .a-form__title { font-size: 22px; }
    .a-uploads, .a-next { grid-template-columns: minmax(0, 1fr); }
    .a-result { padding: 28px 20px; }
    .a-result h2 { font-size: 24px; }
}
@media (max-width: 560px) {
    .a-form__foot .m-muted { display: none; }
    .a-form__foot .m-btn { flex: 1 1 0; }
    .a-hero__pills { gap: 8px; }
    .a-pill { font-size: 12px; padding: 6px 11px; }
}
@media print { .a-header .m-btn, .a-hero { display: none; } }

.m-body [hidden] { display: none !important; }
