/**
 * Skolar Kids — shared branding for the teacher-facing pages.
 *
 * These screens are used by an adult on a smart board, often in bright
 * classroom light, so they are deliberately higher-contrast and calmer than
 * the child-facing game.
 */

:root {
  --brand-navy: #14235c;
  --brand-blue: #1e5fd8;
  --brand-sky: #4a9ae0;
  --brand-teal: #0ea5a5;
  --brand-amber: #f59e0b;
  --brand-green: #16a34a;
  --brand-red: #dc2626;

  --ink: #14235c;
  --muted: #5a6a94;
  --line: #dbe3f5;
  --card: #ffffff;
  --shadow: 0 16px 40px rgba(20, 35, 92, .18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  font-family: 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
}

.brand-bg {
  background:
    radial-gradient(circle at 15% 0%, #2d6fe0 0%, #1b3f9e 45%, #14235c 100%);
  min-height: 100dvh;
}

/* ============ Brand mark ============ */

.brand-head { text-align: center; margin-bottom: 22px; }

/*
 * The mark is the wordmark's own initial on a tile, not a picture of a robot.
 *
 * The robot emoji was doing three jobs badly: it is drawn differently on every
 * platform, it renders as a grey box on the cheaper Android builds these
 * classrooms run, and it named the product something the product is not — a
 * child meets a star and a set of letters here, never a robot.
 */
.brand-mark {
  width: clamp(58px, 13vw, 74px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 24px;
  background: linear-gradient(150deg, #ffd75e, #ffb02e);
  color: #7a4b00;
  font-size: clamp(30px, 7vw, 38px);
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0 #e79a12;
}
.brand-name {
  margin: 6px 0 2px;
  font-size: clamp(26px, 7vw, 38px);
  font-weight: 900;
  letter-spacing: -.5px;
  color: var(--brand-navy);
}
.brand-name span { color: var(--brand-blue); }
.brand-tag {
  margin: 0;
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 700;
  color: var(--muted);
}
.brand-badge {
  margin: 6px 0 0;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-teal);
  background: rgba(14, 165, 165, .1);
  border: 1px solid rgba(14, 165, 165, .28);
  padding: 3px 12px;
  border-radius: 999px;
}

/* On dark backgrounds the wordmark inverts. */
.brand-bg > .app-header .brand-name { color: #fff; }
.brand-bg > .app-header .brand-name span { color: #8ec9ff; }

/* ============ Login ============ */

/*
 * Every wrapper below keeps itself clear of the system bars.
 *
 * Android 15 stopped letting an app opt out of edge-to-edge: once the app
 * targets SDK 35 the WebView is laid out behind the status bar at the top and
 * the gesture bar at the bottom, and anything that assumed otherwise is
 * partly under them. On a phone with a notch the sides go too.
 *
 * `env(safe-area-inset-*)` is 0 on a device with nothing in the way, so the
 * `max()` keeps the designed padding everywhere else and only grows where
 * there is something to avoid.
 */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 28px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 34px);
}

.field { display: block; margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 5px;
}
.field-hint { font-weight: 600; color: var(--muted); }

.field input,
.field select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 11px 13px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fbfcff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(30, 95, 216, .15);
}
.field input::placeholder { color: #9aa8c8; }

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field-narrow { max-width: 110px; }

.primary-btn {
  width: 100%;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 800;
  color: #fff;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-blue), #3b82f6);
  box-shadow: 0 8px 18px rgba(30, 95, 216, .34);
  transition: transform .12s ease;
  margin-top: 4px;
}
.primary-btn:active { transform: scale(.97); }

.form-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fdeaea;
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 700;
}

.privacy-note {
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.signed-in { text-align: center; }
.signed-in p { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.signed-in strong { color: var(--ink); }

.link-btn {
  display: block;
  width: 100%;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 13px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand-blue), #3b82f6);
  color: #fff;
  margin-bottom: 9px;
  box-shadow: 0 6px 14px rgba(30, 95, 216, .3);
}
.link-btn.subtle {
  background: #eef2fb;
  color: var(--muted);
  box-shadow: none;
  font-size: 13px;
  padding: 10px;
}
.link-btn:active { transform: scale(.97); }

.version-note {
  margin-top: 18px;
  color: rgba(255,255,255,.75);
  font-size: 11.5px;
  font-weight: 700;
}

/* ============ App header (home + analytics) ============ */

/* Sticky at top:0, which under edge-to-edge is behind the status bar — so it
   carries the inset itself. A header a teacher cannot read is the first thing
   a Play reviewer screenshots. */
.app-header {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  padding: 10px clamp(12px, 4vw, 26px);
  padding-top: max(10px, env(safe-area-inset-top));
  padding-left: max(clamp(12px, 4vw, 26px), env(safe-area-inset-left));
  padding-right: max(clamp(12px, 4vw, 26px), env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
/* The same mark, sized for a header bar. */
.ah-mark {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(150deg, #ffd75e, #ffb02e);
  color: #7a4b00;
  font-size: 17px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 #e79a12;
}
.ah-name {
  font-size: clamp(15px, 4vw, 19px);
  font-weight: 900;
  color: var(--brand-navy);
  line-height: 1.1;
}
.ah-name span { color: var(--brand-blue); }
.ah-class {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.ah-spacer { flex: 1; }
.ah-btn {
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 10px;
  background: #eef2fb;
  color: var(--brand-navy);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.ah-btn.accent { background: linear-gradient(135deg, var(--brand-blue), #3b82f6); color: #fff; }
.ah-btn:active { transform: scale(.95); }

@media (max-width: 560px) {
  .ah-btn .ah-btn-text { display: none; }
  .ah-btn { padding: 8px 11px; }
}

/* Small phones: the Class and Section selects side by side leave the class
   name ("Balvatika (3–6)") clipped, so they stack instead. */
@media (max-width: 400px) {
  .login-card { padding: 18px 16px; }
  .field-row { flex-direction: column; gap: 0; }
  .field-narrow { max-width: none; }
}

/* Touch targets: 44px is the accepted minimum for a finger, and these pages
   are used on tablets and phones as often as on a smart board. */
@media (pointer: coarse) {
  .field input,
  .field select { min-height: 46px; font-size: 16px; }
  .primary-btn, .link-btn { min-height: 50px; }
  .ah-btn { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .05s !important; }
}
