/* ---- Psychometry quiz — warm, encouraging design system ---- */

:root {
  --bg: #FBF6EC;
  --ink: #2B2018;
  --muted: #837567;
  --card: #FFFFFF;
  --saffron: #E98A3C;
  --saffron-deep: #CF7127;
  --sage: #4C8577;
  --sage-soft: #E9F1ED;
  --line: #ECE2D2;
  --shadow: 0 14px 40px -18px rgba(120, 78, 30, 0.30);
  --shadow-sm: 0 4px 14px -8px rgba(120, 78, 30, 0.35);
  --radius: 20px;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
  padding: 28px 20px 64px;
  min-height: 100vh;
  background:
    radial-gradient(60% 55% at 85% -5%, rgba(233, 138, 60, 0.20), transparent 60%),
    radial-gradient(55% 45% at -10% 108%, rgba(76, 133, 119, 0.20), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

.wrap { max-width: 620px; margin: 0 auto; }

/* Header / branding */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--sage);
  margin-bottom: 24px;
}
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(140deg, var(--saffron), var(--saffron-deep));
  box-shadow: 0 0 0 4px rgba(233, 138, 60, 0.16);
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 7vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 30px 0 6px;
}
.lead { color: var(--muted); font-size: 18px; margin: 0 0 8px; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px;
}

/* Form fields */
label { display: block; font-weight: 700; margin: 20px 0 8px; }
input, select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 19px;
  padding: 15px 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #FCFAF5;
  min-height: 56px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 4px rgba(233, 138, 60, 0.15);
}

/* Buttons */
button {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 800;
  padding: 17px 24px;
  min-height: 58px;
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, var(--saffron), var(--saffron-deep));
  border: none;
  border-radius: 16px;
  margin-top: 26px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s;
}
button:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(207,113,39,.55); }
button:active { transform: translateY(0); filter: brightness(.97); }
button:disabled { opacity: .5; cursor: default; transform: none; }
button.ghost {
  background: transparent;
  color: var(--sage);
  border: 2px solid var(--sage);
  box-shadow: none;
}
button.whatsapp {
  background: linear-gradient(135deg, #35C15E, #1FA34C);
  box-shadow: 0 10px 24px -12px rgba(31,163,76,.6);
}

.error { color: #B23A2E; font-weight: 700; margin-top: 14px; }
.hint { color: var(--muted); font-size: 15px; margin-top: 6px; }

/* Quiz progress */
.progress {
  height: 12px;
  background: #EFE7D8;
  border-radius: 8px;
  overflow: hidden;
  margin: 6px 0 6px;
  box-shadow: inset 0 1px 2px rgba(120,78,30,.12);
}
.progress > div {
  height: 100%;
  width: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--sage), var(--saffron));
  transition: width .35s cubic-bezier(.3,.8,.3,1);
}
.progress-text { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 22px; letter-spacing: .02em; }

/* Question */
.q { animation: rise .35s ease both; }
.q .prompt { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.25; margin: 4px 0 6px; }
.q .explain {
  color: var(--muted);
  font-size: 16px;
  background: var(--sage-soft);
  border-left: 3px solid var(--sage);
  padding: 10px 14px;
  border-radius: 0 12px 12px 0;
  margin: 12px 0 20px;
}

