:root {
  color-scheme: light;
  --forest-950: var(--brand-blue-900);
  --forest-900: var(--brand-blue-900);
  --forest-800: var(--brand-blue-800);
  --forest-700: var(--brand-blue-700);
  --green-500: var(--brand-blue-500);
  --lime-300: var(--brand-blue-200);
  --cream: var(--brand-blue-25);
  --paper: var(--brand-white);
  --ink: var(--brand-blue-900);
  --muted: var(--brand-muted);
  --line: var(--brand-blue-200);
  --danger: #b33a3a;
  --shadow: 0 24px 70px color-mix(in srgb, var(--brand-blue-900) 13%, transparent);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); }
button, input { font: inherit; }
a { color: var(--forest-700); text-underline-offset: 3px; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, 0.92fr) minmax(520px, 1.08fr); }
.brand-panel { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; padding: clamp(34px, 4.5vw, 72px); color: white; background: linear-gradient(145deg, var(--brand-blue-900) 0%, var(--brand-blue-800) 52%, var(--brand-blue-700) 100%); }
.brand-panel::before { content: ""; position: absolute; inset: 0; z-index: -3; opacity: .22; background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.22) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, black, transparent 82%); }
.brand-panel::after { content: ""; position: absolute; width: 44vw; height: 44vw; min-width: 560px; min-height: 560px; right: -42%; bottom: -34%; z-index: -1; border: 1px solid color-mix(in srgb, var(--brand-blue-100) 34%, transparent); border-radius: 48% 52% 48% 52%; box-shadow: 0 0 0 56px color-mix(in srgb, var(--brand-blue-100) 4.5%, transparent), 0 0 0 112px color-mix(in srgb, var(--brand-blue-100) 3.5%, transparent), 0 0 0 168px color-mix(in srgb, var(--brand-blue-100) 2.5%, transparent); transform: rotate(-12deg); }
.brand-glow { position: absolute; border-radius: 50%; filter: blur(3px); z-index: -2; }
.brand-glow-one { width: 440px; height: 440px; left: -210px; top: 28%; background: color-mix(in srgb, var(--brand-blue-300) 16%, transparent); }
.brand-glow-two { width: 260px; height: 260px; right: 5%; top: -110px; background: color-mix(in srgb, var(--brand-blue-200) 12%, transparent); }
.brand-grid { position: absolute; width: 210px; height: 210px; right: 8%; top: 18%; border: 1px solid rgba(255,255,255,.1); transform: rotate(45deg); z-index: -1; }
.brand-grid::before, .brand-grid::after { content: ""; position: absolute; inset: 33%; border: 1px solid rgba(255,255,255,.1); }
.brand-grid::after { inset: 16%; }

.brand-lockup, .mobile-brand { display: flex; align-items: center; gap: 15px; }
.seal-wrap { width: 58px; height: 58px; padding: 5px; display: grid; place-items: center; border-radius: 15px; background: rgba(255,255,255,.96); box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.seal-wrap img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { display: flex; flex-direction: column; gap: 3px; text-transform: uppercase; letter-spacing: .08em; }
.brand-name strong { font-family: Georgia, "Times New Roman", serif; font-size: 19px; letter-spacing: .025em; text-transform: none; }
.brand-name small { max-width: 330px; font-size: 9px; line-height: 1.35; opacity: .72; letter-spacing: .075em; }
.brand-message { margin: auto 0; max-width: 650px; padding: 90px 0 70px; }
.eyebrow, .section-label, .success-kicker { display: inline-block; font-size: 12px; line-height: 1; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { color: var(--lime-300); }
.brand-message h1 { margin: 25px 0 22px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(43px, 4.15vw, 70px); font-weight: 400; line-height: 1.04; letter-spacing: -.035em; }
.brand-message p { max-width: 520px; margin: 0; color: rgba(255,255,255,.72); font-size: clamp(16px, 1.25vw, 19px); line-height: 1.7; }
.brand-footer { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.55); font-size: 12px; letter-spacing: .04em; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime-300); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-blue-200) 10%, transparent); }

