/* ============================================
   FORTUNE 300 SCHOOLS – Application Form Styles
   ============================================ */

/* ========== RESET & VARIABLES ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-deep: #050a18;
    --bg-primary: #0a1128;
    --bg-elevated: #0f1a35;
    --bg-card: #111d3a;
    --gold: #d4a843;
    --gold-light: #f0cc6b;
    --gold-dark: #b08d2e;
    --gold-glow: rgba(212, 168, 67, 0.15);
    --accent: #4f8cff;
    --teal: #34d399;
    --teal-soft: rgba(52, 211, 153, 0.12);
    --coral: #f87171;
    --white: #ffffff;
    --text-primary: rgba(255,255,255,0.95);
    --text-secondary: rgba(255,255,255,0.65);
    --text-muted: rgba(255,255,255,0.4);
    --glass: rgba(255,255,255,0.04);
    --glass-border: rgba(255,255,255,0.08);
    --glass-border-hover: rgba(255,255,255,0.15);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --error: #ef4444;
    --success: #22c55e;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background: var(--bg-deep);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Noise texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

/* Background mesh */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 800px 600px at 20% 20%, rgba(212, 168, 67, 0.04), transparent),
        radial-gradient(ellipse 600px 500px at 80% 80%, rgba(79, 140, 255, 0.03), transparent);
}

.app-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== HEADER ========== */
.app-header {
    padding: 20px 0;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(5, 10, 24, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.app-header-logo img {
    height: 40px;
    width: auto;
    border-radius: 8px;
}

.app-header-logo-text {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-primary);
}

.app-header-logo-text .gold { color: var(--gold); }

.back-link {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass);
    transition: var(--transition);
}

.back-link:hover {
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}

/* ========== MAIN CONTENT ========== */
.app-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 28px 80px;
}

.app-container {
    max-width: 780px;
    width: 100%;
}

.app-title-section {
    text-align: center;
    margin-bottom: 48px;
}

.app-title-section h1 {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 400;
    margin-bottom: 8px;
}

.app-title-section h1 .gold { color: var(--gold); }

.app-title-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.instruction-notice {
    background: rgba(212, 168, 67, 0.06);
    border: 1px solid rgba(212, 168, 67, 0.22);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 32px;
    color: var(--text-secondary);
}

.instruction-notice h2 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--gold-light);
    margin-bottom: 12px;
}

.instruction-notice p {
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

.instruction-notice p:last-child {
    margin-bottom: 0;
}

.instruction-notice strong {
    color: var(--text-primary);
}

.instruction-notice ul {
    list-style: none;
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
}

.instruction-notice li {
    position: relative;
    padding-left: 22px;
    font-size: 0.9rem;
    line-height: 1.55;
}

.instruction-notice li::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: var(--gold);
    font-weight: 800;
}

/* ========== PROGRESS BAR (removed — single-step form) ========== */

/* ========== FORM CARD ========== */
.form-card {
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.2), transparent);
}

/* ========== FORM SECTIONS (single-step) ========== */
.form-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--glass-border);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.form-section-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
}

.form-section-header h2 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 2px;
}

.form-section-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.form-section-subhead {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    padding: 16px 0 8px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 4px;
}

.success-card {
    text-align: center;
}

.step-header {
    margin-bottom: 36px;
}

.step-header h2 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 8px;
}

.step-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== FORM ELEMENTS ========== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full { grid-column: 1 / -1; }

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.form-label .required {
    color: var(--coral);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
    outline: none;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.1);
    background: rgba(212, 168, 67, 0.04);
}

.form-input.error,
.form-select.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
    font-size: 0.78rem;
    color: var(--error);
    display: none;
}

.form-error.visible { display: block; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========== CHECKBOX / RADIO (used by radio group) ========== */

/* ========== RADIO GROUP ========== */
.form-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.form-radio {
    position: relative;
}

.form-radio input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.form-radio label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.form-radio input:checked + label {
    background: rgba(212, 168, 67, 0.08);
    border-color: rgba(212, 168, 67, 0.4);
    color: var(--gold-light);
}

.form-radio label:hover {
    border-color: var(--glass-border-hover);
}

/* ========== SECTION DIVIDER ========== */
.section-divider {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    padding: 16px 0 8px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 4px;
}

/* ========== REVIEW STEP ========== */
.review-section {
    margin-bottom: 28px;
}

.review-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
}

.review-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.review-row:last-child { border-bottom: none; }

.review-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.review-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
}

.review-value.empty {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
}

/* ========== CONSENT ========== */
.consent-box {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 24px;
}

.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.consent-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    accent-color: var(--gold);
    margin-top: 2px;
    flex-shrink: 0;
}

.consent-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.consent-text a {
    color: var(--gold);
    text-decoration: underline;
    text-decoration-color: rgba(212, 168, 67, 0.3);
}

/* ========== BUTTONS ========== */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--glass-border);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--glass);
    color: var(--text-secondary);
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
}

.btn-back:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--glass-border-hover);
}

.btn-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--bg-deep);
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-next::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: var(--transition);
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(212, 168, 67, 0.35);
}

.btn-next:hover::after { opacity: 1; }

.btn-submit {
    background: linear-gradient(135deg, var(--teal), #059669);
    color: var(--white);
    padding: 16px 40px;
}

.btn-submit:hover {
    box-shadow: 0 8px 32px rgba(52, 211, 153, 0.35);
}

.btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== SUCCESS STATE ========== */
.success-screen {
    display: none;
    text-align: center;
    padding: 60px 40px;
}

.success-screen.active { display: block; }

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 28px;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.success-screen h2 {
    font-family: 'Instrument Serif', serif;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 12px;
}

.success-screen p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 480px;
    margin: 0 auto 12px;
    line-height: 1.7;
}

.success-ref {
    display: inline-block;
    background: var(--teal-soft);
    border: 1px solid rgba(52, 211, 153, 0.2);
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--teal);
    margin: 24px 0;
    letter-spacing: 1px;
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
}

.success-actions a,
.success-actions button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-outline-gold {
    background: var(--glass);
    color: var(--gold);
    border: 1px solid rgba(212, 168, 67, 0.3);
}

.btn-outline-gold:hover {
    background: rgba(212, 168, 67, 0.08);
}

/* ========== SPINNER ========== */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(10, 22, 40, 0.3);
    border-top-color: var(--bg-deep);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .app-header-inner { padding: 0 20px; }
    .app-main { padding: 32px 20px 60px; }
    .form-card { padding: 32px 24px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full { grid-column: auto; }
    .progress-step-label { display: none; }
    .progress-steps::before { left: 20px; right: 20px; }
    .progress-line { left: 20px; }
    .form-actions { flex-direction: column-reverse; gap: 12px; }
    .form-actions .btn-back,
    .form-actions .btn-next { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .form-check-group { flex-direction: column; }
    .form-check label { width: 100%; }
}
