/* Student login (univa.my/student) in the UNIVA Night Studio theme, matching /academy, /aioffice and the student library:
   a #05070C canvas with navy glows, UNIVA blue and cyan accents, hairline glass card, pill buttons and mono kickers.
   Loaded last, after portal.css, brand.css, login.css and membership-benefits.css, so it only restyles; login.js is unchanged. */
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #05070C; --bg2: #0A0E17; --surface: #0C111C; --line: rgba(255,255,255,.09); --line2: rgba(255,255,255,.16);
  --ink: #F2F4F8; --muted: rgba(242,244,248,.72); --faint: rgba(242,244,248,.58);
  --blue: #0054FF; --blue-hi: #3B7BFF; --cyan: #8CC8FF; --ok: #7EE0A8; --gold: #E3B347; --danger: #FFB4AB;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --glass: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  --r: 22px; --pill: 999px;
  /* Older tokens from tokens.css and brand.css, so anything not restyled below still lands on the dark palette */
  --paper: var(--bg); --soft: rgba(255,255,255,.07); --pale: var(--surface); --academy-muted: var(--muted);
  --dark-2: #1a3a9e; --blue-deep: var(--blue-hi); --blue-light: var(--cyan); --font-sans: var(--sans); --font-display: var(--sans);
  color-scheme: dark;
}

.login-page { min-height: 100svh; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; -webkit-font-smoothing: antialiased; overflow-x: clip; }
.login-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(44vmax 44vmax at 10% 0%, rgba(0,84,255,.18), transparent 70%), radial-gradient(36vmax 36vmax at 100% 40%, rgba(59,123,255,.08), transparent 70%), radial-gradient(44vmax 44vmax at 30% 100%, rgba(0,84,255,.09), transparent 70%); }
.login-page ::selection { background: rgba(0,84,255,.55); color: #fff; }
.login-page :is(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.login-page .eyebrow { max-width: none; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }

/* Header: the white UNIVA logo with a mono label, and a hairline pill link */
.login-brand { flex-direction: row; width: auto; gap: 12px; color: var(--ink); }
.login-brand img { width: auto; height: 34px; filter: brightness(0) invert(1); }
.login-brand span { padding-left: 12px; border-left: 1px solid var(--line2); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; color: var(--muted); }
.login-header > a:last-child { padding: 9px 16px; border-radius: var(--pill); font-size: 14px; font-weight: 600; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); transition: background .2s; }
.login-header > a:last-child:hover { background: rgba(255,255,255,.07); }

/* Story: an Instrument Serif headline beside the card */
.login-story { align-self: start; position: sticky; top: 32px; padding-top: 12px; }
.login-story h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 6.6vw, 92px); line-height: .96; letter-spacing: -.02em; color: var(--ink); }
.login-story p { color: var(--muted); font-size: 17px; line-height: 1.65; }
.login-benefits span { font-size: 13px; font-weight: 600; color: var(--ink); background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line2); }
.login-benefits span:first-child { color: var(--cyan); background: rgba(0,84,255,.16); box-shadow: inset 0 0 0 1px rgba(140,200,255,.4); }

/* The card: hairline glass over a blue glow */
.login-card { position: relative; min-width: 0; color: var(--ink); border: 0; border-radius: 28px;
  background: radial-gradient(90% 60% at 100% 0%, rgba(0,84,255,.16), transparent 70%), var(--glass), var(--surface);
  box-shadow: inset 0 0 0 1px var(--line2), 0 50px 100px -50px rgba(0,84,255,.6); }
.login-card h2 { font-family: var(--sans); font-weight: 600; letter-spacing: -.03em; line-height: 1.08; color: var(--ink); }
#login-intro, .login-card .login-small { color: var(--muted); }
.login-card .login-support { color: var(--faint); }
.login-support a, .membership-recheck { color: var(--cyan); text-underline-offset: 3px; }
.login-rule { background: var(--line); }
.login-footer { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }

/* Status line: a calm strip for progress, a red tint for errors */
.login-card .login-message { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 14px; line-height: 1.55; }
.login-card .login-message.is-error { background: rgba(255,107,107,.1); box-shadow: inset 0 0 0 1px rgba(255,140,130,.38); color: var(--danger); }

/* Register / Log in switch */
.auth-tabs { background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px var(--line); }
.auth-tabs button { color: var(--muted); font-family: var(--sans); font-weight: 600; transition: background .2s, color .2s; }
.auth-tabs button:hover { color: var(--ink); }
.auth-tabs button[aria-selected=true] { background: rgba(255,255,255,.1); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.auth-tabs button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* Fields */
.field label { font-weight: 600; color: var(--ink); }
.field input { min-height: 50px; border: 1px solid var(--line2); border-radius: 14px; background: rgba(0,0,0,.35); color: var(--ink); font-family: var(--sans); transition: border-color .2s; }
.field input::placeholder { color: var(--faint); }
.field input:hover { border-color: rgba(140,200,255,.38); }
.field input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: transparent; }
.field input[aria-invalid=true] { border-color: rgba(255,140,130,.75); }
.field input[readonly] { background: rgba(255,255,255,.04); color: var(--muted); }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px #0F1626 inset; caret-color: var(--ink); }
.field-hint { color: var(--faint); }
.field-error { color: var(--danger); font-weight: 600; }

