:root {
  --navy: #0d2c54;
  --navy-dark: #081d3a;
  --red: #d31f2f;
  --red-dark: #b01423;
  --bg: #f2f5f9;
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #1e293b;
}

body { padding-bottom: env(safe-area-inset-bottom); }

/* Header */
.dl-header {
  background: var(--navy);
  color: #fff;
  padding: 0.85rem 1rem;
  padding-top: calc(0.85rem + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(8, 29, 58, 0.35);
}

/* Progress bar */
.dl-progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
}
.dl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), #ff5a68);
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* Cards */
.dl-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(13, 44, 84, 0.08);
  padding: 1.15rem;
  margin-bottom: 0.9rem;
}

/* Option rows (radio/checkbox) — touch friendly */
.dl-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 0.9rem;
  margin-top: 0.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.dl-opt:active { transform: scale(0.99); }
.dl-opt.selected {
  border-color: var(--red);
  background: #fef2f3;
}
.dl-opt .dl-mark {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid #cbd5e1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  transition: all 0.15s;
}
.dl-opt .dl-mark.radio { border-radius: 50%; }
.dl-opt .dl-mark.check { border-radius: 6px; }
.dl-opt.selected .dl-mark {
  border-color: var(--red);
  background: var(--red);
}

/* Scale 1-10 */
.dl-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.dl-scale button {
  padding: 0.75rem 0;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
}
.dl-scale button.selected {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

/* Grid question — mobile: one card per row */
.dl-grid-row {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem;
  margin-top: 0.6rem;
}
.dl-grid-row.answered { border-color: #86efac; background: #f0fdf4; }
.dl-grid-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.dl-grid-cols button {
  padding: 0.55rem 0.4rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.dl-grid-cols button.selected {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  font-weight: 600;
}

/* Inputs */
.dl-input, .dl-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  margin-top: 0.5rem;
  outline: none;
  transition: border-color 0.15s;
}
.dl-input:focus, .dl-textarea:focus { border-color: var(--navy); }
.dl-textarea { min-height: 96px; resize: vertical; }

/* Buttons */
.dl-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(211, 31, 47, 0.35);
  transition: background 0.15s, transform 0.1s;
}
.dl-btn-primary:active { transform: scale(0.98); }
.dl-btn-primary:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }

.dl-btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.2rem;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  color: #475569;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* Error highlight */
.dl-error { border-color: var(--red) !important; }
.dl-error-msg {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 0.4rem;
  font-weight: 600;
}

/* Shake animation for validation */
@keyframes dl-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.dl-shake { animation: dl-shake 0.3s ease 2; }

/* Fade-in step transition */
@keyframes dl-fadein {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.dl-step-enter { animation: dl-fadein 0.3s ease; }

/* Intro hero */
.dl-hero {
  background: linear-gradient(160deg, var(--navy) 0%, #14417b 60%, #1b5397 100%);
  color: #fff;
  border-radius: 20px;
  padding: 1.6rem 1.3rem;
  position: relative;
  overflow: hidden;
}
.dl-hero::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(211,31,47,0.35), transparent 70%);
  border-radius: 50%;
}

.dl-hero-logo {
  display: block;
  width: 210px;
  max-width: 70%;
  height: auto;
  margin-bottom: 0.9rem;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.dl-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

@media (min-width: 640px) {
  .dl-scale { grid-template-columns: repeat(10, 1fr); }
  .dl-grid-cols { grid-template-columns: repeat(4, 1fr); }
}
