/**
 * Sign in (signin.html) — page layout and page-only components.
 * Spec: design-signin.md. Inherits design.md: shell 7.4 (css/app-shell.css,
 * narrowed here), segmented tabs 7.9, alerts 7.17 (css/alert.css), toast 7.17
 * (css/toast.css), row list 7.12. Base reset, body, reduced motion and [hidden] come from
 * css/app-shell.css and css/a11y.css.
 */

/* ---------- Shell + minimal chrome (7.4) ---------- */
/* Narrower, vertically centered version of the app shell (css/app-shell.css). */
.viewport {
  align-items: center;
}

.shell {
  max-width: 1000px;
  min-height: 0;
  padding: 0 36px 36px;
}

.chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--divider);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-nav-logo);
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
}

/* ---------- Body ---------- */
.body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 44px;
  align-items: stretch;
  padding-top: 36px;
}

/* Promo (info card) */
.promo {
  background: var(--surface-info);
  border-radius: var(--radius-card);
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.promo h2 {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
  max-width: 16ch;
}

.promo > p {
  margin: 0 0 28px;
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 36ch;
}

.promo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.promo-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  line-height: 1.4;
}

.promo-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.promo-icon svg { width: 18px; height: 18px; }

/* ---------- Promo illustration (same style as the first-use empty states) ---------- */
/* Academy page between a certificate and rising sales. Static: no motion. */
.promo-art {
  width: min(320px, 100%);
  height: auto;
  margin: auto auto 0;
  padding-top: 24px;
  overflow: visible;
}

.ill-shadow { fill: color-mix(in srgb, var(--text) 8%, transparent); }
.ill-paper { fill: var(--shell-contrast, #fff); stroke: color-mix(in srgb, var(--text) 8%, transparent); stroke-width: 1.5; }
.ill-line { fill: var(--divider); }
.ill-line--title { fill: color-mix(in srgb, var(--text) 18%, var(--divider)); }
.ill-medal { fill: var(--surface-info); }
.ill-medal-core { fill: var(--primary); }
.ill-check-on { fill: none; stroke: var(--on-primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill-ribbon { fill: color-mix(in srgb, var(--primary) 18%, var(--surface-info)); }
.ill-bar { fill: var(--surface-info); }
.ill-bar--3 { fill: var(--primary); }
.ill-baseline { fill: var(--divider); }
.ill-logo { fill: var(--primary); }
.ill-hero { fill: var(--surface-info); }
.ill-hero-line { fill: color-mix(in srgb, var(--text) 30%, var(--surface-info)); }
.ill-hero-line--soft { fill: color-mix(in srgb, var(--text) 12%, var(--surface-info)); }
.ill-hero-btn { fill: var(--primary); }
.ill-tile-cover { fill: var(--surface-info); }
.ill-tile-cover--alt { fill: color-mix(in srgb, var(--primary) 14%, var(--shell-contrast, #fff)); }
.ill-badge { fill: var(--primary); }
.ill-badge-cap { fill: none; stroke: var(--on-primary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Main */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.main:focus { outline: none; }

.view h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.15;
}

.view h1:focus { outline: none; }

.lead {
  margin: 10px 0 28px;
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 42ch;
}

.lead strong { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }

.card-panel {
  padding: 18px;
  margin-bottom: 18px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 26px 0 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--divider);
}

.foot-links {
  margin: 22px 0 0;
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
}

.foot-links a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal {
  margin: 22px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Sign in / Create account tabs (7.9) */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: var(--shell-contrast);
  border: 1px solid var(--divider);
}

.tab {
  min-height: 48px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.tab:hover:not([aria-selected="true"]) { color: var(--text); background: var(--panel-soft); }
.tab[aria-selected="true"] { background: var(--primary); color: var(--on-primary); }

.google { width: 100%; }

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.label-row .input-label { margin-bottom: 0; }

.text-link {
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-link:hover { color: var(--text-secondary); }

/* Password strength */
.strength { display: flex; gap: 6px; margin-top: 10px; }
.strength i { flex: 1; height: 4px; border-radius: 999px; background: var(--divider); transition: background-color 0.15s; }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--status-danger); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--status-warning); }
.strength[data-level="3"] i:nth-child(-n+3) { background: var(--status-success); }
.strength[data-level="4"] i { background: var(--status-success); }

/* Alert banners sit above the form they refer to. */
.view .alert { margin-bottom: 18px; }

/* Academy picker: row list (7.12) inside a soft panel */
.academy-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.academy {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  border: 2px solid transparent;
  border-radius: 24px;
  background: var(--shell-contrast);
  font-family: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}

.academy:hover { border-color: var(--control-tint); }

.academy-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.academy-txt { flex: 1; min-width: 0; }
.academy-txt strong { display: block; font-size: 15px; font-weight: 500; }
.academy-txt span { display: block; font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.role-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.academy > svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

.back-link { margin: -6px 0 18px -10px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .body { grid-template-columns: 1fr; gap: 24px; }
  .promo { min-height: 0; padding: 24px 22px; border-radius: 28px; }
  .promo h2 { font-size: 24px; max-width: none; }
  .promo > p { margin-bottom: 0; }
  .promo-list,
  .promo-art { display: none !important; }
  .main { order: -1; }
}

@media (max-width: 767px) {
  .viewport { align-items: stretch; }
  .shell { max-width: none; min-height: 100vh; padding: 0 20px 32px; }
  .body { padding-top: 24px; }
  .view h1 { font-size: 28px; }
  .card-panel { padding: 16px; }
}
