:root {
  --bg: #F8F7F4;
  --text: #1A1A1A;
  --text-muted: #666666;
  --accent: #1A56DB;
  --accent-hover: #174EC4;
  --border: #E5E4DF;
  --card: #FFFFFF;

  --green: #16A34A;
  --green-bg: #F0FDF4;
  --orange: #EA580C;
  --orange-bg: #FFF7ED;
  --red: #DC2626;
  --red-bg: #FEF2F2;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  background: var(--text);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 100;
}

/* ---------- HEADER ---------- */
.site-header {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--text);
}

.lang-switch {
  display: inline-flex;
  gap: 2px;
  background: var(--border);
  border-radius: 8px;
  padding: 2px;
}

.lang-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
}
.lang-btn:hover { color: var(--text); }
.lang-btn[aria-pressed="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.lang-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.progress {
  width: 100%;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 400ms ease;
}

/* ---------- MAIN / SCREENS ---------- */
main { padding: 28px 0 48px; }

.screen { animation: fadeIn 300ms ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- WELCOME ---------- */
.hero-title {
  font-size: 36px;
  font-weight: 700;
  margin: 8px 0 12px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.info-list li {
  padding-left: 22px;
  position: relative;
  color: var(--text);
}
.info-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.scale-hint {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.scale-hint-title {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.scale-hint-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
}
.scale-hint-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.scale-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 14px 20px;
  min-height: 48px;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 80ms ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 10px 14px;
  min-height: 40px;
  font-weight: 500;
}
.btn-ghost:hover { color: var(--text); }
.btn-ghost:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-link {
  background: transparent;
  color: var(--accent);
  padding: 8px 12px;
  min-height: 40px;
  font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }

.btn-large {
  width: 100%;
  font-size: 17px;
  padding: 16px 20px;
  min-height: 54px;
}

#resumeBtn {
  width: 100%;
  margin-top: 10px;
}

/* ---------- QUIZ ---------- */
.quiz-stage {
  padding-top: 8px;
}

.block-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.quiz-statement {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 28px;
  min-height: 90px;
  outline: none;
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.scale-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 14px 4px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  min-height: 88px;
  transition: background 150ms ease, border-color 150ms ease, transform 80ms ease;
  -webkit-tap-highlight-color: transparent;
}
.scale-btn:hover {
  border-color: var(--accent);
  background: #F5F8FE;
}
.scale-btn:active { transform: scale(0.97); }
.scale-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.scale-btn[aria-checked="true"] {
  border-color: var(--accent);
  background: #E8EFFC;
}

.scale-btn-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.scale-btn-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.25;
  font-weight: 500;
}

.quiz-nav {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.stage-leaving {
  animation: slideOut 260ms ease forwards;
}
.stage-entering {
  animation: slideIn 300ms ease;
}
@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-20px); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- RESULTS ---------- */
.results-title {
  font-size: 28px;
  font-weight: 700;
  margin: 8px 0 24px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.zone {
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(10px);
  animation: zoneReveal 400ms ease forwards;
}
.zone-green  { background: var(--green-bg);  border: 1px solid rgba(22, 163, 74, 0.2); animation-delay: 0ms; }
.zone-orange { background: var(--orange-bg); border: 1px solid rgba(234, 88, 12, 0.2); animation-delay: 150ms; }
.zone-red    { background: var(--red-bg);    border: 1px solid rgba(220, 38, 38, 0.2); animation-delay: 300ms; }

@keyframes zoneReveal {
  to { opacity: 1; transform: translateY(0); }
}

.zone-header { margin-bottom: 14px; }
.zone-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.zone-green  .zone-title  { color: var(--green); }
.zone-orange .zone-title  { color: var(--orange); }
.zone-red    .zone-title  { color: var(--red); }

.zone-subtitle {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
}
.zone-caption {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.zone-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.zone-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid transparent;
}
.zone-green  .zone-card { border-color: rgba(22, 163, 74, 0.15); }
.zone-orange .zone-card { border-color: rgba(234, 88, 12, 0.15); }
.zone-red    .zone-card { border-color: rgba(220, 38, 38, 0.15); }

.zone-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.zone-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.zone-card-score {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.zone-card-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.results-note {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 24px 0;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.results-actions .btn { width: 100%; }

/* ---------- FOOTER ---------- */
.site-footer {
  padding: 28px 0 32px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

/* ---------- RESPONSIVE ---------- */
@media (min-width: 560px) {
  .hero-title { font-size: 44px; }
  .quiz-statement { font-size: 24px; }
  .scale-btn { min-height: 96px; }
  .scale-btn-num { font-size: 24px; }
  .scale-btn-label { font-size: 12px; }
  .results-title { font-size: 32px; }
}

@media (max-width: 380px) {
  .scale { gap: 6px; }
  .scale-btn { padding: 10px 2px; min-height: 80px; }
  .scale-btn-num { font-size: 20px; }
  .scale-btn-label { font-size: 10px; }
  .hero-title { font-size: 30px; }
  .quiz-statement { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
