/* static/css/audition_form.css
   Page-scoped styling for /form/. Everything is scoped under #main-content or
   #audition-form so nothing here reaches the admin site. */

:root {
    --af-accent:        var(--ita-accent, #185fa5);
    --af-accent-soft:   var(--ita-accent-soft, #e8f1fc);
    --af-accent-bright: var(--ita-accent-bright, #2372d6);
    --af-beam:          #6db3ff;

    --af-text:          var(--ita-text, #253242);
    --af-text-soft:     var(--ita-text-soft, #5a6b7d);
    --af-text-muted:    var(--ita-text-muted, #8494a5);

    --af-surface:       var(--ita-surface, #ffffff);
    --af-surface-muted: var(--ita-surface-muted, #f6f8fb);
    --af-border:        var(--ita-border, #dfe5ec);
    --af-border-strong: var(--ita-border-strong, #c3ccd8);

    --af-danger:        var(--ita-danger-text, #b42318);
    --af-danger-bg:     var(--ita-danger-bg, #fef3f2);
    --af-danger-border: var(--ita-danger-border, #f0a9a2);

    --af-success:       var(--ita-success-text, #067647);
    --af-success-bg:    var(--ita-success-bg, #ecfdf3);
    --af-success-border:var(--ita-success-border, #a9e0c1);

    --af-radius:        var(--ita-radius-md, 10px);
    --af-radius-lg:     var(--ita-radius-lg, 14px);
    --af-shadow:        var(--ita-shadow-soft, 0 1px 3px rgba(16, 24, 40, .08));
}

.app-content-card {
    margin-top: 12px;
    margin-bottom: 20px;
}

@property --af-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}


/* ============================================================
   Shell & typography
   ============================================================ */

#main-content {
    color: var(--af-text);
    font-size: 16px;
    line-height: 1.55;
}

#main-content h1 {
    font-size: 30px;
    letter-spacing: -0.015em;
    margin: 4px 0 4px;
    color: var(--af-text);
}

.af-intro {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--af-text-muted);
}


/* ============================================================
   Sticky progress rail
   ============================================================ */

/* NOTE: temporary second copy of the signer page's progress card. Once the
   signer stylesheet is available these move to static/css/progress_card.css
   and both pages link that instead. */
/* Geometry mirrors signing_customer.css .sc-progress-card; palette is this
   page's. Extract to a shared sheet when the two are reconciled. */
.sc-progress-card {
    position: sticky;
    top: 8px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 12px 14px;
    margin-bottom: 20px;
    background: var(--af-surface);
    border: 1px solid var(--af-border);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .08);
}

.sc-progress-text {
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--af-text-muted);
}

.sc-progress-compact {
    display: none;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--af-text-muted);
}

.sc-progress-track {
    flex: 1;
    min-width: 40px;
    height: 8px;
    border-radius: 999px;
    background: var(--af-surface-muted);
    overflow: hidden;
}

.sc-progress-fill {
    height: 100%;
    width: 0;
    background: var(--af-accent);
    transition: width .2s;
}

.sc-progress-fill.is-complete { background: var(--af-success); }

.sc-action-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.sc-action-btn.is-next {
    color: var(--af-text);
    background: var(--af-surface);
    border: 1px solid var(--af-border);
}

.sc-action-btn.is-next:hover { background: var(--af-surface-muted); }

.sc-action-btn.is-ready {
    color: #fff;
    background: var(--af-accent);
    border: 1px solid var(--af-accent);
}

.sc-action-btn.is-ready:hover { filter: brightness(.94); }

.sc-action-btn:focus-visible {
    outline: 2px solid var(--af-accent);
    outline-offset: 2px;
}

.af-optional-nudge {
    margin: 0 0 20px;
    font-size: 12px;
    color: var(--af-text-muted);
}

.af-optional-nudge:empty { display: none; }

.af-optional-nudge button {
    padding: 0;
    font: inherit;
    color: var(--af-accent);
    background: none;
    border: 0;
    text-decoration: underline;
    cursor: pointer;
}


/* ============================================================
   Error summary
   ============================================================ */

.af-summary {
    margin: 0 0 20px;
    padding: 14px 16px;
    background: var(--af-danger-bg);
    border: 1px solid var(--af-danger-border);
    border-radius: var(--af-radius);
}

.af-summary[hidden] { display: none; }

.af-summary-title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--af-danger);
}

.af-summary-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.af-summary-list li { margin-top: 3px; }

.af-summary-list button {
    padding: 0;
    font-size: 13px;
    color: var(--af-danger);
    text-align: left;
    background: none;
    border: 0;
    text-decoration: underline;
    cursor: pointer;
}


/* ============================================================
   Sections
   ============================================================ */

.af-section {
    margin: 0 0 26px;
    padding: 18px 18px 8px;
    background: var(--af-surface);
    border: 1px solid var(--af-border);
    border-radius: var(--af-radius-lg);
    box-shadow: var(--af-shadow);
    transition: opacity .4s ease, filter .4s ease;
}

.af-section-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--af-border);
}

.af-section-step {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    font-size: 12px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
    color: #fff;
    background: var(--af-accent);
    border-radius: 50%;
}

.af-section-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--af-text);
}

.af-section-note {
    margin: 0;
    font-size: 13px;
    color: var(--af-text-muted);
}

/* Gated section — dimmed and non-interactive until a grade is chosen. */
.af-section.is-locked {
    opacity: .45;
    filter: saturate(.4);
}

.af-lock-note {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--af-text-soft);
    background: var(--af-surface-muted);
    border-radius: var(--af-radius);
}

.af-section:not(.is-locked) .af-lock-note { display: none; }


/* ============================================================
   Fields
   ============================================================ */

#audition-form .form-field {
    padding: 0;
    margin-bottom: 16px;
}

#audition-form label {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--af-text-soft);
}

