* {
  box-sizing: border-box;
}

:root {
  --navy: #0a1f44;
  --red: #e53935;
  --text: #1a1a1a;
  --muted: #667085;
  --border: #d9e2ec;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(180deg, #eef3fa 0%, #f8fafc 100%);
  color: var(--text);
}

.app-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(10, 31, 68, 0.08);
  padding: 28px;
}

.hidden {
  display: none !important;
}

.brand-line {
  width: 72px;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--navy), var(--red));
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0 0 12px;
  color: var(--navy);
}

.intro,
.question-label,
.answer-label,
.message,
.label,
#progressText {
  font-size: 15px;
  line-height: 1.5;
}

.intro {
  margin: 0 0 18px;
  color: var(--muted);
}

.label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.text-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(10, 31, 68, 0.08);
}

.button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.primary-btn,
.secondary-btn,
.answer-btn {
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.primary-btn,
.secondary-btn {
  padding: 13px 18px;
  font-size: 15px;
}

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

.primary-btn:hover,
.secondary-btn:hover,
.answer-btn:hover {
  transform: translateY(-1px);
}

.secondary-btn {
  background: #fff;
  color: var(--red);
  border: 2px solid var(--red);
}

.secondary-btn:disabled,
.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--red);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.question-block {
  margin-bottom: 20px;
}

.question-label,
.answer-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

#questionText {
  font-size: 27px;
  line-height: 1.35;
}

.answers-list {
  display: grid;
  gap: 12px;
}

.answer-btn {
  width: 100%;
  text-align: left;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
}

.answer-btn.selected {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
  background: #fff7f7;
}

.answer-btn.saving {
  pointer-events: none;
}

.action-row {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

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

@media (max-width: 640px) {
  .app-shell {
    padding: 20px 14px 40px;
  }

  .card {
    padding: 20px;
  }

  #questionText {
    font-size: 22px;
  }

  .button-group {
    flex-direction: column;
  }

  .button-group .primary-btn,
  .button-group .secondary-btn {
    width: 100%;
  }
}
