* { box-sizing: border-box; }

.auth-page {
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-rgb: 79, 70, 229;
    --tint: #eef2ff;
    --story-start: #3730a3;
    --story-end: #514bd5;
    --story-glow: #a5b4fc;
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    color: #18243b;
    background: radial-gradient(ellipse at 0 0, rgba(var(--accent-rgb), .07), transparent 48%), #f6f7fb;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-teacher {
    --accent: #047857;
    --accent-hover: #065f46;
    --accent-rgb: 4, 120, 87;
    --tint: #ecfdf5;
    --story-start: #065f46;
    --story-end: #047857;
    --story-glow: #6ee7b7;
}

.auth-psychologist {
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-rgb: 124, 58, 237;
    --tint: #f5f0ff;
    --story-start: #6b21a8;
    --story-end: #9640b0;
    --story-glow: #f0abfc;
}

.auth-page a { color: inherit; text-decoration: none; }
.auth-page button, .auth-page input { font: inherit; }
.auth-page button, .auth-page a, .auth-page input { -webkit-tap-highlight-color: transparent; }
.auth-page svg { display: block; width: 22px; height: 22px; flex: 0 0 auto; }
.auth-page a:focus-visible, .auth-page button:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

.auth-topbar {
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 25px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.auth-brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.auth-brand img { width: 52px; height: 50px; object-fit: contain; flex: 0 0 auto; }
.auth-brand strong { display: block; font-size: 14px; font-weight: 700; line-height: 1.5; }
.auth-brand > span > span { display: block; margin-top: 3px; font-size: 12px; color: #6b7487; line-height: 1.5; }
.auth-back { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 0 8px 12px; color: #5a6477 !important; font-size: 13px; font-weight: 600; white-space: nowrap; }
.auth-back svg { width: 18px; height: 18px; }
.auth-back:hover { color: var(--accent) !important; }
.auth-main { width: 100%; padding: 16px 40px 30px; display: grid; place-items: center; flex: 1; }
.auth-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 26px;
    box-shadow: 0 24px 64px -32px rgba(31, 41, 70, .25), 0 4px 12px -5px rgba(31, 41, 70, .04);
    overflow: hidden;
}
.auth-story {
    min-width: 0;
    padding: 42px 46px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(145deg, var(--story-start), var(--story-end));
}
.auth-story::before {
    content: '';
    position: absolute;
    z-index: -1;
    width: 430px;
    height: 430px;
    top: -230px;
    right: -205px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    box-shadow: 0 0 0 44px rgba(255,255,255,.035), 0 0 0 88px rgba(255,255,255,.025);
}
.auth-story::after {
    content: '';
    position: absolute;
    z-index: -1;
    width: 400px;
    height: 400px;
    left: -230px;
    bottom: -275px;
    background: var(--story-glow);
    opacity: .25;
    filter: blur(60px);
    border-radius: 50%;
}
.auth-story-content { position: relative; }
.auth-story-label { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.88); }
.auth-story-label > span { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.12); }
.auth-story-symbol { margin-top: 36px; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.23); background: rgba(255,255,255,.1); }
.auth-story-symbol svg { width: 32px; height: 32px; }
.auth-story h2 { margin: 24px 0 16px; max-width: 390px; font-size: clamp(30px, 2.8vw, 38px); font-weight: 700; line-height: 1.21; letter-spacing: -1.2px; text-wrap: balance; }
.auth-story-description { max-width: 360px; margin: 0; color: rgba(255,255,255,.83); font-size: 14px; line-height: 1.8; }
.auth-features { list-style: none; padding: 0; margin: 34px 0 36px; display: grid; gap: 23px; }
.auth-features li { display: flex; align-items: center; gap: 13px; }
.auth-feature-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.11); }
.auth-feature-icon svg { width: 19px; height: 19px; }
.auth-features strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.5; }
.auth-features li > span > span { display: block; color: rgba(255,255,255,.9); font-size: 11px; line-height: 1.6; margin-top: 3px; }
.auth-story-footer { display: flex; align-items: center; gap: 12px; border-top: 1px solid rgba(255,255,255,.19); padding-top: 22px; font-size: 11px; color: rgba(255,255,255,.9); }
.auth-story-footer > span:first-child { font-weight: 700; letter-spacing: .4px; color: #fff; }
.auth-story-footer > span + span { border-left: 1px solid rgba(255,255,255,.3); padding-left: 12px; }

.auth-panel { padding: 38px 46px 36px; min-width: 0; align-self: center; }
.auth-roles { display: grid; grid-template-columns: 1fr 1.15fr 1fr; padding: 5px; gap: 4px; border-radius: 12px; background: #f3f4f8; margin-bottom: 32px; }
.auth-roles a { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 42px; padding: 8px 5px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 600; color: #687183; transition: background .15s, color .15s; }
.auth-roles svg { width: 16px; height: 16px; }
.auth-roles a:hover { color: var(--accent); background: rgba(255,255,255,.65); }
.auth-roles a[aria-current] { color: var(--accent); background: #fff; border-color: rgba(var(--accent-rgb), .12); box-shadow: 0 2px 5px rgba(31,41,70,.06); }
.auth-role-label { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 12px; font-weight: 600; }
.auth-role-label svg { width: 17px; height: 17px; }
.auth-form-header h1 { margin: 13px 0 9px; font-size: 30px; line-height: 1.25; letter-spacing: -.9px; font-weight: 700; }
.auth-form-header p { color: #6b7487; font-size: 13px; line-height: 1.7; margin: 0; }
.auth-form { margin-top: 27px; }
.auth-field + .auth-field { margin-top: 20px; }
.auth-field label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; line-height: 1.5; color: #384358; }
.auth-input-wrap { position: relative; }
.auth-input-icon { position: absolute; top: 0; left: 15px; bottom: 0; display: flex; align-items: center; color: #9aa2b2; pointer-events: none; }
.auth-input-icon svg { width: 19px; height: 19px; }
.auth-field input { display: block; width: 100%; min-height: 52px; padding: 13px 15px 13px 44px; border: 1px solid #dce0e8; border-radius: 10px; background: #fcfcfe; color: #18243b; font-size: 15px; line-height: 24px; outline: none; transition: border-color .15s, box-shadow .15s; }
.auth-field input::placeholder { color: #687386; opacity: 1; font-size: 13px; }
.auth-field input:hover { border-color: #b8bfce; }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .1); background: #fff; }
.auth-input-wrap:focus-within .auth-input-icon { color: var(--accent); }
.auth-field input[type="password"], .auth-field input#password { padding-right: 52px; }
.auth-field input::-ms-reveal { display: none; }
.auth-password-toggle { border: 0; padding: 0; position: absolute; right: 5px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; background: transparent; color: #7f889b; border-radius: 7px; cursor: pointer; }
.auth-password-toggle:hover { color: var(--accent); background: var(--tint); }
.auth-password-toggle svg { width: 19px; height: 19px; }
.auth-eye-slash { position: absolute; width: 24px; height: 1.7px; background: currentColor; transform: rotate(45deg); border: 1px solid #fff; display: none; }
.auth-password-toggle[aria-pressed="true"] .auth-eye-slash { display: block; }
.auth-caps-lock { margin: 7px 0 0; color: #9a6700; font-size: 12px; }
.auth-submit { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; width: 100%; padding: 13px 20px; margin-top: 25px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 4px 9px rgba(var(--accent-rgb), .14); cursor: pointer; transition: background .15s, box-shadow .15s; }
.auth-submit svg { width: 18px; height: 18px; }
.auth-submit:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 5px 14px rgba(var(--accent-rgb), .24); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { cursor: wait; opacity: .75; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: #687386; font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: #e9ebf1; flex: 1; }
.auth-oauth { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; min-height: 54px; border: 1px solid #dce0e8; border-radius: 10px; background: #fff; color: #384358 !important; transition: background .15s, border-color .15s; }
.auth-oauth > span:nth-child(2) { flex: 1; font-size: 13px; font-weight: 600; }
.auth-oauth > svg { width: 17px; height: 17px; color: #9aa2b2; }
.auth-oauth-brand { flex: 0 0 49px; color: var(--accent); font-size: 10px; letter-spacing: -.3px; font-weight: 800; border-right: 1px solid #e5e7ef; padding: 5px 12px 5px 0; }
.auth-oneid-brand { color: #554b91; font-size: 13px; letter-spacing: -.7px; }
.auth-oauth:hover { border-color: rgba(var(--accent-rgb), .4); background: var(--tint); }
.auth-oauth-hint { margin: 11px 0 0; color: #687386; font-size: 11px; line-height: 1.7; }
.auth-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px; padding-top: 20px; margin-top: 22px; border-top: 1px solid #e9ebf1; font-size: 11px; line-height: 1.7; color: #687386; }
.auth-help a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; }
.auth-help a:hover { text-decoration: underline; }
.auth-help a svg { width: 12px; height: 12px; transform: rotate(-45deg); }
.auth-admin-help { flex-wrap: nowrap; justify-content: flex-start; align-items: flex-start; gap: 8px; }
.auth-admin-help > svg { width: 15px; height: 15px; margin-top: 2px; }
.auth-alert { display: flex; align-items: flex-start; gap: 9px; border: 1px solid; border-radius: 9px; padding: 12px; font-size: 12px; line-height: 1.6; margin-top: 20px; overflow-wrap: anywhere; }
.auth-alert svg { width: 18px; height: 18px; margin-top: 1px; }
.auth-alert-error { color: #b42318; border-color: #fecaca; background: #fff5f5; }
.auth-alert-success { color: #067647; border-color: #a6f4c5; background: #f0fdf4; }
.auth-page-footer { text-align: center; padding: 0 20px 22px; color: #687386; font-size: 11px; line-height: 1.7; }
.auth-page-footer > span { padding: 0 6px; }

@media (min-width: 1500px) {
    .auth-topbar { padding-top: 32px; padding-bottom: 32px; }
    .auth-main { padding-bottom: 40px; }
    .auth-shell { width: 1160px; }
    .auth-story { padding: 48px 54px 32px; }
    .auth-panel { padding: 42px 60px; }
}
@media (max-width: 1023px) {
    .auth-topbar { padding: 20px 28px; }
    .auth-main { padding: 12px 28px 28px; }
    .auth-story { padding: 35px 28px 26px; }
    .auth-panel { padding: 30px 28px; }
    .auth-story h2 { font-size: 32px; }
    .auth-features li { gap: 10px; }
    .auth-features strong { font-size: 12px; }
    .auth-form-header h1 { font-size: 28px; }
}
@media (max-width: 767px) {
    .auth-page { background: radial-gradient(ellipse at 50% 0, rgba(var(--accent-rgb), .08), transparent 55%), #f6f7fb; }
    .auth-topbar { max-width: 520px; padding: 20px 24px 16px; gap: 12px; }
    .auth-brand { gap: 10px; }
    .auth-brand img { width: 44px; height: 43px; }
    .auth-brand strong { max-width: 240px; font-size: 12px; line-height: 1.5; }
    .auth-brand > span > span { font-size: 10px; margin-top: 2px; }
    .auth-back { width: 40px; min-height: 40px; padding: 0; justify-content: center; flex: 0 0 40px; border: 1px solid #e0e3ec; border-radius: 10px; background: rgba(255,255,255,.7); }
    .auth-back span { display: none; }
    .auth-main { display: block; max-width: 520px; margin: 0 auto; padding: 8px 20px 24px; flex: 0 0 auto; }
    .auth-shell { display: block; border-radius: 20px; border-top: 3px solid var(--accent); box-shadow: 0 15px 40px -24px rgba(var(--accent-rgb), .24); }
    .auth-story { display: none; }
    .auth-panel { padding: 24px; }
    .auth-roles { margin-bottom: 28px; }
    .auth-roles a { font-size: 11px; gap: 5px; }
    .auth-roles svg { width: 15px; height: 15px; }
    .auth-role-label { font-size: 11px; }
    .auth-form-header h1 { font-size: 27px; margin-top: 12px; }
    .auth-form-header p { font-size: 12px; line-height: 1.8; }
    .auth-form { margin-top: 25px; }
    .auth-field input { font-size: 16px; }
    .auth-field input::placeholder { font-size: 12px; }
    .auth-help { margin-top: 20px; padding-top: 18px; }
    .auth-page-footer { padding: 0 16px 20px; margin-top: auto; font-size: 10px; }
}
@media (max-width: 374px) {
    .auth-topbar { padding: 16px; }
    .auth-brand strong { font-size: 11px; }
    .auth-brand > span > span { font-size: 9px; }
    .auth-brand img { width: 39px; height: 38px; }
    .auth-main { padding: 4px 12px 20px; }
    .auth-panel { padding: 22px 18px; }
    .auth-roles { gap: 2px; padding: 4px; }
    .auth-roles a { font-size: 10px; gap: 4px; }
    .auth-roles svg { width: 14px; height: 14px; }
    .auth-form-header h1 { font-size: 25px; }
    .auth-oauth { gap: 10px; padding-left: 12px; padding-right: 12px; }
    .auth-oauth > span:nth-child(2) { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-page *, .auth-page *::before, .auth-page *::after { transition: none !important; }
}