.login-panel { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.mobile-brand { display: none; }
.form-wrap { width: min(470px, calc(100% - 64px)); margin: auto; padding: 60px 0 32px; }
.form-heading { margin-bottom: 42px; }
.section-label, .success-kicker { color: var(--forest-700); }
.form-heading h2 { margin: 15px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 3.3vw, 52px); line-height: 1.05; font-weight: 400; letter-spacing: -.03em; }
.form-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.field-group { margin-bottom: 23px; }
.field-group label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 650; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; }
.text-button { padding: 0; border: 0; color: var(--forest-700); background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.input-wrap { position: relative; }
.input-symbol { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 22px; color: var(--brand-muted); font-size: 15px; font-weight: 700; pointer-events: none; }
.key-symbol { font-size: 13px; letter-spacing: 1px; }
.input-wrap input { width: 100%; height: 56px; padding: 0 17px 0 50px; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--ink); background: var(--brand-blue-25); transition: border-color .2s, box-shadow .2s, background .2s; }
.input-wrap input::placeholder { color: var(--brand-muted); }
.input-wrap input:hover { border-color: var(--brand-blue-200); background: white; }
.input-wrap input:focus { border-color: var(--forest-700); background: white; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-blue-700) 10%, transparent); }
.form-options { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: -1px 0 28px; font-size: 13px; }
.form-options a { text-decoration: none; font-weight: 600; }
.form-options a:hover { text-decoration: underline; }
.checkbox-label { display: inline-flex !important; align-items: center; gap: 9px; margin: 0 !important; color: var(--muted); cursor: pointer; font-weight: 500 !important; }
.checkbox-label input { position: absolute; opacity: 0; }
.custom-check { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid var(--brand-blue-200); border-radius: 5px; background: white; transition: .2s; }
.checkbox-label input:checked + .custom-check { border-color: var(--forest-700); background: var(--forest-700); }
.checkbox-label input:checked + .custom-check::after { content: "✓"; color: white; font-size: 12px; font-weight: 800; }
.checkbox-label input:focus-visible + .custom-check { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-blue-700) 12%, transparent); }
.form-status { min-height: 0; margin: 0; font-size: 13px; line-height: 1.4; }
.form-status:not(:empty) { min-height: 20px; margin: -10px 0 14px; }
.form-status.error { color: var(--danger); }
.form-status.success { color: var(--forest-700); }
.primary-button { width: 100%; height: 58px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 12px; color: white; background: var(--forest-900); box-shadow: 0 10px 25px color-mix(in srgb, var(--brand-blue-900) 18%, transparent); cursor: pointer; font-weight: 700; transition: transform .2s, background .2s, box-shadow .2s; }
.primary-button:hover { background: var(--forest-800); box-shadow: 0 13px 30px color-mix(in srgb, var(--brand-blue-900) 24%, transparent); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.primary-button:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 3px; }
.primary-button:disabled { cursor: wait; opacity: .78; transform: none; }
.button-arrow { font-size: 21px; font-weight: 400; transition: transform .2s; }
.primary-button:hover .button-arrow { transform: translateX(3px); }
.support-note { display: flex; align-items: center; gap: 13px; margin-top: 33px; padding-top: 27px; border-top: 1px solid var(--brand-blue-50); color: var(--muted); font-size: 12px; line-height: 1.55; }
.support-note p { margin: 0; }
.support-note a { font-weight: 650; text-decoration: none; }
.support-icon { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--brand-blue-100); border-radius: 50%; color: var(--forest-700); font-weight: 800; }
.legal-footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px clamp(32px, 4vw, 68px); color: var(--brand-muted); font-size: 11px; }
.legal-footer a { color: inherit; text-decoration: none; }

.success-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #dbe9d0, transparent 30%), var(--cream); }
.success-card { width: min(560px, 100%); padding: 56px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); text-align: center; }
.success-card img { width: 84px; margin-bottom: 28px; }
.success-card h1 { margin: 16px 0 12px; font: 400 clamp(32px, 5vw, 48px)/1.08 Georgia, serif; }
.success-card p { margin: 0 0 30px; color: var(--muted); line-height: 1.6; }

