:root {
  color-scheme: light;
  --page-bg: #f4f6fa;
  --navy: #10203f;
  --navy-2: #16294d;
  --card-bg: #ffffff;
  --border: #e3e6ec;
  --text: #1a2233;
  --text-dim: #667085;
  --accent: #eaa33e;
  --accent-dark: #d6901f;
  --green: #1f9d63;
  --green-bg: #e6f6ee;
  --amber-bg: #fdf1de;
  --amber-text: #a5610b;
  --blue-bg: #eaf2ff;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  padding: 32px 16px 64px;
}

.wrap {
  width: 100%;
  max-width: 780px;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--card-bg);
}

.stepper-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.stepper-line {
  flex: 1 1 auto;
  height: 2px;
  background: var(--border);
  margin: 0 8px 22px;
}

.stepper-item.done .stepper-circle {
  border-color: var(--green);
  color: var(--green);
}

.stepper-item.active .stepper-circle {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.stepper-item.active .stepper-label,
.stepper-item.done .stepper-label {
  color: var(--text);
  font-weight: 600;
}

.stepper-line.done {
  background: var(--green);
}

/* Panel */
.panel {
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(16, 32, 63, 0.08);
}

.panel-banner {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-size: 0.85rem;
}

.banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.banner-pill {
  background: var(--accent);
  color: #2a1a02;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.75rem;
}

.panel-body {
  padding: 32px;
}

.panel-body.split {
  display: grid;
  grid-template-columns: 260px 1fr;
  padding: 0;
}

.side-panel {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #cdd6ea;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
}

.side-kicker {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.side-heading {
  color: #fff;
  font-size: 1.4rem;
  margin: 0 0 12px;
  line-height: 1.3;
}

.side-copy {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #b7c1da;
  margin: 0;
}

.side-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #dbe2f2;
}

.gift-icon {
  font-size: 1.1rem;
}

.form-panel {
  padding: 32px;
}

.form-heading {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.form-subheading {
  margin: 0 0 20px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8f9fb;
  color: var(--text);
  font-size: 0.95rem;
}

input:focus {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}

.hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 4px 0 14px;
}

.hint a {
  color: var(--navy);
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 20px;
}

.checkbox-field input {
  margin-top: 3px;
}

.checkbox-field label {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--text-dim);
}

button.primary {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #2a1a02;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button.primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

button.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.secondary {
  padding: 13px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.status {
  text-align: center;
  min-height: 1.2em;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 12px;
}

.status.error {
  color: #c0392b;
}

/* Quiz */
.quiz-progress {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin: 0 0 8px;
}

.quiz-question {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.quiz-number {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 24px;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8f9fb;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.quiz-option:hover {
  border-color: var(--navy);
}

.quiz-option.selected {
  border-color: var(--navy);
  background: var(--blue-bg);
}

.option-letter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.quiz-actions button.primary {
  width: auto;
  padding: 12px 22px;
}

/* Results */
.thanks-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}

.check-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}

.thanks-heading {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.thanks-copy {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.results-grid.single {
  grid-template-columns: 1fr;
  max-width: 360px;
}

.result-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.result-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green);
}

.badge.warn {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.badge.muted {
  background: #eef0f4;
  color: var(--text-dim);
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: #eef0f4;
  overflow: hidden;
  margin-bottom: 12px;
}

.meter-fill {
  height: 100%;
  background: var(--green);
  width: 0%;
  transition: width 0.3s ease;
}

.result-title {
  font-weight: 600;
  font-size: 0.88rem;
  margin: 0 0 4px;
}

.result-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--blue-bg);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 16px;
}

.link-back {
  background: none;
  border: none;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

/* Flow footer */
.flow-footer {
  border-top: 1px solid var(--border);
  padding: 18px 32px 24px;
  background: #fafbfc;
}

.flow-footer-title {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0 0 14px;
}

.flow-stages {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.stage-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex: 0 0 auto;
}

.flow-stage.done .stage-dot {
  background: var(--green);
  border-color: var(--green);
}

.stage-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
}

.stage-copy {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.flow-arrow {
  color: var(--border);
  flex: 0 0 auto;
}

.page-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-top: 16px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 32, 63, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.modal[hidden] {
  display: none;
}

.modal-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-card h3 {
  margin-top: 0;
}

.modal-body p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.modal-card button.primary {
  margin-top: 12px;
}

@media (max-width: 640px) {
  .panel-body.split {
    grid-template-columns: 1fr;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .quiz-options {
    grid-template-columns: 1fr;
  }
  .results-grid {
    grid-template-columns: 1fr;
  }
  .flow-stages {
    flex-direction: column;
    align-items: flex-start;
  }
  .flow-arrow {
    display: none;
  }
  .stepper-label {
    display: none;
  }
}

/* Admin page reuse */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}

tr.winner td {
  color: var(--green);
  font-weight: 700;
}

.delete-btn {
  border: 1px solid #e3b3ab;
  border-radius: 8px;
  background: #fdf2f0;
  color: #c0392b;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.delete-btn:hover {
  background: #fbe3df;
}

.admin-login {
  display: flex;
  gap: 8px;
}

.admin-login input {
  flex: 1;
}

.admin-login button {
  border: none;
  border-radius: 10px;
  background: var(--navy);
  color: white;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 600;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

header h1 {
  font-size: 1.5rem;
  margin: 0 0 4px;
}

header p {
  color: var(--text-dim);
  margin: 0;
  font-size: 0.9rem;
}
