/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brown:       #6B4226;
  --brown-light: #8B6340;
  --cream:       #FFF8F0;
  --cream-dark:  #F5EDE3;
  --gold:        #D4A24E;
  --text:        #3B2314;
  --text-light:  #6B5B4F;
  --white:       #FFFFFF;
  --green:       #4A7C59;
  --red:         #C0392B;
  --radius:      10px;
  --shadow:      0 2px 12px rgba(107,66,38,.12);
}

html { font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ── Header ──────────────────────────────────────────── */
.site-header {
  text-align: center;
  padding: 32px 16px 24px;
  background: var(--brown);
  color: var(--cream);
}

.site-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.site-header p {
  margin-top: 4px;
  font-size: .95rem;
  opacity: .85;
}

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 1.15rem;
  color: var(--brown);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--cream-dark);
}

/* ── Passphrase Gate ─────────────────────────────────── */
.gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 24px;
}

.gate h2 {
  font-size: 1.3rem;
  color: var(--brown);
  margin-bottom: 8px;
}

.gate p {
  color: var(--text-light);
  margin-bottom: 20px;
  font-size: .95rem;
}

.gate input[type="password"] {
  width: 100%;
  max-width: 320px;
  padding: 12px 16px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius);
  font-size: 1rem;
  text-align: center;
  transition: border-color .2s;
}

.gate input[type="password"]:focus {
  outline: none;
  border-color: var(--gold);
}

.gate .error {
  color: var(--red);
  font-size: .85rem;
  margin-top: 8px;
  min-height: 1.2em;
}

/* ── Form Fields ─────────────────────────────────────── */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Questions ───────────────────────────────────────── */
.question {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--cream-dark);
}

.question:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.question p {
  font-size: .95rem;
  margin-bottom: 8px;
}

.options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.options label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 14px;
  border: 2px solid var(--cream-dark);
  border-radius: 20px;
  font-size: .9rem;
  transition: all .15s;
  user-select: none;
}

.options label:has(input:checked) {
  border-color: var(--brown);
  background: var(--cream-dark);
  font-weight: 600;
}

.options input[type="radio"] {
  accent-color: var(--brown);
  width: 16px;
  height: 16px;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--brown);
  color: var(--cream);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  text-align: center;
}

.btn:hover { background: var(--brown-light); }
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn--gold {
  background: var(--gold);
  color: var(--text);
}

.btn--gold:hover { background: #c49640; }

/* ── Success Screen ──────────────────────────────────── */
.success {
  text-align: center;
  padding: 48px 24px;
}

.success .checkmark {
  font-size: 3rem;
  margin-bottom: 16px;
}

.success h2 {
  border: none;
  padding: 0;
  margin-bottom: 8px;
}

.success p {
  color: var(--text-light);
}

/* ── Results Bars ────────────────────────────────────── */
.result-question {
  margin-bottom: 20px;
}

.result-question p {
  font-size: .93rem;
  margin-bottom: 6px;
  font-weight: 500;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: .85rem;
}

.bar-label {
  width: 70px;
  text-align: right;
  color: var(--text-light);
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 22px;
  background: var(--cream-dark);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

.bar-fill--yes   { background: var(--green); }
.bar-fill--no    { background: var(--red); }
.bar-fill--maybe { background: var(--gold); }

.bar-count {
  width: 28px;
  font-weight: 600;
  flex-shrink: 0;
}

.total-responses {
  text-align: center;
  font-size: .95rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.total-responses strong {
  color: var(--brown);
  font-size: 1.3rem;
}

/* ── Utilities ───────────────────────────────────────── */
.hidden { display: none !important; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-center { text-align: center; }

/* ── Responsive ──────────────────────────────────────── */
@media (min-width: 600px) {
  .container { padding: 32px 24px 64px; }
  .site-header h1 { font-size: 2rem; }
}
