:root {
  --bg-page: #f4f7fb;
  --bg-soft: #f8fbff;
  --white: #ffffff;

  --navy: #102a43;
  --blue: #0b5cad;
  --blue-dark: #084a8a;
  --blue-soft: #eaf3ff;

  --text-main: #16324f;
  --text-muted: #66788f;

  --border: #d8e2ee;
  --border-strong: #c8d5e3;

  --success: #0b5cad;
  --success-bg: #eaf3ff;

  --danger: #dc2626;
  --danger-bg: #fff2f2;

  --warning: #b45309;
  --warning-bg: #fff7ed;
  --warning-border: #fed7aa;

  --shadow-sm: 0 8px 20px rgba(16, 42, 67, 0.06);
  --shadow-md: 0 18px 40px rgba(16, 42, 67, 0.08);
  --shadow-lg: 0 28px 70px rgba(16, 42, 67, 0.1);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(11, 92, 173, 0.1), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f5f8fc 55%, #edf3f9 100%);
  color: var(--text-main);
}

/* HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 5px;
  box-shadow: var(--shadow-sm);
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.brand-title {
  font-size: 28px;
  line-height: 1.12;
  color: var(--navy);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s ease;
}

.header-icon-btn:hover {
  transform: translateY(-1px);
  border-color: #b9d7f5;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.header-icon-btn-primary {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

.header-icon-btn-primary:hover {
  background: var(--blue-dark);
  color: #ffffff;
  border-color: var(--blue-dark);
}

.header-icon-btn svg {
  width: 21px;
  height: 21px;
  display: block;
}

/* LAYOUT */

.app-shell {
  padding: 48px 20px 42px;
}

.screen {
  display: none;
  align-items: flex-start;
  justify-content: center;
  min-height: calc(100vh - 152px);
}

.screen.active {
  display: flex;
}

.card {
  width: 100%;
  max-width: 980px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px;
}

/* SHARED TEXT */

.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  border: 1px solid #cfe1f8;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 18px;
}

.section-title,
.hero-title,
.quiz-title {
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.section-title {
  font-size: clamp(32px, 5vw, 52px);
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(32px, 4.4vw, 50px);
  margin-bottom: 16px;
}

.quiz-title {
  font-size: clamp(28px, 4vw, 42px);
  margin-top: 4px;
}

.hero-description,
.section-description,
.result-description {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 17px;
}

/* HERO */

.hero-card,
.result-card {
  text-align: center;
}

.hero-card {
  max-width: 940px;
}

.hero-description {
  max-width: 760px;
  margin: 0 auto 30px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 30px 0 34px;
}

.stat-box,
.summary-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
}

.stat-box strong,
.summary-item strong {
  display: block;
  font-size: 24px;
  color: var(--navy);
  margin-bottom: 6px;
}

.stat-box span,
.summary-item span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

/* BUTTON */

.btn {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 15px 28px;
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue), #1b82d6);
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(11, 92, 173, 0.2);
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.28),
    transparent
  );
  transform: skewX(-20deg);
  transition: 0.5s ease;
}

.btn-primary:hover::after {
  left: 120%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(11, 92, 173, 0.26);
}

.btn-secondary {
  background: var(--navy);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(16, 42, 67, 0.18);
}

.btn-secondary:hover {
  transform: translateY(-2px);
}

