/*
 * LegionellaReady — Design System
 * Extracted from uk/legionella/demo/index.html
 * Tokens and reusable components only. No view-specific or layout-specific rules.
 */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ── */
:root {
  --bg: #0C2D4A;
  --bg-deep: #0B2535;
  --surface: #0B2535;
  --card-surface: #153A52;
  --card: #153A52;
  --card-hover: #1B4762;
  --panel: #153A52;
  --panel-light: #1D4E6B;
  --glyph-bg: #153A52;
  --glyph-active: #1F5676;
  --text-primary: #F0EBE3;
  --text-secondary: #C4D0D9;
  --text-quiet: #88A0B0;
  --accent: #D4A853;
  --accent-dim: rgba(212,168,83,0.22);
  --green: #68d090;
  --green-dim: rgba(104,208,144,0.22);
  --amber: #f0b858;
  --amber-dim: rgba(240,184,88,0.22);
  --red: #e07060;
  --red-dim: rgba(224,112,96,0.22);
  --divider: rgba(240,235,227,0.10);
}

/* ── Base ── */
html { background: var(--bg-deep); }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── View Pattern ── */
.view { display: none; }
.view.active { display: block; }

/* ── Header ── */
.app-header {
  background: rgba(11,37,53,0.92);
  backdrop-filter: blur(10px);
  padding: 16px 18px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid rgba(240,235,227,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark svg {
  width: 18px;
  height: 18px;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-primary);
}
.app-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-quiet);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-header-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: none;
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-header-signin:hover { background: var(--accent-dim); }
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #0C2D4A;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: var(--accent);
  color: #0C2D4A;
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:disabled { opacity: 0.65; cursor: default; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 14px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: var(--card);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--card-hover); }

.btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: #0C2D4A;
  color: #F0EBE3;
}
.btn-dark:hover { opacity: 0.92; }

/* ── Form Inputs ── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-label .optional {
  color: var(--text-quiet);
  font-weight: 400;
}
.form-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: rgba(240,235,227,0.08);
  border: 1px solid rgba(240,235,227,0.14);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.form-input::placeholder { color: var(--text-quiet); }
.form-input:focus {
  background: rgba(240,235,227,0.10);
  outline: 2px solid rgba(212,168,83,0.3);
  border-color: rgba(212,168,83,0.48);
}

/* ── Postcode Card ── */
.postcode-shell { margin-bottom: 14px; }
.postcode-strip,
.postcode-result-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(240,235,227,0.06);
  border: 1px solid rgba(240,235,227,0.10);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.20);
}
.postcode-result-strip { align-items: flex-start; }
.postcode-form { width: 100%; }
.postcode-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.postcode-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}
.postcode-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  background: rgba(240,235,227,0.08);
  border: 1px solid rgba(240,235,227,0.14);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  text-transform: uppercase;
}
.postcode-input::placeholder { color: var(--text-quiet); }
.postcode-input:focus {
  background: rgba(240,235,227,0.10);
  outline: 2px solid rgba(212,168,83,0.3);
  border-color: rgba(212,168,83,0.48);
}
.postcode-btn {
  min-height: 44px;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #0C2D4A;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.postcode-btn:hover { opacity: 0.92; }
.postcode-btn:disabled { opacity: 0.65; cursor: default; }
.postcode-link-btn,
.postcode-skip-link {
  padding: 0;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.postcode-link-btn { color: var(--accent); }
.postcode-link-btn:hover { text-decoration: underline; }
.postcode-skip-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.postcode-skip-link { color: var(--text-quiet); }
.postcode-message { margin-top: 12px; font-size: 13px; line-height: 1.5; }
.postcode-error { color: #F3C9BE; }
.postcode-result-shell { display: flex; flex-direction: column; gap: 8px; }
.postcode-result-line {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-secondary);
}
.postcode-result-line strong { color: var(--text-primary); font-weight: 600; }

/* ── Training Card (light surface) ── */
.training-card {
  background: #F0EBE3;
  color: #0C2D4A;
  border-radius: 20px;
  padding: 22px 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.20);
  margin-bottom: 14px;
}
.training-card-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.training-card-copy { flex: 1; min-width: 0; }
.training-card-copy h3 {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: #0C2D4A;
  margin-bottom: 6px;
}
.training-card-copy p {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: #3A5568;
  margin-bottom: 16px;
}
.training-card-progress {
  display: none;
  margin-bottom: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #0C2D4A;
}
.training-card-progress.visible { display: block; }

/* ── Progress Bar ── */
.training-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.training-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  margin-bottom: 14px;
}
.training-card .training-progress-bar {
  background: rgba(12,45,74,0.12);
}
.training-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #8fe0f1);
  transition: width 0.25s ease;
}
.training-card .training-progress-fill {
  background: #0C2D4A;
}