.role-page { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(circle at 85% 12%, color-mix(in srgb, var(--brand-blue-200) 28%, transparent), transparent 28%), radial-gradient(circle at 8% 84%, color-mix(in srgb, var(--brand-blue-700) 10%, transparent), transparent 25%), var(--cream); }
.role-header { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 24px clamp(24px, 5vw, 72px); }
.role-brand { display: flex; align-items: center; gap: 12px; color: var(--forest-900); text-decoration: none; }
.role-brand img { width: 48px; height: 48px; }
.role-brand span { display: flex; flex-direction: column; }
.role-brand strong { font: 700 16px Georgia, serif; letter-spacing: .01em; }
.role-brand small { max-width: 320px; margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.3; letter-spacing: .04em; text-transform: uppercase; }
.role-logout { padding: 10px 18px; border: 1px solid var(--brand-blue-100); border-radius: 10px; color: var(--forest-800); background: rgba(255,255,255,.52); cursor: pointer; font-weight: 650; }
.role-logout:hover { background: white; }
.role-main { width: min(820px, calc(100% - 40px)); margin: auto; padding: 60px 0; }
.role-intro { max-width: 680px; margin-bottom: 36px; }
.role-intro h1 { margin: 14px 0 12px; font: 400 clamp(40px, 6vw, 62px)/1.05 Georgia, serif; letter-spacing: -.035em; }
.role-intro p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.role-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.role-card { position: relative; min-height: 118px; display: grid; grid-template-columns: 52px 1fr 24px; align-items: center; gap: 17px; padding: 20px; border: 1px solid var(--brand-blue-50); border-radius: 17px; color: var(--ink); background: color-mix(in srgb, var(--brand-gold-50) 84%, transparent); box-shadow: 0 7px 22px color-mix(in srgb, var(--brand-blue-900) 4%, transparent); cursor: pointer; text-align: left; transition: transform .2s, border-color .2s, box-shadow .2s, background .2s; }
.role-card:hover, .role-card:focus-visible { transform: translateY(-2px); border-color: var(--brand-blue-300); background: white; box-shadow: 0 14px 32px color-mix(in srgb, var(--brand-blue-900) 10%, transparent); outline: none; }
.role-card.selected { border-color: var(--forest-700); background: var(--brand-blue-25); }
.role-card:disabled:not(.selected) { opacity: .55; cursor: wait; transform: none; }
.role-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: white; background: var(--forest-800); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.role-mark-course_manager { color: var(--forest-950); background: var(--lime-300); }
.role-mark-teacher { background: var(--brand-blue-600); }
.role-mark-student { background: #91683e; }
.role-mark-dean_office { background: #7a567e; }
.role-mark-department_head { background: #3f5a8a; }
.role-copy { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.role-copy strong { font: 600 18px Georgia, serif; }
.role-copy small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.role-arrow { color: var(--forest-700); font-size: 22px; transition: transform .2s; }
.role-card:hover .role-arrow { transform: translateX(3px); }
.role-loading { grid-column: 1 / -1; padding: 42px; border: 1px dashed var(--brand-blue-100); border-radius: 17px; color: var(--muted); text-align: center; }
.role-load-error { color: var(--danger); }
.role-error { margin-top: 18px !important; }
.role-footer { padding: 24px; color: var(--brand-muted); font-size: 12px; text-align: center; }

@media (max-width: 980px) {
  .login-shell { grid-template-columns: minmax(330px, .78fr) minmax(460px, 1.22fr); }
  .brand-message h1 { font-size: 48px; }
}
@media (max-width: 760px) {
  .login-shell { display: block; }
  .brand-panel { display: none; }
  .login-panel { min-height: 100svh; }
  .mobile-brand { display: flex; padding: 24px 26px; border-bottom: 1px solid var(--brand-blue-25); }
  .mobile-brand img { width: 44px; height: 44px; }
  .mobile-brand span { display: flex; flex-direction: column; color: var(--forest-900); }
  .mobile-brand strong { font: 700 15px Georgia, serif; letter-spacing: .01em; }
  .mobile-brand small { max-width: 280px; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.3; letter-spacing: .04em; text-transform: uppercase; }
  .form-wrap { width: min(470px, calc(100% - 44px)); padding: 48px 0 32px; }
  .form-heading { margin-bottom: 34px; }
  .legal-footer { padding: 22px; }
  .role-main { padding: 34px 0 50px; }
  .role-list { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .form-heading h2 { font-size: 38px; }
  .form-options { align-items: flex-start; flex-direction: column; gap: 14px; }
  .legal-footer { flex-direction: column; gap: 8px; }
  .success-card { padding: 40px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
