/* ============================================
   CollegeDreams — Split-Screen Auth Layout
   Premium SaaS-quality authentication UI
   ============================================ */

:root {
    --cd-blue-50:  #eff6ff;
    --cd-blue-100: #dbeafe;
    --cd-blue-200: #bfdbfe;
    --cd-blue-500: #3b82f6;
    --cd-blue-600: #2563eb;
    --cd-blue-700: #1d4ed8;
    --cd-blue-800: #1e40af;
    --cd-blue-900: #1e3a5f;
    --cd-orange-500: #f97316;
    --cd-orange-600: #ea580c;
    --cd-gray-50:  #f9fafb;
    --cd-gray-100: #f3f4f6;
    --cd-gray-200: #e5e7eb;
    --cd-gray-300: #d1d5db;
    --cd-gray-500: #6b7280;
    --cd-gray-600: #4b5563;
    --cd-gray-700: #374151;
    --cd-gray-800: #1f2937;
    --cd-gray-900: #111827;
    --cd-radius:   10px;
    --cd-radius-lg: 14px;
    --cd-shadow:   0 10px 40px rgba(0,0,0,.08);
    --cd-transition: .3s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; height: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--cd-gray-800);
    height: 100%;
    overflow: hidden;
}

/* ============================================
   SPLIT CONTAINER
   ============================================ */
.auth-split {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ============================================
   LEFT — VISUAL PANEL
   ============================================ */
.auth-split__visual {
    position: relative;
    width: 52%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.auth-split__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: imgFadeIn 1.2s ease forwards;
}

@keyframes imgFadeIn {
    from { opacity: 0; transform: scale(1.05); }
    to   { opacity: 1; transform: scale(1); }
}

.auth-split__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(30, 64, 175, .55) 0%,
        rgba(30, 58, 95, .85) 100%
    );
    z-index: 1;
}

/* Brand logo top-left */
.auth-split__brand {
    position: absolute;
    top: 32px;
    left: 36px;
    z-index: 2;
}

.auth-split__logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.auth-split__logo-img {
    height: 38px;
    filter: brightness(0) invert(1);
}

.auth-split__logo-link span {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.5px;
}

/* Quote */
.auth-split__quote {
    position: relative;
    z-index: 2;
    padding: 0 40px 24px;
    animation: quoteSlide .8s ease .3s both;
}

@keyframes quoteSlide {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-split__quote h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 8px;
    letter-spacing: -.5px;
}

.auth-split__quote p {
    font-size: 1.05rem;
    color: rgba(255,255,255,.75);
    line-height: 1.5;
}

/* Stats bar */
.auth-split__stats {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 20px 40px 36px;
    animation: quoteSlide .8s ease .5s both;
}

.auth-split__stat {
    text-align: center;
    flex: 1;
}

.auth-split__stat strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
}

.auth-split__stat span {
    font-size: .8rem;
    color: rgba(255,255,255,.55);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.auth-split__stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,.2);
}

/* ============================================
   RIGHT — FORM PANEL
   ============================================ */
.auth-split__form {
    flex: 1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.auth-form-scroll {
    width: 100%;
    max-width: 440px;
    padding: 48px 32px;
    animation: formEnter .6s ease .15s both;
}

@keyframes formEnter {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FORM CARD (rendered by each page)
   ============================================ */
.auth-form-card {
    width: 100%;
}

/* ── Logo inside form ── */
.afc-logo {
    text-align: center;
    margin-bottom: 6px;
}

.afc-logo img {
    height: 50px;
    margin-bottom: 6px;
}

.afc-logo .afc-brand {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--cd-blue-700);
    letter-spacing: -.4px;
}

/* ── Heading ── */
.afc-heading {
    text-align: center;
    margin-bottom: 28px;
}

.afc-heading h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--cd-gray-900);
    margin: 0 0 4px;
}

.afc-heading p {
    font-size: .9rem;
    color: var(--cd-gray-500);
    margin: 0;
}

