/* Kanta PH quiz (Phase 2): 2 screens + free preview. Mobile first. */
:root {
  --q-bg: #f4f7f8;
  --q-surface: #ffffff;
  --q-primary: #0f3f4a;
  --q-primary-strong: #082d35;
  --q-accent: #d7a766;
  --q-accent-strong: #bf8f52;
  --q-text: #172227;
  --q-muted: #4d626b;
  --q-border: rgba(15, 63, 74, 0.16);
  --q-error: #b3261e;
  --q-ok: #1f7a4d;
  --q-radius: 18px;
  --q-shadow: 0 10px 28px rgba(10, 39, 47, 0.08);
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--q-text);
  background: radial-gradient(circle at 0% 0%, #ffffff 0%, var(--q-bg) 56%, #eaf3f6 100%);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: inherit; }
button { font: inherit; }

.q-top {
  width: min(560px, calc(100% - 32px));
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.q-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
  color: var(--q-primary);
}
.q-brand img { border-radius: 8px; display: block; }
.q-progress { margin: 0; font-size: 0.9rem; color: var(--q-muted); font-weight: 700; }

.q-main {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.q-screen h1 {
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(1.6rem, 6vw, 2rem);
  line-height: 1.2;
  margin: 10px 0 14px;
  color: #0b2f38;
}
.q-screen h2 {
  font-size: 1.05rem;
  margin: 24px 0 10px;
  color: var(--q-primary);
}
.q-lead { margin: 0 0 18px; color: var(--q-muted); }
/* Headings receive focus on screen change (for screen readers); no visible ring needed. */
.q-screen h1[tabindex="-1"]:focus { outline: none; }
.q-eyebrow {
  margin: 8px 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--q-accent-strong);
}

/* chips and option cards */
.q-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.q-chips-2 .q-chip { flex: 1 1 0; }
.q-chip {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--q-border);
  background: var(--q-surface);
  color: var(--q-text);
  font-weight: 700;
  cursor: pointer;
}
.q-chip[aria-checked="true"] {
  border-color: var(--q-primary);
  background: var(--q-primary);
  color: #fff;
}
.q-options { display: grid; gap: 10px; }
.q-option {
  text-align: left;
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--q-radius);
  border: 1.5px solid var(--q-border);
  background: var(--q-surface);
  color: var(--q-text);
  cursor: pointer;
}
.q-option strong { font-size: 1.02rem; }
.q-option span { color: var(--q-muted); font-size: 0.95rem; }
.q-option[aria-checked="true"] {
  border-color: var(--q-primary);
  box-shadow: inset 0 0 0 1.5px var(--q-primary);
  background: #f2f8f9;
}
.q-chip:focus-visible, .q-option:focus-visible, .q-btn:focus-visible, .q-input:focus-visible, .q-play:focus-visible {
  outline: 3px solid var(--q-accent);
  outline-offset: 2px;
}

/* form */
.q-label { display: block; font-weight: 700; margin: 18px 0 6px; color: var(--q-primary); }
.q-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--q-border);
  background: var(--q-surface);
  color: var(--q-text);
  font: inherit;
  font-size: 16px; /* no zoom on iOS */
}
.q-input:focus { border-color: var(--q-primary); outline: none; }
.q-input[aria-invalid="true"] { border-color: var(--q-error); }
.q-textarea { resize: vertical; min-height: 112px; }
.q-hint { margin: 6px 0 0; font-size: 0.88rem; color: var(--q-muted); }
.q-count { float: right; font-variant-numeric: tabular-nums; }
.q-error { margin: 6px 0 0; color: var(--q-error); font-size: 0.9rem; font-weight: 700; min-height: 0; }
.q-error:empty { display: none; }
.q-form-error { color: var(--q-error); font-weight: 700; margin: 16px 0 0; }
.q-form-error:empty { display: none; }

/* buttons */
.q-actions { display: grid; gap: 10px; margin-top: 26px; }
.q-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.q-btn[disabled] { opacity: 0.6; cursor: progress; }
.q-btn-primary {
  background: linear-gradient(145deg, var(--q-accent), var(--q-accent-strong));
  color: #2b1d0a;
  box-shadow: 0 10px 22px rgba(191, 143, 82, 0.35);
}
.q-btn-big { min-height: 56px; font-size: 1.08rem; }
.q-btn-secondary { background: var(--q-surface); color: var(--q-primary); border: 1.5px solid var(--q-border); }
.q-btn-link { background: transparent; color: var(--q-muted); min-height: 40px; }
.q-reassure { margin: 0; text-align: center; color: var(--q-muted); font-size: 0.92rem; }