/* DISC options */
.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 2px solid var(--line);
  background: #FCFAF5;
  border-radius: 16px;
  padding: 18px 18px;
  margin: 12px 0;
  cursor: pointer;
  font-weight: 600;
  transition: transform .12s, border-color .12s, background .12s, box-shadow .12s;
}
.opt::before {
  content: "";
  flex: 0 0 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #CDBEA8;
  transition: all .12s;
}
.opt:hover { transform: translateY(-2px); border-color: var(--saffron); background: #fff; box-shadow: var(--shadow-sm); }
.opt:hover::before { border-color: var(--saffron); box-shadow: inset 0 0 0 5px var(--saffron); }

/* 1–5 scale */
.scale { display: flex; gap: 10px; margin-top: 6px; }
.scale button {
  flex: 1; margin: 0; min-height: 60px;
  font-size: 22px; font-weight: 800;
  color: var(--ink);
  background: #FCFAF5;
  border: 2px solid var(--line);
  box-shadow: none;
}
.scale button:hover { transform: translateY(-2px); border-color: var(--saffron); background: #fff; color: var(--saffron-deep); box-shadow: var(--shadow-sm); }
.scale-labels { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; color: var(--muted); margin-top: 8px; }

/* Thank-you */
.center { text-align: center; }
.badge {
  width: 92px; height: 92px; margin: 4px auto 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 46px;
  background: radial-gradient(circle at 30% 25%, #fff, var(--sage-soft));
  box-shadow: var(--shadow);
  animation: pop .5s cubic-bezier(.2,1.3,.4,1) both;
}

.disclaimer { margin-top: 26px; color: var(--muted); font-size: 15px; }

/* Practice / how-it-works */
.steps { display: flex; gap: 8px; margin: 4px 0 20px; }
.stepdot { flex: 1; height: 7px; border-radius: 4px; background: #EAE0D0; transition: background .25s; }
.stepdot.on { background: var(--saffron); }
.stepdot.done { background: var(--sage); }
.tag {
  display: inline-block;
  font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--sage);
  background: var(--sage-soft);
  padding: 5px 12px; border-radius: 999px; margin: 0 0 12px;
}
.opt.picked { border-color: var(--saffron); background: #fff; box-shadow: var(--shadow-sm); }
.opt.picked::before { border-color: var(--saffron); box-shadow: inset 0 0 0 5px var(--saffron); }
.scale button.picked { border-color: var(--saffron); background: #fff; color: var(--saffron-deep); box-shadow: var(--shadow-sm); }
.feedback {
  margin-top: 18px;
  background: var(--sage-soft);
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 17px;
  animation: rise .3s ease both;
}
.feedback button { margin-top: 14px; }

/* Compact meaning legend under the 1–5 scale in the real quiz */
.scale-meaning {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
}

/* ---- Admin (mum's desk) ---- */
.wrap-wide { max-width: 860px; margin: 0 auto; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 10px 0;
  box-shadow: var(--shadow-sm);
}
/* Whole-card clickable participant row */
a.rowlink {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
a.rowlink:hover {
  transform: translateY(-2px);
  border-color: var(--saffron);
  box-shadow: var(--shadow);
}
.open-cta {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 17px;
  color: var(--saffron-deep);
  white-space: nowrap;
}
.row .who { font-weight: 700; font-size: 19px; }
.row .meta { color: var(--muted); font-size: 15px; }
.row a.review-link {
  flex: 0 0 auto;
  display: inline-block;
  width: auto;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 800;
}
.badge-status {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.st-submitted { background: #FDEBD3; color: #9A5B12; }
.st-needs_review { background: #FCE4C6; color: #A85E10; }
.st-confirmed { background: var(--sage-soft); color: #2f6b4f; }
.field-label { font-weight: 800; margin: 22px 0 6px; font-size: 17px; }
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-height: 110px;
  resize: vertical;
}
textarea:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 4px rgba(233,138,60,.15); }
.btnrow { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btnrow button, .btnrow a.btn {
  flex: 1 1 200px;
  width: auto;
  margin-top: 0;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 12px;
  font-weight: 700; box-shadow: var(--shadow); z-index: 50;
}
.code-pill {
  display: inline-block; font-family: monospace; font-size: 20px; font-weight: 700;
  background: var(--sage-soft); color: #2f6b4f; padding: 6px 14px; border-radius: 10px;
  letter-spacing: .08em;
}

/* ---- Tabs ---- */
.tabs { display: flex; gap: 10px; margin: 22px 0 20px; }
.tab {
  flex: 1;
  width: auto;
  margin: 0;
  padding: 14px 18px;
  font-size: 18px;
  font-weight: 800;
  background: #fff;
  color: var(--muted);
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: none;
}
.tab.active { background: var(--saffron); color: #fff; border-color: var(--saffron); }
.tab:hover:not(.active) { border-color: var(--saffron); color: var(--saffron-deep); }
.hidden { display: none; }

/* Read-only report view */
.reportview { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px; box-shadow: var(--shadow-sm); }
.reportview .rlead { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--ink); margin: 0 0 18px; }
.reportview h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 22px 0 6px; color: var(--saffron-deep); }
.reportview p { font-size: 17px; margin: 0 0 10px; }

/* Report card (scores) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.chip { background: var(--sage-soft); color: #2f6b4f; font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: 16px; }
.chip.warn { background: #FCE4C6; color: #A85E10; }
.statline { font-size: 18px; margin: 8px 0; }
.statline strong { color: var(--saffron-deep); }

/* The one "change" box */
.changebox { margin-top: 22px; }
.changebox h2 { margin-top: 0; }
.mini { color: var(--muted); font-size: 15px; margin-top: 8px; }

/* Writing spinner */
.generating { text-align: center; padding: 40px 20px; }
.generating .spin {
  width: 46px; height: 46px; margin: 0 auto 18px;
  border: 5px solid var(--muted); border-top-color: var(--saffron);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Printable report ---- */
.report h1 { font-size: 34px; }
.report .section { margin: 26px 0; }
.report .section h2 { border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.report p.body { font-size: 17px; }
.print-btn { position: sticky; top: 16px; z-index: 10; }
@media print {
  body { padding: 0; background: #fff; }
  .no-print { display: none !important; }
  .report .section { break-inside: avoid; }
  .bar-track { border: 1px solid #ccc; }
}

/* Staggered entrance */
.reveal > * { animation: rise .5s ease both; }
.reveal > *:nth-child(1) { animation-delay: .04s; }
.reveal > *:nth-child(2) { animation-delay: .10s; }
.reveal > *:nth-child(3) { animation-delay: .16s; }
.reveal > *:nth-child(4) { animation-delay: .22s; }
.reveal > *:nth-child(5) { animation-delay: .28s; }
.reveal > *:nth-child(6) { animation-delay: .34s; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

@media (min-width: 640px) {
  body { padding-top: 48px; }
}