.btn-light {
  background: #ffffff;
  color: var(--navy);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-light:hover {
  background: var(--blue-soft);
  border-color: #b9d7f5;
  color: var(--blue-dark);
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
}

/* FORM */

.form-card {
  max-width: 980px;
}

.respondent-form {
  margin-top: 30px;
  padding-bottom: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 14px;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 8px;
}

.label-optional {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
}

.form-group input,
.form-group select {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: #ffffff;
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

.form-group select {
  appearance: none;
  cursor: pointer;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 23px,
    calc(100% - 16px) 23px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.form-group input::placeholder {
  color: #94a3b8;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(11, 92, 173, 0.1);
}

.form-group input.input-error,
.form-group select.input-error {
  border-color: var(--danger);
  background-color: #fffdfd;
}

.error-text {
  min-height: 18px;
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.form-actions {
  margin-top: 24px;
}

/* CONSENT */

.consent-box {
  margin-top: 30px;
  padding: 22px 24px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  text-align: left;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.8;
  cursor: pointer;
}

.consent-label input {
  width: 18px;
  height: 18px;
  margin-top: 5px;
  accent-color: var(--blue);
  flex-shrink: 0;
}

/* QUIZ */

.quiz-card {
  max-width: 900px;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.quiz-counter {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  color: var(--navy);
  flex-shrink: 0;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e5edf5;
  overflow: hidden;
  margin-bottom: 32px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(135deg, var(--blue), #4db7ff);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.question-section {
  display: grid;
  gap: 22px;
}

.question-text {
  font-size: 28px;
  line-height: 1.45;
  color: var(--navy);
}

.options-list {
  display: grid;
  gap: 12px;
}

.option-btn {
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 17px 18px;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
}

.option-btn:hover {
  transform: translateY(-1px);
  border-color: #bad4ef;
  background: #f9fbfe;
}

.option-btn.selected {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue-dark);
  box-shadow: 0 0 0 4px rgba(11, 92, 173, 0.08);
}

.quiz-note {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.quiz-warning {
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.quiz-actions {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
}

.quiz-actions-between {
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.quiz-action-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hidden {
  display: none;
}

/* RESULT */

.result-score-circle {
  width: 168px;
  height: 168px;
  margin: 28px auto;
  border-radius: 50%;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, var(--blue), #3bb4ff) border-box;
  border: 10px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 45px rgba(11, 92, 173, 0.14);
}

.result-score-circle span {
  font-size: 40px;
  font-weight: 900;
  color: var(--navy);
}

.result-level {
  font-size: 28px;
  color: var(--navy);
  margin-bottom: 10px;
}

.result-description {
  max-width: 760px;
  margin: 0 auto;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 30px 0;
}

.submit-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.completion-message {
  margin: 22px auto 0;
  max-width: 760px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid #cfe1f8;
  background: var(--blue-soft);
  text-align: left;
}

.completion-message strong {
  display: block;
  color: var(--blue-dark);
  font-size: 16px;
  margin-bottom: 6px;
}

.completion-message span {
  display: block;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.7;
}

/* REVIEW */

.review-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: left;
}

.review-title {
  font-size: 26px;
  color: var(--navy);
  margin-bottom: 8px;
}

.review-description {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.review-list {
  display: grid;
  gap: 16px;
  margin-bottom: 30px;
}

.review-item {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.review-item.correct {
  border-color: #b9d7f5;
  background: var(--success-bg);
}

.review-item.wrong {
  border-color: #fecaca;
  background: var(--danger-bg);
}

.review-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 10px;
}

.review-item.correct .review-status {
  background: #d8ebff;
  color: var(--blue-dark);
}

.review-item.wrong .review-status {
  background: #fee2e2;
  color: #b91c1c;
}

.review-question {
  font-weight: 900;
  color: var(--navy);
  line-height: 1.5;
  margin-bottom: 10px;
}

.review-answer {
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.7;
}

.review-answer strong {
  color: var(--navy);
}

.review-explanation {
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.7;
  margin-top: 8px;
}

/* RESULT ACTIONS */

.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* RESPONSIVE */

@media (max-width: 980px) {
  .brand-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .brand-title {
    font-size: 22px;
  }

  .card {
    padding: 32px 24px;
  }

  .question-text {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 12px 16px;
  }

  .brand-main {
    gap: 12px;
  }

  .logo-group {
    gap: 6px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    padding: 4px;
  }

  .brand-title {
    font-size: 18px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-icon-btn {
    width: 40px;
    height: 40px;
  }

  .header-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .app-shell {
    padding: 30px 14px 30px;
  }

  .screen {
    min-height: calc(100vh - 150px);
  }

  .card {
    border-radius: 22px;
  }

  .hero-stats,
  .result-summary,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: auto;
  }

  .quiz-header {
    flex-direction: column;
  }

  .quiz-actions,
  .quiz-actions-between {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-action-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .quiz-actions .btn {
    width: 100%;
  }

  .hero-title,
  .section-title {
    font-size: 34px;
  }

  .question-text {
    font-size: 22px;
  }

  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .result-actions .btn {
    width: 100%;
  }

  .consent-box {
    margin-top: 26px;
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .brand-main {
    align-items: flex-start;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .hero-title,
  .section-title {
    font-size: 30px;
  }

  .card {
    padding: 26px 18px;
  }

  .header-icon-btn {
    width: 38px;
    height: 38px;
  }

  .header-icon-btn svg {
    width: 17px;
    height: 17px;
  }

  .quiz-action-group {
    grid-template-columns: 1fr;
  }

  .consent-box {
    padding: 18px;
  }
}