/* =========================================================
   CAREER COMPASS AUTHENTICATION
   OLD FORM DESIGN + SCHOOL BACKGROUND
========================================================= */

@import url('tokens.css');

:root {
    --green: var(--brand-primary, #155b2a);
    --green-dark: var(--brand-primary-dark, #0d3f1d);
    --green-soft: var(--brand-primary-soft, #edf5ee);
    --text: var(--text-heading, #0f172a);
    --muted: var(--text-muted, #64748b);
    --border: var(--surface-border, #e2e8f0);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--surface-bg, #f8fafc);
    color: var(--text-body, #334155);
    font-family: var(--font-sans, 'Inter', -apple-system, sans-serif);
    -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------
   BACK / CLOSE BUTTON
--------------------------------------------------------- */
.auth-close-btn {
    position: fixed;
    top: 24px;
    right: 26px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.07));
    border: 1px solid var(--surface-border, #e2e8f0);
    z-index: 100;
    transition: all var(--transition-fast, 150ms ease);
}

.auth-close-btn:hover {
    color: var(--brand-primary, #155b2a);
    border-color: var(--brand-primary, #155b2a);
    transform: scale(1.05);
}

/* ---------------------------------------------------------
   MAIN CARD
--------------------------------------------------------- */
.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px 25px;
}

.auth-card {
    width: 100%;
    max-width: 1020px;
    min-height: 610px;
    display: grid;
    grid-template-columns: 55% 45%;
    overflow: hidden;
    background: #fff;
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(226, 232, 240, 0.8);
}

.auth-card-signup {
    grid-template-columns: 45% 55%;
    min-height: 670px;
}

/* ---------------------------------------------------------
   OLD FORM SIDE
--------------------------------------------------------- */
.auth-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 45px 55px;
    background: #fff;
    position: relative;
    z-index: 2;
}

.auth-logo {
    width: 82px;
    height: 82px;
    object-fit: contain;
    margin-bottom: 15px;
}

.auth-logo-small {
    width: 70px;
    height: 70px;
    margin-bottom: 12px;
}

.auth-heading,
.auth-heading-tight {
    margin: 0 0 28px;
    color: #333;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .5px;
    text-align: center;
}

.auth-heading-tight {
    margin-bottom: 22px;
}

.auth-form {
    width: 100%;
    max-width: 380px;
}

.input-group {
    position: relative;
    width: 100%;
    margin-bottom: 14px;
}

.input-group > i:first-child {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
}

.input-group input,
.strand-select {
    width: 100%;
    height: 48px;
    padding: 0 44px;
    border: 1.5px solid var(--surface-border, #e2e8f0);
    border-radius: var(--radius-sm, 8px);
    background: #fff;
    color: var(--text-heading, #0f172a);
    font-family: inherit;
    font-size: 14px;
    transition: all var(--transition-fast, 150ms ease);
}

.input-group input::placeholder {
    color: var(--text-faint, #94a3b8);
}

.input-group input:focus,
.strand-select:focus {
    outline: none;
    border-color: var(--brand-primary, #155b2a);
    box-shadow: 0 0 0 3.5px rgba(21, 91, 42, 0.16);
}

.input-group input:hover,
.strand-select:hover {
    border-color: var(--surface-border-strong, #cbd5e1);
}

.strand-select {
    appearance: auto;
    cursor: pointer;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #64748b);
    cursor: pointer;
    z-index: 3;
    transition: color var(--transition-fast, 150ms ease);
}

.toggle-password:hover {
    color: var(--brand-primary, #155b2a);
}

.forgot-password {
    width: 100%;
    margin: 4px 0 22px;
    text-align: right;
}

.forgot-password a {
    color: var(--brand-primary, #155b2a);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast, 150ms ease);
}

.forgot-password a:hover {
    color: var(--brand-primary-hover, #114a22);
    text-decoration: underline;
}

.auth-btn {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: var(--radius-sm, 8px);
    background: var(--brand-primary, #155b2a);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(21, 91, 42, 0.22);
    transition: all var(--transition-fast, 150ms ease);
}

.auth-btn:hover {
    background: var(--brand-primary-hover, #114a22);
    box-shadow: 0 6px 18px rgba(21, 91, 42, 0.30);
    transform: translateY(-1px);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-divider {
    width: 100%;
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 18px;
    color: var(--text-muted, #64748b);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--surface-border, #e2e8f0);
}

.btn-google {
    width: 100%;
    max-width: 380px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1.5px solid var(--surface-border, #e2e8f0);
    border-radius: var(--radius-sm, 8px);
    background: #fff;
    color: var(--text-heading, #0f172a);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0,0,0,0.05));
    transition: all var(--transition-fast, 150ms ease);
}

.btn-google:hover {
    border-color: var(--surface-border-strong, #cbd5e1);
    background: var(--surface-subtle, #f1f5f9);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.07));
    transform: translateY(-1px);
}

.btn-google:disabled {
    opacity: .65;
    cursor: wait;
}

.auth-error {
    width: 100%;
    max-width: 380px;
    margin: -10px 0 16px;
    padding: 10px 12px;
    border: 1px solid #efc9c9;
    border-radius: 4px;
    background: #fff5f5;
    color: #a33a3a;
    font-size: 12px;
}

/* ---------------------------------------------------------
   OLD GREEN / BRANDING SIDE
   School background replaces the old decorative shapes.
--------------------------------------------------------- */
.auth-right {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 55px 48px;
    text-align: center;
    color: #fff;
    background-color: var(--green-dark);
    background-image:
        linear-gradient(
            rgba(20, 83, 43, .88),
            rgba(20, 83, 43, .94)
        ),
        url("../assets/school_bg.png");
    background-position: center;
    background-size: cover;
}

.auth-right::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0,0,0,.05),
        rgba(0,0,0,.10)
    );
    pointer-events: none;
}

.auth-right > * {
    position: relative;
    z-index: 2;
}

.wavy-shape {
    display: none;
}

.auth-brand-logo {
    display: block;
    height: 80px;
    max-height: 85px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    margin: 0 auto 16px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.auth-heading-white {
    margin: 0 0 15px;
    color: #fff;
    font-size: 29px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: .6px;
}

.auth-subtitle {
    width: min(350px, 100%);
    margin: 0 0 27px;
    color: rgba(255,255,255,.90);
    font-size: 14px;
    line-height: 1.7;
}

.btn-outline {
    min-width: 155px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
    border: 1.5px solid rgba(255,255,255,0.85);
    border-radius: var(--radius-sm, 8px);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    color: #fff;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all var(--transition-fast, 150ms ease);
}

.btn-outline:hover {
    background: #fff;
    color: var(--brand-primary-dark, #0d3f1d);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* ---------------------------------------------------------
   SIGNUP FORM SPACING
--------------------------------------------------------- */

/* Divided first / middle / last name fields */
.name-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin-bottom: 14px;
}

.name-fields .input-group {
    margin-bottom: 0;
    min-width: 0;
}

.name-fields .input-group input {
    min-width: 0;
}

@media (max-width: 700px) {
    .name-fields {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.auth-card-signup .auth-left {
    padding-top: 38px;
    padding-bottom: 38px;
}

.auth-card-signup .auth-logo-small {
    margin-bottom: 8px;
}

.auth-card-signup .auth-heading-tight {
    margin-bottom: 18px;
}

.auth-card-signup .input-group {
    margin-bottom: 9px;
}

.auth-card-signup .auth-divider {
    margin-top: 14px;
    margin-bottom: 12px;
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */
@media (max-width: 850px) {
    .auth-card,
    .auth-card-signup {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .auth-right {
        order: -1;
        min-height: 300px;
        padding: 45px 35px;
    }

    .auth-left {
        min-height: 570px;
        padding: 45px 35px;
    }

    .auth-card-signup .auth-left {
        min-height: 610px;
    }
}

/* Keep signup panels side by side on tablets without changing phone or login layouts. */
@media (min-width: 641px) and (max-width: 850px) {
    .auth-card.auth-card-signup { grid-template-columns: 40% 60%; max-width: 1020px; }
    .auth-card.auth-card-signup .auth-right,
    .auth-card.auth-card-signup .auth-left { order: initial; min-height: 0; padding: 30px 24px; }
    .auth-card.auth-card-signup .name-fields { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .auth-page-wrapper {
        padding: 20px 12px;
    }

    .auth-card {
        border-radius: 8px;
    }

    .auth-left,
    .auth-card-signup .auth-left {
        padding: 38px 22px;
    }

    .auth-right {
        min-height: 270px;
        padding: 38px 22px;
    }

    .auth-brand-logo {
        height: 70px;
        max-width: 135px;
        margin-bottom: 12px;
    }

    .auth-heading,
    .auth-heading-tight {
        font-size: 21px;
    }

    .auth-heading-white {
        font-size: 25px;
    }

    .auth-close-btn {
        top: 10px;
        right: 10px;
    }
}

/* ---------------------------------------------------------
   PASSWORD RESET PAGES
--------------------------------------------------------- */
.auth-help-text {
    width: 100%;
    max-width: 380px;
    margin: -10px 0 22px;
    color: #777;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

.auth-success {
    width: 100%;
    max-width: 380px;
    margin: -10px 0 16px;
    padding: 10px 12px;
    border: 1px solid #c9dfcf;
    border-radius: 4px;
    background: #f2f8f3;
    color: #28623a;
    font-size: 12px;
    line-height: 1.5;
}

.auth-warning {
    width: 100%;
    max-width: 380px;
    margin: -10px 0 16px;
    padding: 10px 12px;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    line-height: 1.5;
}

.auth-info {
    width: 100%;
    max-width: 380px;
    margin: -10px 0 16px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    line-height: 1.5;
}

.auth-alert-link {
    display: inline-block;
    margin-top: 6px;
    font-weight: 600;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.auth-back-link {
    margin-top: 18px;
    text-align: center;
    font-size: 12px;
}

.auth-back-link a {
    color: var(--green);
    text-decoration: none;
}

.auth-back-link a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------
   ROLE / PORTAL SWITCH TABS
--------------------------------------------------------- */
.auth-portal-tabs {
    display: flex;
    width: 100%;
    max-width: 380px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    margin: -6px 0 20px;
    border: 1px solid #e2e8f0;
    gap: 4px;
}

.portal-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 5;
    transition: all 0.2s ease;
    font-family: inherit;
    user-select: none;
}

.portal-tab-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.7);
}

.portal-tab-btn.active {
    background: #fff;
    color: var(--green, #155b2a);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.staff-portal-badge {
    display: none;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 9px 13px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin: -8px 0 16px;
    width: 100%;
    max-width: 380px;
    line-height: 1.45;
}

.staff-portal-badge i {
    color: #15803d;
    font-size: 15px;
    flex-shrink: 0;
}


@media (max-width: 420px) {
    .auth-portal-tabs {
        max-width: 100%;
    }
    .portal-tab-btn {
        font-size: 11.5px;
        padding: 8px 6px;
        gap: 5px;
    }
}