/* ── Journey Icon ── */
.journey-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(240,235,227,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.journey-icon svg { width: 20px; height: 20px; }
.training-card .journey-icon { background: #0C2D4A; }
.training-card .journey-icon svg { stroke: #F0EBE3; }

/* ── Journey Cards (dark surface) ── */
.journey-card {
  width: 100%;
  background: var(--card-surface);
  border: 1px solid rgba(240,235,227,0.10);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 14px;
  color: var(--text-primary);
  box-shadow: 0 4px 14px rgba(0,0,0,0.20);
}
.journey-card-ready { border-color: rgba(212,168,83,0.30); }
.journey-card-main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.journey-copy { flex: 1; min-width: 0; }
.journey-copy h3 {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.journey-copy p {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.journey-header-row { display: block; margin-bottom: 4px; }
.journey-status {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.3;
  color: var(--text-quiet);
  background: rgba(240,235,227,0.06);
  padding: 4px 10px;
  border-radius: 8px;
}
.journey-status.complete {
  background: rgba(104,208,144,0.16);
  color: var(--green);
  font-style: normal;
}
.journey-card-ready .journey-status {
  background: rgba(212,168,83,0.14);
  color: var(--text-primary);
  font-style: normal;
}
.journey-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.journey-action-link {
  color: var(--accent);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
}
.journey-action-link:hover { text-decoration: underline; }

/* ── Chemistry Card ── */
.chemistry-card {
  background: var(--card-surface);
  border: 1px solid rgba(240,235,227,0.10);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.20);
}
.chemistry-card p {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.chemistry-card p strong { color: var(--text-primary); }
.chemistry-verify-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.chemistry-verify-link:hover { text-decoration: underline; }

/* ── Plan Cards ── */
.plan-card {
  background: var(--card-surface);
  border: 1px solid rgba(240,235,227,0.10);
  border-radius: 18px;
  padding: 22px 20px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.20);
  position: relative;
}
.plan-card.featured {
  border-color: rgba(212,168,83,0.40);
}
.plan-badge {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #0C2D4A;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plan-name {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.plan-price {
  font-family: 'DM Sans', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.plan-price-note {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-quiet);
  margin-bottom: 16px;
}
.plan-features {
  list-style: none;
  margin-bottom: 20px;
}
.plan-features li {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 5px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}
.plan-features li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Role Chip Selector ── */
.role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.role-chip {
  padding: 8px 16px;
  border: 1px solid rgba(240,235,227,0.18);
  border-radius: 8px;
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 40px;
}
.role-chip:hover { background: rgba(240,235,227,0.06); }
.role-chip.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text-primary);
}

/* ── Section Wrapper ── */
.page-shell { padding: 20px 16px 40px; }
.page-hero {
  margin: 20px 0 20px;
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}
.page-hero-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

/* ── Section Label ── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 4px 12px;
  text-align: center;
}

/* ── Divider ── */
.divider { height: 1px; background: var(--divider); margin: 20px 0; }

/* ── Helper text ── */
.help-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-quiet);
  text-align: center;
  line-height: 1.5;
  margin-top: 10px;
}

/* ── Responsive ── */
@media (max-width: 420px) {
  .postcode-strip { flex-wrap: wrap; }
  .postcode-label { width: 100%; }
  .postcode-input-row { width: 100%; }
}

/* ── Beta Pricing ── */
.plan-price-strike {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-quiet);
  text-decoration: line-through;
  margin-right: 6px;
}
.plan-beta-note {
  font-size: 13px;
  font-weight: 500;
  color: var(--amber);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

/* ── Team Quantity Selector ── */
.plan-qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.plan-qty-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.plan-qty-input {
  width: 72px;
  padding: 8px 10px;
  background: rgba(240,235,227,0.08);
  border: 1px solid rgba(240,235,227,0.18);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}
.plan-qty-input:focus {
  outline: 2px solid rgba(212,168,83,0.3);
  border-color: rgba(212,168,83,0.48);
}

/* ── Sign-in Modal ── */
.lr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,37,53,0.88);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lr-modal-card {
  background: var(--card-surface);
  border: 1px solid rgba(240,235,227,0.14);
  border-radius: 20px;
  padding: 32px 24px 26px;
  width: 100%;
  max-width: 380px;
  position: relative;
}
.lr-modal-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.lr-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(240,235,227,0.08);
  border-radius: 8px;
  color: var(--text-quiet);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lr-modal-close:hover { background: rgba(240,235,227,0.14); color: var(--text-primary); }
.lr-modal-icon { font-size: 36px; margin-bottom: 14px; }
.lr-modal-sent-msg {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
}
.lr-modal-link { color: var(--accent); text-decoration: none; }
.lr-modal-link:hover { text-decoration: underline; }
.lr-field-error {
  font-size: 13px;
  color: var(--red);
  margin-top: 4px;
  line-height: 1.4;
  display: none;
}
.lr-form-error {
  font-size: 14px;
  color: var(--red);
  background: var(--red-dim);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.5;
  display: none;
}
.lr-inline-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

/* ── Avatar Dropdown ── */
.lr-avatar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card-surface);
  border: 1px solid rgba(240,235,227,0.14);
  border-radius: 10px;
  min-width: 120px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.30);
  z-index: 200;
  overflow: hidden;
}
.lr-dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}
.lr-dropdown-item:hover { background: rgba(240,235,227,0.08); color: var(--text-primary); }

/* ── Toast ── */
.lr-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-surface);
  border: 1px solid rgba(240,235,227,0.14);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.30);
  z-index: 999;
  max-width: calc(100vw - 40px);
  text-align: center;
}
