:root {
  --navy: #1f3864;
  --accent: #2e75b6;
  --accent-light: #eaf2fb;
  --gray: #595959;
  --gray-light: #f4f6f9;
  --border: #dfe4ea;
  --success: #1f8a4c;
  --danger: #c0392b;
  --radius: 14px;
  --max-width: 640px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1d2433;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
  min-height: 100%;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffffcc;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
}

.brand {
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.2px;
  margin-bottom: 10px;
  font-size: 15px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--navy));
  border-radius: 999px;
  transition: width 0.45s ease;
}

.app {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px 60px;
}

.card {
  width: 100%;
  max-width: var(--max-width);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(31, 56, 100, 0.08);
  padding: 36px 32px;
  animation: rise 0.35s ease;
}

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

.step-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 10px;
}

h1.q-title {
  font-size: 26px;
  line-height: 1.3;
  color: var(--navy);
  margin: 0 0 8px;
}

h2.q-title {
  font-size: 21px;
  line-height: 1.35;
  color: var(--navy);
  margin: 0 0 6px;
}

.q-help {
  color: var(--gray);
  font-size: 14.5px;
  margin: 0 0 22px;
  line-height: 1.5;
}

.field {
  margin-bottom: 18px;
}

label.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: #2a3142;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  font-size: 16px;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  color: #1d2433;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23595959'><path d='M5.5 7.5l4.5 5 4.5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 38px;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 6px;
  display: none;
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--danger);
}

.field.invalid .error-text { display: block; }

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 15.5px;
  color: #1d2433;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
}

.option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.option-btn:active { transform: scale(0.99); }

.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.option-marker {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.option-btn.selected .option-marker {
  border-color: var(--accent);
  background: var(--accent);
}

.option-btn.checkbox .option-marker {
  border-radius: 5px;
}

.option-marker svg {
  width: 12px;
  height: 12px;
  fill: #fff;
  display: none;
}

.option-btn.selected .option-marker svg { display: block; }

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
  gap: 12px;
}

.btn {
  font-size: 15.5px;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.05s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--navy));
  color: #fff;
  flex: 1;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--gray);
  padding: 13px 10px;
}

.btn-skip {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  font-size: 14px;
  padding: 8px 0;
}

.welcome-list {
  margin: 18px 0 26px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.welcome-list li {
  display: flex;
  gap: 10px;
  font-size: 14.5px;
  color: #2a3142;
  align-items: flex-start;
}

.welcome-list .dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
}

.time-pill {
  display: inline-block;
  background: var(--accent-light);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.thankyou-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--navy));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
}

.thankyou-icon svg {
  width: 30px;
  height: 30px;
  stroke: #fff;
  fill: none;
  stroke-width: 3;
}

.center { text-align: center; }

.footer {
  text-align: center;
  font-size: 12.5px;
  color: var(--gray);
  padding: 18px 20px 28px;
}

.submit-error {
  background: #fdecea;
  border: 1px solid #f5c2bd;
  color: var(--danger);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .card { padding: 28px 20px; }
  h1.q-title { font-size: 22px; }
  h2.q-title { font-size: 19px; }
}