#audition-form .af-optional {
    font-weight: 400;
    color: var(--af-text-muted);
}

#audition-form .af-hint {
    margin: 5px 0 0;
    font-size: 12px;
    color: var(--af-text-muted);
}

/* Base input treatment — also overrides the global red [required] rule in
   style.css by way of the #audition-form id. */
#audition-form input[type="text"],
#audition-form input[type="email"],
#audition-form input[type="tel"],
#audition-form select,
#audition-form textarea,
#audition-form input[required],
#audition-form select[required] {
    width: 100%;
    min-height: 46px;
    height: auto;
    padding: 11px 13px;
    font-family: inherit;
    font-size: 16px;
    color: var(--af-text);
    background: var(--af-surface);
    border: 1px solid var(--af-border);
    border-radius: var(--af-radius);
    box-shadow: none;
    transition: border-color .16s ease, box-shadow .16s ease;
    appearance: none;
    -webkit-appearance: none;
}

#audition-form textarea {
    min-height: 84px;
    line-height: 1.5;
    resize: vertical;
}

#audition-form select {
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235a6b7d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

#audition-form input:focus,
#audition-form select:focus,
#audition-form textarea:focus,
#audition-form input[required]:focus,
#audition-form select[required]:focus {
    outline: none;
    border-color: var(--af-accent);
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .16);
}

#audition-form input::placeholder,
#audition-form textarea::placeholder { color: var(--af-text-muted); }

/* Paired inputs (first / last) */
.af-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Error state — only ever applied by JS on a failed submit, never on load. */
#audition-form input.is-invalid,
#audition-form select.is-invalid,
#audition-form input[required].is-invalid,
#audition-form select[required].is-invalid {
    border-color: var(--af-danger-border);
    background: var(--af-danger-bg);
}

#audition-form input.is-invalid:focus,
#audition-form select.is-invalid:focus {
    border-color: var(--af-danger);
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .14);
}

.af-error {
    margin: 6px 0 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--af-danger);
}

/* Jump-target flash from the "next field" button */
.form-field.is-targeted input,
.form-field.is-targeted select,
.form-field.is-targeted textarea {
    animation: af-target 1.3s ease;
}

@keyframes af-target {
    0%, 100% { box-shadow: 0 0 0 0 rgba(24, 95, 165, 0); }
    25%      { box-shadow: 0 0 0 4px rgba(24, 95, 165, .22); }
}


/* ============================================================
   Grade spotlight
   ============================================================ */

.af-spotlight {
    position: relative;
    margin-bottom: 4px;
    padding: 16px;
    background: var(--af-accent-soft);
    border-radius: var(--af-radius-lg);
    transition: background .5s ease;
}

.af-spotlight::before,
.af-spotlight::after {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    pointer-events: none;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
}

/* Beam is dormant until the field scrolls into view, then loops until a grade
   is chosen. .is-armed is toggled by an IntersectionObserver. */