.afc-heading a {
    color: var(--cd-blue-600);
    font-weight: 600;
    text-decoration: none;
}
.afc-heading a:hover { text-decoration: underline; }

/* ── Icon badge (reset/forgot pages) ── */
.afc-icon-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--cd-blue-50);
    color: var(--cd-blue-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 18px;
}

/* ── Info banner ── */
.afc-info-banner {
    background: var(--cd-blue-50);
    border: 1px solid var(--cd-blue-100);
    border-radius: var(--cd-radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.afc-info-banner i {
    color: var(--cd-blue-600);
    font-size: 1rem;
    flex-shrink: 0;
}

.afc-info-banner span {
    font-size: .84rem;
    color: var(--cd-gray-600);
    line-height: 1.45;
}

/* ── Validation ── */
.auth-form-card .text-danger { margin-bottom: 14px; }
.auth-form-card .text-danger ul { padding-left: 18px; margin: 0; }
.auth-form-card .text-danger li { font-size: .82rem; }
.field-validation-error {
    font-size: .78rem;
    color: #ef4444;
    margin-top: 4px;
    display: block;
}

/* ── Form groups ── */
.afc-field {
    margin-bottom: 20px;
}

.afc-field label {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    color: var(--cd-gray-700);
    margin-bottom: 6px;
}

.afc-field label .req { color: #ef4444; }

.afc-input-wrap {
    position: relative;
}

.afc-input-wrap .afc-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cd-gray-500);
    font-size: .9rem;
    pointer-events: none;
    transition: var(--cd-transition);
}

.afc-input-wrap input.form-control {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 1.5px solid var(--cd-gray-200);
    border-radius: var(--cd-radius);
    font-size: .95rem;
    color: var(--cd-gray-800);
    background: var(--cd-gray-50);
    transition: var(--cd-transition);
    outline: none;
    font-family: inherit;
}

.afc-input-wrap input.form-control:focus {
    border-color: var(--cd-blue-500);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

.afc-input-wrap input.form-control:focus ~ .afc-icon {
    color: var(--cd-blue-600);
}

/* Toggle password */
.afc-toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--cd-gray-500);
    font-size: 1rem;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    transition: var(--cd-transition);
}
.afc-toggle-pw:hover { color: var(--cd-blue-600); }

/* ── Forgot link row ── */
.afc-forgot {
    text-align: right;
    margin-top: -12px;
    margin-bottom: 20px;
}

.afc-forgot a {
    font-size: .84rem;
    color: var(--cd-blue-600);
    text-decoration: none;
    font-weight: 500;
}
.afc-forgot a:hover { text-decoration: underline; }

/* ── Submit button ── */
.afc-submit {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 50px;
    background: var(--cd-blue-600);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--cd-transition);
    box-shadow: 0 4px 14px rgba(37,99,235,.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.afc-submit:hover {
    background: var(--cd-blue-700);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,.35);
}

.afc-submit:active {
    transform: translateY(0);
}

/* ── Bottom link ── */
.afc-bottom {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--cd-gray-100);
}

.afc-bottom p {
    font-size: .85rem;
    color: var(--cd-gray-500);
    margin: 0;
}

.afc-bottom a {
    color: var(--cd-blue-600);
    font-weight: 600;
    text-decoration: none;
}
.afc-bottom a:hover { text-decoration: underline; }

/* ── OTP inputs (for verify-otp page) ── */
.afc-otp-wrap {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.afc-otp-wrap .otp-input {
    width: 48px;
    height: 56px;
    border: 1.5px solid var(--cd-gray-200);
    border-radius: var(--cd-radius);
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--cd-gray-800);
    background: var(--cd-gray-50);
    outline: none;
    transition: var(--cd-transition);
    font-family: inherit;
}

.afc-otp-wrap .otp-input:focus {
    border-color: var(--cd-blue-500);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

/* ── Footer ── */
.auth-form-footer {
    text-align: center;
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--cd-gray-500);
    font-size: .8rem;
}

