
:root {
  color-scheme: light;
  --bg: #f0eefb;
  --card: #ffffff;
  --card-soft: rgba(255, 255, 255, .82);
  --ink: #17153b;
  --mute: #625e8e;
  --line: rgba(85, 82, 163, .18);
  --grid: rgba(85, 82, 163, .06);
  --indigo: #5552a3;
  --indigo-dark: #3d3a83;
  --brass: #f9c412;
  --brass-soft: #fff3c2;
  --rose: #c0345f;
  --rose-soft: #fde3ea;
  --green: #287d61;
  --green-soft: #e1f4ec;
  --radius: 18px;
  font-family: 'Space Grotesk', 'Avenir Next', Avenir, ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

/* Keep the original light palette even when the device/browser prefers dark mode. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light;
    --bg: #f0eefb;
    --card: #ffffff;
    --card-soft: rgba(255, 255, 255, .82);
    --ink: #17153b;
    --mute: #625e8e;
    --line: rgba(85, 82, 163, .18);
    --grid: rgba(85, 82, 163, .06);
    --indigo: #5552a3;
    --indigo-dark: #3d3a83;
    --brass: #f9c412;
    --brass-soft: #fff3c2;
    --rose: #c0345f;
    --rose-soft: #fde3ea;
    --green: #287d61;
    --green-soft: #e1f4ec;
  }
}

* { box-sizing: border-box; }
html, body, #root { min-height: 100%; margin: 0; }
body {
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  background-image: radial-gradient(var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
input, select, textarea { color: var(--ink); background-color: #fff; }
input::placeholder, textarea::placeholder { color: #77739a; opacity: 1; }
:focus-visible { outline: 3px solid rgba(85, 82, 163, .45); outline-offset: 2px; }

/* Preserve the prototype's designation/contact hues in both light and dark system modes. */
.designation, .contact-value, .phone-number, .email-address { color: var(--ink) !important; }
.contact-link, .email-link { color: var(--indigo-dark) !important; }
.phone-link, .whatsapp-link { color: var(--green) !important; }
.status-approved { color: var(--green) !important; }
.status-pending { color: #795e00 !important; }
.status-attention { color: var(--rose) !important; }

.auth-page { min-height: 100vh; display: flex; flex-direction: column; padding: 0 clamp(18px, 5vw, 76px); }
.app-header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-header { border-bottom: 1px solid var(--line); }
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 45px; height: 42px; object-fit: contain; flex: 0 0 auto; }
.brand-name { color: var(--ink); font-size: 18px; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; }
.brand-subtitle { color: var(--indigo); font-size: 9px; font-weight: 700; letter-spacing: .18em; margin-top: 5px; }
.secure-label { display: inline-flex; align-items: center; gap: 7px; color: var(--mute); font-size: 12px; white-space: nowrap; }
.secure-label svg, .privacy-note svg { color: var(--green); flex: 0 0 auto; }
.auth-layout { width: min(1140px, 100%); flex: 1; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); align-items: center; gap: clamp(36px, 8vw, 112px); padding: 44px 0 56px; }
.auth-intro { position: relative; overflow: hidden; min-height: 400px; display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 5vw, 58px) 0; }
.intro-kicker, .card-eyebrow { display: flex; align-items: center; gap: 10px; color: var(--indigo); font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.kicker-line { width: 30px; height: 2px; background: var(--brass); }
.auth-intro h1 { max-width: 560px; margin: 22px 0 15px; color: var(--ink); font-size: clamp(40px, 5.4vw, 68px); line-height: 1.02; letter-spacing: -.055em; font-weight: 650; }
.auth-intro > p { max-width: 490px; color: var(--mute); font-size: clamp(15px, 1.5vw, 18px); line-height: 1.7; margin: 0; }
.intro-note { display: inline-flex; align-items: center; gap: 12px; width: fit-content; margin-top: 33px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.52); color: var(--indigo-dark); font-size: 12px; }
.intro-note svg { color: var(--brass); }
.intro-orbit { position: absolute; right: 18px; bottom: 0; width: 170px; height: 170px; border: 1px solid rgba(85,82,163,.13); border-radius: 50%; opacity: .7; pointer-events: none; }
.intro-orbit::before, .intro-orbit::after { content: ""; position: absolute; border: 1px solid rgba(85,82,163,.14); border-radius: 50%; inset: 18px; }
.intro-orbit::after { inset: 39px; border-color: rgba(249,196,18,.5); }
.intro-orbit span { position: absolute; z-index: 1; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); }
.intro-orbit span:nth-child(1) { top: 20px; right: 44px; }
.intro-orbit span:nth-child(2) { left: 23px; bottom: 55px; background: var(--indigo); }
.intro-orbit span:nth-child(3) { right: 20px; bottom: 42px; width: 5px; height: 5px; }
.auth-card { width: 100%; padding: clamp(24px, 4vw, 38px); border: 1px solid rgba(85,82,163,.17); border-radius: 24px; background: var(--card); box-shadow: 0 22px 70px rgba(42,36,100,.1); }
.card-eyebrow { font-size: 9px; }
.auth-card h2 { color: var(--ink); margin: 12px 0 8px; font-size: 25px; letter-spacing: -.04em; }
.card-copy { color: var(--mute); margin: 0 0 21px; font-size: 13px; line-height: 1.55; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border-radius: 13px; background: #f0eefb; margin-bottom: 21px; }
.role-tab { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--mute); font-size: 13px; font-weight: 600; }
.role-tab.active { color: var(--indigo-dark); background: #fff; box-shadow: 0 3px 11px rgba(40,32,96,.08); }
.role-dot { width: 8px; height: 8px; border-radius: 50%; }
.guru-dot { background: var(--brass); box-shadow: 0 0 0 3px rgba(249,196,18,.18); }
.student-dot { background: var(--indigo); box-shadow: 0 0 0 3px rgba(85,82,163,.13); }
.form-stack { display: flex; flex-direction: column; align-items: stretch; }
.field-label { color: var(--ink); font-size: 12px; font-weight: 650; margin: 12px 0 7px; }
.text-field { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
.text-field:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(85,82,163,.12); outline: 0; }
.pin-field { letter-spacing: .28em; font-variant-numeric: tabular-nums; }
.field-hint, .setup-hint { color: var(--mute); font-size: 11px; margin: 7px 0 0; line-height: 1.5; }
.setup-hint { padding: 10px 12px; background: #f6f4ff; border-left: 3px solid var(--brass); border-radius: 0 8px 8px 0; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 19px; border: 1px solid var(--indigo); border-radius: 11px; color: #fff !important; background: var(--indigo); font-size: 13px; font-weight: 650; transition: background .16s ease, transform .16s ease; }
.primary-button:hover:not(:disabled) { background: var(--indigo-dark); transform: translateY(-1px); }
.primary-button svg:last-child { margin-left: auto; }
.inline-error, .inline-message { margin: 11px 0 0; padding: 10px 12px; border-radius: 9px; font-size: 12px; line-height: 1.45; }
.inline-error { color: var(--rose) !important; background: var(--rose-soft); }
.inline-message { color: var(--green) !important; background: var(--green-soft); }
.owner-setup-link, .text-button { display: block; margin: 15px auto 0; padding: 6px 8px; border: 0; background: transparent; color: var(--indigo-dark); font-size: 11px; text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.text-button { margin-top: 10px; }
.privacy-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--mute); font-size: 10px; line-height: 1.45; }
.auth-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-top: 1px solid var(--line); color: var(--mute); font-size: 10px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 28px; }
  .auth-intro h1 { font-size: clamp(34px, 6vw, 52px); }
  .intro-orbit { right: -65px; opacity: .45; }
}
@media (max-width: 700px) {
  .auth-page { padding: 0 18px; }
  .app-header { min-height: 66px; }
  .brand-mark { width: 39px; height: 38px; }
  .secure-label { font-size: 0; gap: 0; }
  .secure-label svg { width: 18px; height: 18px; }
  .auth-layout { display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding: 25px 0 34px; }
  .auth-intro { min-height: 0; padding: 8px 0 6px; }
  .auth-intro h1 { max-width: 520px; font-size: clamp(34px, 9vw, 46px); margin: 13px 0 9px; }
  .auth-intro > p { font-size: 14px; max-width: 500px; }
  .intro-kicker { font-size: 9px; }
  .intro-note { margin-top: 16px; padding: 10px 12px; font-size: 10px; }
  .intro-orbit { display: none; }
  .auth-card { max-width: 500px; margin: 0 auto; padding: 23px 20px; border-radius: 20px; }
  .auth-footer { font-size: 9px; }
}
@media (max-width: 380px) {
  .auth-page { padding: 0 13px; }
  .auth-card { padding: 20px 16px; }
  .auth-footer span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