.af-spotlight::before {
    background: conic-gradient(from var(--af-angle),
        transparent 0deg, transparent 245deg,
        var(--af-beam) 315deg, #fff 340deg, var(--af-beam) 360deg);
    opacity: 0;
    transition: opacity .4s ease;
}

.af-spotlight.is-armed::before {
    opacity: 1;
    animation: af-trace 3.2s linear infinite;
}

/* Faint resting ring beneath the beam */
.af-spotlight::after {
    background: var(--af-beam);
    opacity: 0;
    transition: opacity .4s ease;
}

.af-spotlight.is-armed::after { opacity: .4; }

.af-spotlight .form-field { margin-bottom: 0; }

.af-spotlight label { color: var(--af-accent); }

.af-spotlight-note {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: var(--af-accent);
    opacity: .85;
}

/* Grade chosen — beam stops, ring pulses green once */
.af-spotlight.is-chosen { background: var(--af-success-bg); }

.af-spotlight.is-chosen::before {
    opacity: 0;
    animation: none;
}

.af-spotlight.is-chosen::after {
    background: var(--af-success);
    opacity: 1;
    animation: af-pulse .55s ease;
}

.af-spotlight.is-chosen label { color: var(--af-success); }

/* A beat later it goes fully calm so it stops competing for attention */
.af-spotlight.is-settled { background: var(--af-surface-muted); }

.af-spotlight.is-settled::after {
    background: var(--af-border-strong);
    animation: none;
}

.af-spotlight.is-settled label { color: var(--af-text-soft); }

@keyframes af-trace    { to { --af-angle: 360deg; } }
@keyframes af-beam-out { to { opacity: 0; } }
@keyframes af-ring-in  { to { opacity: 1; } }
@keyframes af-pulse    { 0% { opacity: 1; } 45% { opacity: .35; } 100% { opacity: 1; } }


/* ============================================================
   Class time blocks
   ============================================================ */

#class_time_blocks {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--af-surface-muted);
    border-radius: var(--af-radius);
}

#class_time_blocks p {
    margin: 0;
    font-size: 13px;
    color: var(--af-text-muted);
}

#class_time_blocks label {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--af-text);
    cursor: pointer;
}

#class_time_blocks label:last-child { margin-bottom: 0; }

#class_time_blocks input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--af-accent);
    flex-shrink: 0;
}

#class_time_blocks label.is-locked-row {
    color: var(--af-text-muted);
    cursor: default;
}


/* ============================================================
   Submit
   ============================================================ */

.af-submit-wrap {
    margin-top: 22px;
    text-align: center;
}

.af-submit {
    width: 100%;
    max-width: 380px;
    padding: 15px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--af-text-muted);
    border: 0;
    border-radius: var(--af-radius);
    cursor: pointer;
    transition: background .25s ease, box-shadow .25s ease, transform .12s ease;
}

.af-submit.is-armed {
    background: var(--af-accent);
    box-shadow: 0 4px 14px rgba(24, 95, 165, .28);
}

.af-submit:hover  { filter: brightness(1.06); }
.af-submit:active { transform: translateY(1px); }

.af-submit-note {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--af-text-muted);
}


/* ============================================================
   Deposit card (migrated from the template's inline <style>)
   ============================================================ */

.venmo-deposit-card {
    margin-top: 4px;
    padding: 14px;
    border: 1px solid var(--af-border);
    border-radius: var(--af-radius);
    background: var(--af-surface-muted);
}

.venmo-deposit-card .venmo-btn-wrap {
    display: flex;
    justify-content: center;
}

.venmo-deposit-card .venmo-btn {
    width: 100%;
    max-width: 360px;
}

.venmo-deposit-card .venmo-help {
    max-width: 520px;
    margin: 10px auto 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--af-text-muted);
    text-align: center;
}

.venmo-deposit-card .venmo-check-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    max-width: 520px;
    margin: 12px auto 0;
}

.venmo-deposit-card .venmo-check-wrap input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--af-accent);
}

.venmo-deposit-card .venmo-check-wrap label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--af-text);
    cursor: pointer;
}


/* ============================================================
   8th grade callout (migrated from the template's inline <style>)
   ============================================================ */

.eighth-grade-callout {
    margin: 0 0 18px;
    padding: 18px 18px 12px;
    border: 2px solid #f59e0b;
    border-radius: var(--af-radius-lg);
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.eighth-grade-callout h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #92400e;
}

