/* ============================================================
   TALERANG BRAND TOKENS
   Source: 2025 Talerang Brand Guidelines
   ============================================================ */
:root {
  --talerang-blue: #222262;   /* Primary: logo, headings, icons */
  --talerang-red: #BE1E2D;    /* Accent: CTAs, highlights */
  --talerang-white: #FBFCFF;  /* Backgrounds */
  --talerang-grey: #F5F5F5;   /* Secondary background */
  --text-body: #2b2b38;
  --text-muted: #6b6b78;
  --border-light: #e2e2e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--talerang-grey);
  color: var(--text-body);
  min-height: 100vh;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 16px 4px;
}

.brand-logo {
  height: 48px;
  width: auto;
  /* Clear space roughly equal to the height of the "T" in the wordmark */
  padding: 4px 6px;
}

.checklist-nav-btn {
  background: transparent;
  border: 1.5px solid var(--talerang-blue);
  color: var(--talerang-blue);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
}

.checklist-nav-btn:hover { background: rgba(34, 34, 98, 0.06); }

.app {
  min-height: 60vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 16px 48px;
}

.screen {
  display: none;
  width: 100%;
  max-width: 700px;
}

.screen.active {
  display: block;
}

.card {
  background: var(--talerang-white);
  border-radius: 10px;
  padding: 36px 30px;
  box-shadow: 0 1px 3px rgba(34, 34, 98, 0.08), 0 8px 24px rgba(34, 34, 98, 0.06);
}

.card.center {
  text-align: center;
}

h1, h2, h3 {
  color: var(--talerang-blue);
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
}

h1 { font-size: 26px; margin: 0 0 14px; font-weight: 800; }
h2 { font-size: 21px; margin: 0 0 14px; }
h3 { font-size: 17px; margin: 18px 0 16px; line-height: 1.45; font-weight: 600; }

p { line-height: 1.55; margin: 0 0 12px; }
.muted { color: var(--text-muted); font-size: 14px; }
.context-label { font-size: 13px; font-weight: 600; color: var(--talerang-red); margin-bottom: 4px; }

label {
  display: block;
  margin: 18px 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--talerang-blue);
}

input[type="text"], input[type="tel"], input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: 'Montserrat', sans-serif;
  border: 1px solid #ccced9;
  border-radius: 6px;
  background: #fff;
}

input:focus {
  outline: none;
  border-color: var(--talerang-blue);
  box-shadow: 0 0 0 3px rgba(34, 34, 98, 0.12);
}

.error {
  color: var(--talerang-red);
  font-size: 13px;
  min-height: 18px;
  margin-top: 4px;
  font-weight: 500;
}

.btn-primary, .btn-secondary {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  min-height: 46px;
}

.btn-primary {
  background: var(--talerang-red);
  color: #fff;
}

.btn-primary:hover { background: #a11a27; }

.btn-secondary {
  background: transparent;
  color: var(--talerang-blue);
  border: 1.5px solid var(--talerang-blue);
}

.btn-secondary:hover { background: rgba(34, 34, 98, 0.06); }

.btn-primary:disabled {
  background: #e3b2b7;
  cursor: not-allowed;
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 15px;
}

.checklist-item .icon {
  width: 26px;
  font-weight: bold;
  flex-shrink: 0;
  text-align: center;
}

.checklist-item.complete .icon { color: var(--talerang-blue); }
.checklist-item.current .icon { color: var(--talerang-red); }
.checklist-item.locked { color: #9a9aa5; }
.checklist-item.locked .icon { color: #c6c6d0; }

.checklist-item.current { font-weight: 700; color: var(--talerang-red); }

.checklist-sub {
  padding-left: 30px;
  font-size: 14px;
}

.checklist-group-label {
  font-weight: 700;
  color: var(--talerang-blue);
  padding: 14px 0 2px;
  font-size: 15px;
}

/* Quiz */
.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  font-weight: 700;
  color: var(--talerang-blue);
}

.progress-bar {
  background: var(--talerang-grey);
  border-radius: 4px;
  height: 6px;
  margin: 10px 0 4px;
  overflow: hidden;
}

.progress-bar-fill {
  background: var(--talerang-red);
  height: 100%;
  transition: width 0.2s ease;
}

.prework {
  margin-top: 16px;
  padding: 11px 13px;
  background: var(--talerang-grey);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.section-tag {
  margin-top: 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--talerang-red);
  letter-spacing: 0.02em;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: 7px;
  margin-bottom: 9px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.45;
}

.option:hover { border-color: var(--talerang-blue); }

.option.selected {
  border-color: var(--talerang-blue);
  background: rgba(34, 34, 98, 0.05);
}

.option input { margin-top: 3px; flex-shrink: 0; accent-color: var(--talerang-blue); }

.quiz-nav {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.quiz-nav .btn-secondary, .quiz-nav .btn-primary {
  flex: 1;
  margin-top: 18px;
}

/* Results */
.big-score {
  font-size: 50px;
  font-weight: 800;
  color: var(--talerang-blue);
  margin: 10px 0;
  font-family: 'Montserrat', sans-serif;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 22px;
  font-size: 14px;
}

.results-table th {
  text-align: left;
  color: var(--talerang-blue);
  font-weight: 700;
  padding: 8px 6px;
  border-bottom: 2px solid var(--talerang-blue);
}

.results-table td {
  text-align: left;
  padding: 9px 6px;
  border-bottom: 1px solid var(--border-light);
}

.results-table th:last-child, .results-table td:last-child {
  text-align: right;
}

.final-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.final-actions button { flex: 1; margin-top: 0; }

.sync-status {
  font-size: 13px;
  margin: 14px 0 4px;
  font-weight: 600;
}

.sync-status.sync-pending { color: var(--text-muted); font-weight: 500; }
.sync-status.sync-ok { color: var(--talerang-blue); }
.sync-status.sync-error { color: var(--talerang-red); }

#finalResult-retry-btn { margin-bottom: 10px; }

#moduleResult-exit-btn { margin-top: 12px; }

/* Review */
.review-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--border-light);
}

.review-item .review-q {
  font-weight: 600;
  color: var(--talerang-blue);
  margin-bottom: 6px;
}

.review-item .review-a {
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 6px;
}

.review-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
}

.review-tag.best { background: rgba(34, 34, 98, 0.08); color: var(--talerang-blue); }
.review-tag.review { background: rgba(190, 30, 45, 0.08); color: var(--talerang-red); }
.review-tag.unscored { background: var(--talerang-grey); color: var(--text-muted); }

@media (max-width: 480px) {
  .card { padding: 26px 20px; }
  .big-score { font-size: 42px; }
  .brand-logo { height: 36px; }
}