.q-card {
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: var(--q-radius);
  padding: 16px;
  box-shadow: var(--q-shadow);
}
.q-noscript { margin-top: 20px; }

/* waiting */
.q-wait-visual { display: flex; gap: 6px; height: 54px; align-items: flex-end; margin-top: 18px; }
.q-wait-visual span {
  width: 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--q-accent), var(--q-primary));
  animation: q-eq 1.1s ease-in-out infinite;
}
.q-wait-visual span:nth-child(2) { animation-delay: 0.15s; }
.q-wait-visual span:nth-child(3) { animation-delay: 0.3s; }
.q-wait-visual span:nth-child(4) { animation-delay: 0.45s; }
.q-wait-visual span:nth-child(5) { animation-delay: 0.6s; }
@keyframes q-eq { 0%, 100% { height: 14px; } 50% { height: 54px; } }
@media (prefers-reduced-motion: reduce) { .q-wait-visual span { animation: none; height: 32px; } }

.q-steps { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.q-steps li { position: relative; padding-left: 30px; color: var(--q-muted); }
.q-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--q-border);
}
.q-steps li.is-active { color: var(--q-primary); font-weight: 700; }
.q-steps li.is-active::before { border-color: var(--q-accent); border-top-color: transparent; animation: q-spin 0.9s linear infinite; }
.q-steps li.is-done { color: var(--q-text); }
.q-steps li.is-done::before { border-color: var(--q-ok); background: var(--q-ok); box-shadow: inset 0 0 0 3px #fff; }
@keyframes q-spin { to { transform: rotate(360deg); } }

.q-contact { margin-top: 18px; }
.q-contact .q-label { margin-top: 0; font-weight: 600; }
.q-inline { display: flex; gap: 8px; }
.q-inline .q-input { flex: 1 1 auto; min-width: 0; }
.q-inline .q-btn { flex: none; }

/* preview player */
.q-player {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0b2f38, #0f3f4a 60%, #173f35);
  color: #fbf3e4;
  box-shadow: var(--q-shadow);
}
.q-play {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(145deg, #f1cf94, #d39b52);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.q-play svg { width: 28px; height: 28px; fill: #2b1d0a; }
.q-play .q-icon-pause { display: none; }
.q-player.is-playing .q-icon-play { display: none; }
.q-player.is-playing .q-icon-pause { display: block; }
.q-track { flex: 1 1 auto; min-width: 0; }
.q-bar { height: 6px; border-radius: 6px; background: rgba(251, 243, 228, 0.25); overflow: hidden; }
.q-bar span { display: block; height: 100%; width: 0; background: #f1cf94; transition: width 0.2s linear; }
.q-time { margin: 8px 0 0; font-size: 0.9rem; font-variant-numeric: tabular-nums; color: #e6d7bb; }

.q-chorus {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--q-accent);
  background: var(--q-surface);
  border-radius: 0 14px 14px 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-style: italic;
  font-size: 1.05rem;
  color: #0b2f38;
}
.q-chorus:empty { display: none; }
.q-chorus p { margin: 0; }
.q-promise {
  margin: 20px 0 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--q-primary);
}
.q-next { margin-top: 18px; }
.q-next h2 { margin-top: 0; }
.q-next p { margin: 0 0 6px; }

.q-foot {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.88rem;
  color: var(--q-muted);
}
.q-foot a { text-decoration: none; }
.q-foot a:hover { color: var(--q-primary); }

@media (min-width: 640px) {
  .q-main { padding-top: 28px; }
  .q-options { grid-template-columns: repeat(3, 1fr); }
}

/* offer (Phase 3) */
.q-plans { grid-template-columns: 1fr !important; }
.q-plan { position: relative; gap: 4px; padding-top: 16px; }
.q-plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.q-plan-head strong { font-size: 1.1rem; }
.q-price { font-size: 1.35rem; font-weight: 800; color: var(--q-primary-strong); }
.q-plan-note { font-size: 0.86rem; color: var(--q-accent-strong) !important; font-weight: 700; }
.q-badge {
  position: absolute; top: -10px; right: 14px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  color: #2b1d0a !important; background: linear-gradient(140deg, #f1cf94, #d39b52);
}

/* /salamat delivery + photo (Phase 4) */
.q-delivery, .q-photo { margin-top: 16px; }
.q-delivery .q-btn, .q-photo .q-btn { margin-top: 12px; }
.q-muted { color: var(--q-muted, #5b6b70); font-size: 0.95rem; }
.q-file { position: relative; overflow: hidden; display: inline-flex; cursor: pointer; }
.q-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#photoThumb { display: block; margin-top: 12px; max-width: 160px; border-radius: 12px; }
#photoThumb[hidden] { display: none; }