.auth-form-footer i {
    font-size: .85rem;
    color: var(--cd-gray-400, #9ca3af);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .auth-split__visual { width: 45%; }
    .auth-split__quote h2 { font-size: 1.6rem; }
}

@media (max-width: 768px) {
    body { overflow-y: auto; }

    .auth-split {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .auth-split__visual {
        width: 100%;
        min-height: 260px;
        max-height: 300px;
    }

    .auth-split__brand { top: 20px; left: 24px; }

    .auth-split__quote {
        padding: 0 24px 16px;
    }

    .auth-split__quote h2 { font-size: 1.35rem; }
    .auth-split__quote p { font-size: .9rem; }

    .auth-split__stats { padding: 12px 24px 24px; }
    .auth-split__stat strong { font-size: 1.1rem; }

    .auth-split__form {
        align-items: flex-start;
    }

    .auth-form-scroll {
        padding: 32px 20px;
        max-width: 100%;
    }
}

/* ── Step indicator (onboarding) ── */
.afc-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
}

.afc-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--cd-gray-300);
    position: relative;
}

.afc-step .step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--cd-gray-100);
    color: var(--cd-gray-400, #9ca3af);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    transition: var(--cd-transition);
}

.afc-step.active .step-num {
    background: var(--cd-blue-600);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

.afc-step.done .step-num {
    background: #10b981;
    color: #fff;
}

.afc-step .step-label {
    display: none;
}

.afc-step-line {
    width: 32px;
    height: 2px;
    background: var(--cd-gray-200);
    margin: 0 6px;
}

.afc-step-line.done {
    background: #10b981;
}

/* ── Two-column grid for forms with many fields ── */
.afc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.afc-grid .afc-field.full {
    grid-column: 1 / -1;
}

/* ── Select/dropdown styling ── */
.afc-input-wrap select.form-control {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 1.5px solid var(--cd-gray-200);
    border-radius: var(--cd-radius);
    font-size: .95rem;
    color: var(--cd-gray-800);
    background: var(--cd-gray-50);
    transition: var(--cd-transition);
    outline: none;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
}

.afc-input-wrap select.form-control:focus {
    border-color: var(--cd-blue-500);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

/* ── File input styling ── */
.afc-input-wrap input[type="file"].form-control {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1.5px dashed var(--cd-gray-200);
    border-radius: var(--cd-radius);
    font-size: .88rem;
    color: var(--cd-gray-600);
    background: var(--cd-gray-50);
    transition: var(--cd-transition);
    outline: none;
    font-family: inherit;
    cursor: pointer;
}

.afc-input-wrap input[type="file"].form-control:hover,
.afc-input-wrap input[type="file"].form-control:focus {
    border-color: var(--cd-blue-500);
    background: #fff;
}

/* ── Success status page ── */
.afc-status {
    text-align: center;
    padding: 20px 0;
}

.afc-status-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(16,185,129,.3);
}

.afc-status h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cd-gray-900);
    margin: 0 0 12px;
}

.afc-status p {
    font-size: .92rem;
    color: var(--cd-gray-500);
    line-height: 1.6;
    margin: 0 0 28px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.afc-status .afc-submit {
    max-width: 260px;
    margin: 0 auto;
}

/* ── Wider form scroll for complex forms ── */
.auth-form-scroll.wide {
    max-width: 540px;
}

@media (min-width: 769px) {
    .afc-step .step-label {
        display: inline;
    }
}

@media (max-width: 480px) {
    .auth-split__visual {
        min-height: 200px;
        max-height: 240px;
    }

    .auth-split__stats { display: none; }

    .auth-form-scroll { padding: 24px 16px; }

    .afc-heading h2 { font-size: 1.3rem; }

    .afc-otp-wrap .otp-input {
        width: 40px;
        height: 48px;
        font-size: 1.1rem;
    }

    .afc-grid {
        grid-template-columns: 1fr;
    }

    .afc-step-line { width: 20px; }
}
