/* The sign-in pages (the spec's The sign-in page → The look, approved 2026-10-26 on the
   mock-up canvas "Auth sign-in pages").

   Tokens from the Comenius design system (documents/Comenius Design System/
   colors_and_type.css), copied here because the service serves nothing from outside
   auth-service/. Three accessibility departures from it: section labels in --text-muted
   (its --text-section fails contrast at 10.5px), input borders in --field-border (a
   field's edge needs 3:1), and buttons at least 44px tall (48px on a phone).

   The CSP allows no inline style, so every page is styled from here. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/InterVariable-latin.woff2") format("woff2");
}

:root {
  --accent: #2D5A3D;
  --accent-hover: #244a32;
  --accent-deep: #0F3D24;
  --card: #ffffff;
  --bg-app: #fafafa;
  --border: #e8eaed;
  --border-soft: #ececec;
  --button-border: #dadce0;
  --field-border: #8d9299;
  --tab-track: #f3f4f6;
  --hover: #f0f0f0;
  --text: #1a1a1a;
  --text-sec: #4a4a4a;
  --text-muted: #5f6368;
  --on-deep: #c9d3cb;
  --red: #b91c1c; --red-bg: #fef2f2; --red-border: #fecaca;
  --amber-text: #92400e; --amber-bg: #fffbeb; --amber-border: #fde68a;
  --r-sm: 6px; --r-md: 8px; --r-lg: 11px; --r-card: 12px;
  --shadow-card: 0 30px 64px rgba(0, 0, 0, 0.28), 0 6px 20px rgba(0, 0, 0, 0.14);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--accent-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── The page ───────────────────────────────────────────────────────────── */

.page {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 16px;
}

.watermark {
  position: absolute;
  right: -140px;
  bottom: -220px;
  height: 1000px;
  width: auto;
  opacity: 0.08;
  filter: grayscale(1) invert(1);
  pointer-events: none;
  user-select: none;
}

.card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.language {
  position: relative;
  font-size: 12px;
  color: var(--on-deep);
  text-decoration: none;
  padding: 8px;
}
.language:hover { color: #ffffff; }
.language:focus-visible { outline-color: var(--on-deep); }

/* ── The card's parts ───────────────────────────────────────────────────── */

.brand { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.logo { height: 56px; width: auto; filter: grayscale(0.3); }
.logo-small { height: 44px; }

h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.lead { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-sec); }
.small { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-muted); text-align: center; }

.ways { display: flex; flex-direction: column; gap: 10px; }
.ways form { margin: 0; }

.way {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--button-border);
  border-radius: var(--r-md);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.way:hover { background: var(--hover); }
.way:disabled { background: var(--tab-track); border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }
.way .mark { flex: none; width: 20px; height: auto; max-height: 24px; object-fit: contain; }
.way-label { flex: 1; }
.chevron { color: var(--text-muted); flex: none; }

.badge {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--border);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--tab-track);
  border-radius: var(--r-md);
}
.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.tab[aria-current="page"] {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  color: var(--text);
  font-weight: 600;
}

.eid-form { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.eid-form label { font-size: 13px; font-weight: 500; }
.eid-form .primary { margin-top: 6px; }

.field, .phone input {
  font: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  color: var(--text);
}
.field {
  height: 44px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--field-border);
  border-radius: var(--r-md);
  background: var(--card);
}
.phone {
  display: flex;
  align-items: stretch;
  height: 44px;
  border: 1px solid var(--field-border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--card);
}
.phone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.phone input { flex: 1; min-width: 0; border: 0; padding: 0 12px; background: transparent; }
.phone input:focus-visible { outline: none; }
.prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid var(--border);
  background: var(--bg-app);
  color: var(--text-muted);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.hint { margin: 0; font-size: 12px; line-height: 1.4; color: var(--text-muted); }

.primary, .secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  border-radius: var(--r-md);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.primary { background: var(--accent); color: #ffffff; border: 0; font-weight: 600; }
.primary:hover { background: var(--accent-hover); }
.secondary { background: var(--card); color: var(--text); border: 1px solid var(--button-border); font-weight: 500; }
.secondary:hover { background: var(--hover); }

.back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  font-size: 13px;
  color: var(--text-sec);
  text-decoration: none;
}
.back:hover { color: var(--text); }

.alert, .note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.45;
}
.alert p, .note p { margin: 0; }
.alert-icon { flex: none; margin-top: 1px; }
.alert { background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red); }
.note { background: var(--amber-bg); border: 1px solid var(--amber-border); color: var(--amber-text); }

.code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 16px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.code-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.code {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding-left: 0.18em;
  font-variant-numeric: tabular-nums;
}

.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; color: var(--text-sec); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: waiting 1.6s cubic-bezier(.4, 0, .2, 1) infinite; }
@keyframes waiting { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

/* ── A phone ────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .page { justify-content: flex-start; gap: 12px; padding: 32px 16px 24px; }
  .watermark { right: -150px; bottom: -150px; height: 640px; }
  .card { padding: 24px 20px 16px; gap: 20px; }
  .logo { height: 48px; }
  .logo-small { height: 40px; }
  h1 { font-size: 20px; }
  .way { min-height: 56px; font-size: 15px; }
  .tab { min-height: 44px; font-size: 14px; }
  .field, .phone { height: 48px; }
  .primary, .secondary { min-height: 48px; font-size: 15px; }
  .back { min-height: 44px; font-size: 14px; }
  .language { font-size: 13px; padding: 12px; }
}
