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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.container {
  max-width: 760px;
  margin: 0 auto;
}

header {
  background: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
  color: #fff;
  border-radius: 12px;
  padding: 2rem 2rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(13, 71, 161, 0.25);
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

header .subtitle {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Score widget */
.score-widget {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  flex-shrink: 0;
}

.traffic-light {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #111;
  border-radius: 20px;
  padding: 8px 6px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
}

.light {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  transition: opacity 0.3s, box-shadow 0.3s;
  opacity: 0.2;
}

.light.red    { background: #f44336; }
.light.yellow { background: #ffca28; }
.light.green  { background: #4caf50; }

.light.active {
  opacity: 1;
}

.light.active.red    { box-shadow: 0 0 10px 3px rgba(244, 67, 54, 0.7); }
.light.active.yellow { box-shadow: 0 0 10px 3px rgba(255, 202, 40, 0.7); }
.light.active.green  { box-shadow: 0 0 10px 3px rgba(76, 175, 80, 0.7); }

.score-label {
  display: flex;
  flex-direction: column;
  color: #fff;
}

.score-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.75;
  font-weight: 600;
}

.score-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.score-status {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.9;
  transition: color 0.3s;
}

/* Question blocks */
.question-block {
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  border-left: 4px solid #1976d2;
  transition: box-shadow 0.2s;
}

.question-block:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.question-block h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: #1a1a2e;
  line-height: 1.4;
}

.question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1976d2;
  color: #fff;
  border-radius: 50%;
  min-width: 1.75rem;
  height: 1.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

/* Radio options */
.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1.5px solid #e8eaf0;
  background: #fafbfc;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.option:hover {
  border-color: #90b4e8;
  background: #f0f5ff;
}

.option:has(input:checked) {
  border-color: #1976d2;
  background: #e8f0fe;
}

.option input[type="radio"] {
  accent-color: #1976d2;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.option-label {
  font-size: 0.95rem;
  color: #333;
}

.option:has(input:checked) .option-label {
  font-weight: 600;
  color: #0d47a1;
}

.badge {
  font-size: 0.68rem;
  background: #bbdefb;
  color: #0d47a1;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-weight: 700;
  margin-left: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Custom text input */
.custom-input {
  margin-top: 0.75rem;
}

.custom-input input[type="text"] {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid #e8eaf0;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fafbfc;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.custom-input input[type="text"]:focus {
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
}

.hidden {
  display: none !important;
}

/* Warning banner */
.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #fff8e1;
  border: 1.5px solid #f9a825;
  border-left: 4px solid #f9a825;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  color: #5f4200;
  animation: slideDown 0.25s ease;
}

.warning-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1.3;
  color: #f9a825;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Export button */
.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.75rem;
  padding-bottom: 2rem;
}

#export-btn {
  background: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.2px;
  box-shadow: 0 3px 10px rgba(13, 71, 161, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

#export-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(13, 71, 161, 0.4);
}

#export-btn:active {
  transform: translateY(0);
}