.eighth-grade-callout p {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #78350f;
}

.eighth-grade-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin: 16px 0 8px;
}

.eighth-choice-btn {
    flex: 1;
    min-width: 180px;
    max-width: 240px;
    padding: 16px 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    background: #fff;
    border: 2px solid #d97706;
    border-radius: var(--af-radius);
    cursor: pointer;
    transition: background .15s, transform .15s, box-shadow .15s;
}

.eighth-choice-btn:hover {
    background: #fef3c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.eighth-choice-btn.selected {
    color: #fff;
    background: #f59e0b;
    border-color: #92400e;
}

.eighth-choice-confirmed {
    margin-top: 6px;
    font-weight: 600;
    color: #065f46;
    text-align: center;
}


/* ============================================================
   Success modal + signing banner (migrated verbatim in behaviour)
   ============================================================ */

#success-modal h2 {
    max-width: 90%;
    margin: 0 auto;
    font-size: 1.5em;
    text-align: center;
    word-wrap: break-word;
}

.calendar-btn {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 300px;
    margin: 10px auto;
    text-align: center;
}

.sign-banner {
    --sb-bg: #e8f1fc;
    --sb-accent: #185fa5;
    --sb-btn: #2372d6;
    --sb-btn-text: #ffffff;
    --sb-beam: #6db3ff;
    --sb-ring: #6db3ff;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    padding: 16px;
    text-align: left;
    background: var(--sb-bg);
    border-radius: 12px;
}

.sign-banner::before,
.sign-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    pointer-events: none;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
}

.sign-banner::before {
    background: conic-gradient(from var(--af-angle),
        transparent 0deg, transparent 245deg,
        var(--sb-beam) 315deg, #fff 340deg, var(--sb-beam) 360deg);
    animation: af-trace 2.6s linear 3, af-beam-out .5s ease 7.8s forwards;
}

.sign-banner::after {
    background: var(--sb-ring);
    opacity: 0;
    animation: af-ring-in .5s ease 7.8s forwards;
}

.sign-banner-icon { color: var(--sb-accent); flex-shrink: 0; }
.sign-banner-body { flex: 1; min-width: 0; }

.sign-banner-title {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sb-accent);
}

.sign-banner-sub {
    margin: 0;
    font-size: 13px;
    color: var(--sb-accent);
    opacity: .82;
}

.sign-banner-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    color: var(--sb-btn-text);
    background: var(--sb-btn);
    border-radius: 8px;
    transition: filter .15s ease;
}

.sign-banner-btn:hover { filter: brightness(1.08); }

.sign-banner.is-calm { background: #f4f7fb; }
.sign-banner.is-calm::before { display: none; }

.sign-banner.is-calm::after {
    opacity: 1;
    background: #d7e3f2;
    animation: none;
}

.sign-banner.is-calm .sign-banner-icon,
.sign-banner.is-calm .sign-banner-title,
.sign-banner.is-calm .sign-banner-sub { color: #4b5b6b; }

.sign-banner.is-calm .sign-banner-btn { background: #64748b; }


/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 600px) {
    /* Content card butts against the black #header with no gap on mobile —
       drop the top corner rounding so it reads as one continuous surface
       instead of showing little cutouts of the page background. Combined
       selector for specificity over style.css's .content rule; bottom
       corners and desktop are untouched. */
    .content.app-content-card {
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    #main-content h1 { font-size: 25px; }

    .sc-progress-card {
        gap: .55rem;
        padding: 10px 12px;
    }

    .sc-progress-text    { display: none; }
    .sc-progress-compact { display: inline; }

    .sc-action-btn {
        padding: 8px 11px;
        font-size: .78rem;
    }

    .af-field-row { grid-template-columns: 1fr; }

    .af-section { padding: 15px 15px 6px; }

    .eighth-choice-btn { min-width: 100%; }
}


/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .af-spotlight::before,
    .af-spotlight.is-armed::before,
    .sign-banner::before { display: none; }

    .af-spotlight.is-armed::after,
    .sign-banner::after {
        opacity: 1;
        animation: none;
    }

    .sc-progress-fill { transition: none; }

    .form-field.is-targeted input,
    .form-field.is-targeted select,
    .form-field.is-targeted textarea { animation: none; }
}