/* Buttons: blue glow for the form steps, white for the next step after signing in */
.login-page .primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: var(--pill); min-height: 50px; padding: 13px 24px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; text-align: center; color: #fff; background: var(--blue);
  box-shadow: 0 14px 40px -14px rgba(0,84,255,.75), inset 0 1px 0 rgba(255,255,255,.18); transition: background .2s, box-shadow .2s; }
.login-page .primary:hover { background: var(--blue-hi); }
.login-page .primary:disabled { opacity: 1; cursor: wait; color: var(--muted); background: rgba(0,84,255,.28); box-shadow: inset 0 0 0 1px rgba(140,200,255,.25); }
.student-form .primary { font-size: 15px; }
#existing-session .primary, .login-page .aioffice-join { color: #05070C; background: #fff; box-shadow: 0 14px 34px -16px rgba(255,255,255,.45); }
#existing-session .primary:hover, .login-page .aioffice-join:hover { background: #E6ECF7; }
#existing-session .primary { width: 100%; min-height: 54px; margin-top: 4px; font-size: 16px; }
.login-page .aioffice-join { min-height: 54px; margin: 8px 0 18px; font-size: 16px; }

/* Security check and Google: centred slots; both widgets draw their own frame */
.turnstile-slot { display: flex; justify-content: center; }
.login-or { color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.login-or:before, .login-or:after { background: var(--line); }
#google-button { align-items: center; min-height: 44px; }
#google-button iframe { color-scheme: normal; }

/* Signed in */
.signed-in { border: 0; border-radius: 16px; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--line); }
.signed-in p { font-size: 14px; color: var(--ink); }
.signed-in span, .signed-in small { color: var(--faint); }
.signed-in span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.signed-in strong { font-weight: 600; }
.signed-in-out { border: 0; border-radius: var(--pill); min-height: 36px; padding: 8px 16px; background: rgba(255,255,255,.06); color: var(--ink); font-family: var(--sans); font-size: 13px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line2); }
.signed-in-out:hover { background: rgba(255,255,255,.11); }
.profile-email { color: var(--ink); }
.profile-email span { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }

/* Signed in without a membership: the card widens into the AI Office offer */
.membership-mode .login-card { padding: clamp(28px, 5vw, 56px); background: radial-gradient(90% 120% at 100% 0%, rgba(59,123,255,.42), transparent 62%), linear-gradient(160deg, #0a1a4a, #071028); box-shadow: inset 0 0 0 1px rgba(59,123,255,.35), 0 40px 80px -40px rgba(0,84,255,.45); }
.membership-mode .login-card h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.4vw, 68px); line-height: 1; letter-spacing: -.02em; color: #fff; max-width: 16ch; }
.membership-mode #login-intro { color: rgba(242,244,248,.8); font-size: 17px; }
.membership-mode .login-card .login-message { background: transparent; box-shadow: none; padding: 0; font-size: 14px; color: var(--cyan); }
.membership-mode .login-card .login-message.is-error { color: var(--danger); }
.membership-mode .signed-in { background: rgba(5,7,12,.35); }
.membership-benefits { color: var(--ink); }
.membership-lead { color: var(--ink); font-size: 18px; max-width: 62ch; }
.membership-access-note { color: rgba(242,244,248,.76); font-size: 13px; padding-left: 14px; border-left: 2px solid rgba(140,200,255,.45); max-width: 62ch; }
.membership-path, .membership-included { background: var(--glass); border: 0; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.membership-kicker, .membership-path .membership-count { font-family: var(--mono); font-weight: 500; color: var(--cyan); }
.membership-path p, .membership-path li, .membership-included p, .membership-availability { color: var(--muted); }
.membership-recheck { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

@media (max-width: 700px) {
  .login-header { padding: 16px; }
  .login-brand img { height: 28px; }
  .login-brand span { font-size: 10px; padding-left: 10px; }
  .login-header > a:last-child { padding: 8px 13px; font-size: 13px; }
  .login-main { padding: 16px; margin-top: 4px; }
  .login-card { padding: 26px 20px; border-radius: 24px; }
  .login-card h2 { font-size: 30px; }
  .membership-mode .login-card { padding: 26px 20px; }
  .membership-mode .login-card h2 { font-size: clamp(36px, 10.5vw, 46px); }
  .membership-lead { font-size: 16px; }
  .login-page .aioffice-join { width: 100%; }
}
