@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Cormorant+Garamond:wght@500;600;700&display=swap');

:root {
  --forest: #4a210d;
  --forest-2: #6a351c;
  --sage: #e7d9c8;
  --sage-light: #f5ede3;
  --cream: #f3ede5;
  --paper: #fffaf4;
  --ink: #39271f;
  --muted: #78685f;
  --line: #e5d9cd;
  --gold: #b48761;
  --danger: #a84646;
  --shadow: 0 24px 70px rgba(74, 33, 13, .14);
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(231,217,200,.72), transparent 35rem),
    linear-gradient(145deg, #fbf7f1 0%, #eee3d7 100%);
  position: relative;
  overflow-x: hidden;
}

.ambient { position: fixed; border-radius: 999px; filter: blur(1px); opacity: .45; pointer-events: none; z-index: -1; }
.ambient-one { width: 24rem; height: 24rem; background: var(--sage); top: 18%; right: -14rem; }
.ambient-two { width: 18rem; height: 18rem; background: #d8bfa9; bottom: -9rem; left: -8rem; }

.site-header {
  width: min(100% - 32px, 920px);
  margin: 0 auto;
  padding: 28px 4px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-logo { object-fit: contain; border-radius: 50%; box-shadow: 0 8px 22px rgba(74,33,13,.2); }
.brand-mark {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 50% 50% 48% 52% / 58% 44% 56% 42%;
  background: var(--forest); color: white; font-family: "Cormorant Garamond", serif; font-weight: 700;
  box-shadow: 0 8px 20px rgba(74,33,13,.20);
}
.brand-copy { display: grid; }
.brand-copy strong { font-family: "Playfair Display", serif; font-size: 1.22rem; letter-spacing: .01em; }
.brand-copy small { color: var(--muted); font-size: .73rem; letter-spacing: .06em; text-transform: uppercase; }
.secure-note { color: var(--forest); font-size: .8rem; font-weight: 600; display: flex; align-items: center; gap: 7px; }

.app-shell { width: min(100% - 32px, 760px); margin: 12px auto 48px; }
.survey-card, .state-card {
  background: rgba(255,253,249,.96);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.survey-hero { padding: 44px 48px 34px; background: linear-gradient(145deg, var(--forest), var(--forest-2)); color: white; position: relative; }
.survey-hero::after {
  content: ""; position: absolute; width: 180px; height: 180px; border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%; right: -52px; top: -70px; box-shadow: 0 0 0 28px rgba(255,255,255,.035);
}
.eyebrow { margin: 0 0 12px; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; opacity: .78; }
h1, h2 { font-family: "Playfair Display", serif; }
.survey-hero h1 { margin: 0 0 14px; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; max-width: 600px; }
.survey-hero p { margin: 0; line-height: 1.7; color: rgba(255,255,255,.86); max-width: 620px; }
.time-pill { display: inline-flex; margin-top: 22px; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.13); font-size: .8rem; gap: 7px; align-items: center; }

.progress-wrap { padding: 24px 48px 0; }
.progress-meta { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-bottom: 9px; }
.progress-track { height: 7px; background: var(--sage-light); border-radius: 20px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--gold), #d9b77c); width: 0; border-radius: inherit; transition: width .35s ease; }

form { padding: 18px 48px 44px; }
.question { padding: 28px 0; border-bottom: 1px solid var(--line); animation: rise .35s ease both; }
.question:last-of-type { border-bottom: 0; }
.question[hidden] { display: none; }
.question-number { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sage-light); color: var(--forest); font-size: .75rem; font-weight: 700; margin-bottom: 10px; }
.question h2 { font-family: "DM Sans", sans-serif; font-size: 1.08rem; line-height: 1.5; margin: 0 0 7px; font-weight: 700; }
.required { color: var(--gold); margin-left: 3px; }
.help { margin: 0 0 17px; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.options { display: grid; gap: 10px; margin-top: 16px; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option label {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: white; cursor: pointer; transition: .18s ease;
}
.option label::before {
  content: ""; flex: 0 0 18px; width: 18px; height: 18px; border: 1.5px solid #9dacA6; border-radius: 50%; background: white;
}
.option input:checked + label { border-color: var(--forest-2); background: var(--sage-light); box-shadow: inset 3px 0 var(--forest); }
.option input:checked + label::before { border: 5px solid var(--forest); }
.option input:focus-visible + label { outline: 3px solid rgba(74,33,13,.20); outline-offset: 2px; }

.nps-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 5px; margin-top: 18px; }
.nps-item input { position: absolute; opacity: 0; }
.nps-item label {
  display: grid; place-items: center; aspect-ratio: 1; min-height: 42px; border: 1px solid var(--line);
  border-radius: 10px; background: white; cursor: pointer; font-weight: 700; color: var(--forest); transition: .15s ease;
}
.nps-item input:checked + label { background: var(--forest); color: white; border-color: var(--forest); transform: translateY(-2px); box-shadow: 0 7px 14px rgba(74,33,13,.20); }
.nps-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .73rem; margin-top: 8px; }

textarea, input[type="text"], input[type="date"], select {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink);
  padding: 14px 15px; font: inherit; transition: .18s ease; margin-top: 14px;
}
textarea { min-height: 116px; resize: vertical; line-height: 1.55; }
textarea:focus, input[type="text"]:focus, input[type="date"]:focus, select:focus { border-color: var(--forest-2); outline: 3px solid rgba(74,33,13,.12); }
input[readonly] { background: #f5f6f3; color: var(--muted); cursor: not-allowed; }
select { appearance: auto; min-height: 52px; }
.field-note { margin: 7px 2px 0; color: var(--muted); font-size: .75rem; }

.matrix-scroll { overflow-x: auto; margin-top: 18px; padding-bottom: 4px; }
.matrix { width: 100%; min-width: 650px; border-collapse: separate; border-spacing: 0 8px; font-size: .78rem; }
.matrix th { color: var(--muted); font-weight: 600; padding: 7px; }
.matrix th:first-child { text-align: left; width: 35%; }
.matrix td { text-align: center; padding: 11px 6px; background: #fafbf9; }
.matrix td:first-child { text-align: left; font-weight: 600; border-radius: 12px 0 0 12px; padding-left: 14px; }
.matrix td:last-child { border-radius: 0 12px 12px 0; }
.matrix input { width: 18px; height: 18px; accent-color: var(--forest); }

.info-block { border: 0; padding-bottom: 4px; }
.info-panel { background: var(--sage-light); border-radius: 18px; padding: 20px; }
.info-panel h2 { color: var(--forest); margin-bottom: 5px; }

.error-text { color: var(--danger); font-size: .8rem; font-weight: 600; margin-top: 10px; display: none; }
.question.invalid .error-text { display: block; }
.question.invalid > h2 { color: var(--danger); }

.form-actions { padding-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.privacy { color: var(--muted); font-size: .76rem; line-height: 1.45; max-width: 330px; }
button.primary {
  border: 0; border-radius: 14px; padding: 15px 24px; background: var(--forest); color: white; font: inherit;
  font-weight: 700; cursor: pointer; min-width: 170px; box-shadow: 0 10px 24px rgba(74,33,13,.23); transition: .18s ease;
}
button.primary:hover { background: #351707; transform: translateY(-1px); }
button.primary:disabled { opacity: .65; cursor: wait; transform: none; }

.state-card { min-height: 440px; padding: 64px 44px; text-align: center; display: grid; align-content: center; justify-items: center; }
.state-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--sage-light); color: var(--forest); font-size: 2rem; margin-bottom: 18px; }
.state-card h1 { font-size: 2rem; margin: 0 0 12px; }
.state-card p { color: var(--muted); max-width: 480px; line-height: 1.65; margin: 0; }
.spinner { width: 42px; height: 42px; border: 3px solid var(--sage); border-top-color: var(--forest); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 20px; }
.preview-banner { background: #efe0ca; color: #5b2d16; padding: 10px 16px; text-align: center; font-size: .8rem; font-weight: 700; }

footer { width: min(100% - 32px, 760px); margin: 0 auto 28px; text-align: center; color: var(--muted); font-size: .75rem; }
.noscript { margin: 20px; padding: 20px; background: white; border-radius: 12px; color: var(--danger); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #3b1b0c; color: white; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 20; font-size: .86rem; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 700px) {
  .site-header { padding-top: 18px; }
  .secure-note { font-size: 0; }
  .secure-note span { font-size: .85rem; }
  .app-shell { width: min(100% - 20px, 760px); margin-top: 4px; }
  .survey-card, .state-card { border-radius: 22px; }
  .survey-hero { padding: 34px 25px 28px; }
  .progress-wrap { padding: 22px 24px 0; }
  form { padding: 12px 24px 32px; }
  .question { padding: 25px 0; }
  .nps-scale { grid-template-columns: repeat(6, 1fr); gap: 7px; }
  .nps-item label { min-height: 44px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  button.primary { width: 100%; }
  .privacy { text-align: center; max-width: none; }
  .state-card { padding: 54px 26px; }
}
