:root {
  --wine-deep: #5C1818;
  --wine: #7B1F1F;
  --wine-soft: #9A3A35;
  --wine-glow: rgba(123, 31, 31, 0.18);
  --cream: #FAF3E7;
  --cream-warm: #F1E5CC;
  --cream-deep: #E8D7B4;
  --gold: #C9A86A;
  --gold-deep: #A88945;
  --ink: #1F1010;
  --ink-soft: #3D2825;
  --ash: #6B5C5A;
  --ash-soft: #94807D;

  --shadow-sm: 0 1px 2px rgba(31, 16, 16, 0.04), 0 2px 6px rgba(31, 16, 16, 0.06);
  --shadow-md: 0 4px 12px rgba(31, 16, 16, 0.08), 0 12px 36px rgba(31, 16, 16, 0.10);
  --shadow-lg: 0 12px 40px rgba(92, 24, 24, 0.18);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-caps: 'Tenor Sans', 'Cormorant SC', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse 70% 50% at 8% 0%, rgba(201, 168, 106, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 95% 100%, rgba(123, 31, 31, 0.10) 0%, transparent 55%),
    linear-gradient(170deg, var(--cream) 0%, var(--cream-warm) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: 'liga', 'kern';
  position: relative;
}

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.42;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.06 0 0 0 0 0.06 0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px;
}

/* Sutil borda envelhecida nas bordas do papel */
.paper-edge {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(to right, rgba(123, 31, 31, 0.08), transparent 80px),
    linear-gradient(to left, rgba(123, 31, 31, 0.08), transparent 80px);
}

.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 56px 28px 80px;
  position: relative;
  z-index: 2;
}

@media (max-width: 540px) {
  .page { padding: 36px 20px 60px; }
}

/* Masthead */
.masthead {
  text-align: center;
  margin-bottom: 32px;
}

.masthead-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--wine) 30%, var(--wine) 70%, transparent);
  opacity: 0.45;
  width: 60%;
  margin: 0 auto;
}

.masthead-rule--top { margin-bottom: 16px; }
.masthead-rule--bottom { margin-top: 16px; }

.masthead-eyebrow {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--wine);
  margin-bottom: 8px;
  font-weight: 400;
}

.masthead-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(38px, 8vw, 52px);
  color: var(--wine-deep);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.masthead-tag {
  font-family: var(--font-caps);
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* Lead */
.lead {
  text-align: center;
  margin-bottom: 36px;
  padding: 0 8px;
}

.lead-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(22px, 5vw, 28px);
  color: var(--ink-soft);
  line-height: 1.3;
  margin-bottom: 14px;
  position: relative;
}

.lead-quote::before,
.lead-quote::after {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--gold-deep);
  margin: 12px auto;
  opacity: 0.6;
}

.lead-body {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 460px;
  margin: 0 auto;
}

.lead-reward {
  color: var(--wine);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px dotted var(--gold-deep);
  padding-bottom: 1px;
}

/* Chapter rail (progress) */
.chapter-rail {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 0 4px;
}

.chapter-label {
  font-family: var(--font-caps);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--wine);
  flex-shrink: 0;
  min-width: 78px;
}

.chapter-track {
  flex: 1;
  height: 1px;
  background: var(--cream-deep);
  position: relative;
  overflow: hidden;
}

.chapter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--wine));
  height: 1px;
  transition: width 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}

.chapter-count {
  font-family: var(--font-caps);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ash);
  flex-shrink: 0;
}

/* Paper card */
.paper {
  background: #FFFEFA;
  border: 1px solid var(--cream-deep);
  box-shadow: var(--shadow-md);
  position: relative;
  border-radius: var(--radius-md);
}

.paper::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201, 168, 106, 0.25);
  border-radius: 4px;
  pointer-events: none;
}

/* Leaves (steps) */
.leaf {
  display: none;
  padding: 36px 32px 32px;
  position: relative;
  z-index: 1;
}

.leaf.active { display: block; animation: turnPage 0.6s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes turnPage {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 540px) {
  .leaf { padding: 28px 22px 24px; }
}

.leaf-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  margin-bottom: 26px;
  align-items: start;
}

.leaf-marker {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 36px;
  color: var(--wine);
  line-height: 1;
  padding-top: 4px;
  letter-spacing: -0.02em;
  border-right: 1px solid var(--cream-deep);
  padding-right: 18px;
  min-width: 56px;
  text-align: center;
}

.leaf-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 5.4vw, 30px);
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.leaf-sub {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* Fields */
.fields {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.field {
  display: block;
  position: relative;
}

.field-label {
  display: block;
  font-family: var(--font-caps);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--wine);
  margin-bottom: 7px;
  font-weight: 400;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--cream-deep);
  padding: 6px 0 10px;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.25s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ash-soft);
  font-style: italic;
  opacity: 0.7;
}

.field-rule {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--wine);
  transition: width 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.field input:focus + .field-rule,
.field input:focus ~ .field-rule { width: 100%; }

.field input:focus,
.field textarea:focus {
  border-bottom-color: var(--wine);
}

.field--note textarea {
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  resize: vertical;
  min-height: 140px;
  background: var(--cream);
  font-style: italic;
}

.field--note textarea:focus {
  border-color: var(--wine);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px var(--wine-glow);
}

/* NPS */
.nps {
  margin: 8px 0 4px;
}

.nps-rail {
  position: relative;
  height: 6px;
  background: var(--cream-warm);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 4px 14px;
}

.nps-rail-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--wine-soft) 50%, var(--wine));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.nps-scale {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
  margin-bottom: 14px;
}

.nps-btn {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 17px;
  height: 48px;
  border: 1px solid var(--cream-deep);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.01em;
}

.nps-btn:hover:not(.selected) {
  border-color: var(--wine);
  color: var(--wine);
  transform: translateY(-2px);
}

.nps-btn.selected {
  background: var(--wine);
  color: var(--cream);
  border-color: var(--wine-deep);
  font-weight: 700;
  transform: translateY(-3px);
  box-shadow: 0 6px 14px var(--wine-glow);
}

@media (max-width: 480px) {
  .nps-btn { font-size: 14px; height: 44px; }
  .nps-scale { gap: 3px; }
}

.nps-anchors {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-caps);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
}

.nps-feedback {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--wine);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  letter-spacing: 0;
  min-height: 18px;
}

/* Menu (radios estilo carta de bistrô) */
.menu {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.menu li + li {
  border-top: 1px dashed var(--cream-deep);
}

.menu-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 16px;
  padding: 16px 6px;
  cursor: pointer;
  align-items: center;
  transition: padding-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.menu-item:hover { padding-left: 12px; }

.menu-item input { position: absolute; opacity: 0; pointer-events: none; }

.menu-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--gold-deep);
  position: relative;
  transition: all 0.22s ease;
  flex-shrink: 0;
}

.menu-mark::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--wine);
  transform: scale(0);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-item input:checked ~ .menu-mark {
  border-color: var(--wine);
  background: var(--cream-warm);
}

.menu-item input:checked ~ .menu-mark::after { transform: scale(1); }

.menu-text {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-display);
  position: relative;
}

.menu-text b {
  font-weight: 600;
  font-size: 19px;
  color: var(--ink);
  font-style: normal;
  letter-spacing: -0.01em;
}

.menu-text em {
  font-style: italic;
  font-weight: 400;
  font-size: 14.5px;
  color: var(--ash);
  flex: 1;
  text-align: right;
  position: relative;
  padding-left: 8px;
}

.menu-text em::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  border-bottom: 1px dotted var(--cream-deep);
  z-index: -1;
}

.menu-item:has(input:checked) .menu-text b { color: var(--wine); }

@media (max-width: 540px) {
  .menu-text { flex-direction: column; gap: 2px; align-items: flex-start; }
  .menu-text em { text-align: left; padding-left: 0; }
  .menu-text em::before { display: none; }
}

/* Buttons */
.btn {
  font-family: var(--font-caps);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 18px 28px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 400;
}

.btn-primary {
  background: var(--wine);
  color: var(--cream);
  box-shadow: 0 4px 16px var(--wine-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: 0;
}

.btn-primary > * { position: relative; z-index: 1; }

.btn-primary:hover:not(:disabled)::before { transform: translateX(0); }
.btn-primary:hover:not(:disabled) { color: var(--wine-deep); box-shadow: 0 6px 22px rgba(201, 168, 106, 0.45); }

.btn-primary:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-arrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0;
  transition: transform 0.3s ease;
}

.btn-primary:hover:not(:disabled) .btn-arrow { transform: translateX(4px); }

.btn-ghost {
  background: transparent;
  color: var(--ash);
  padding: 18px 14px;
}

.btn-ghost:hover { color: var(--wine); }

.btn-final {
  width: 100%;
  padding: 22px 28px;
  font-size: 12.5px;
}

/* Leaf footer */
.leaf-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--cream-deep);
}

.leaf-foot .btn-primary { flex: 1; }

.leaf-foot--single { padding-top: 28px; }
.leaf-foot--single .btn-primary { width: 100%; }

/* Success / Error screens */
.screen {
  display: none;
  text-align: center;
  background: #FFFEFA;
  border: 1px solid var(--cream-deep);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  padding: 56px 32px 48px;
  position: relative;
}

.screen.active { display: block; animation: turnPage 0.7s cubic-bezier(0.16, 1, 0.3, 1); }

.screen::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201, 168, 106, 0.25);
  border-radius: 4px;
  pointer-events: none;
}

.ornament {
  font-family: var(--font-display);
  font-size: 42px;
  color: var(--gold-deep);
  margin-bottom: 16px;
  line-height: 1;
}

.screen-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(30px, 6vw, 38px);
  color: var(--wine-deep);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.screen-text {
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 380px;
  margin: 0 auto 18px;
}

.screen-highlight {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 14px;
}

.highlight-amount {
  color: var(--wine);
  font-weight: 700;
  font-style: normal;
  font-size: 22px;
  border-bottom: 1px solid var(--gold-deep);
  padding: 0 4px;
}

.screen-fineprint {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 32px;
}

.screen .btn { display: inline-flex; min-width: 220px; }

.screen-signoff {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--ash);
  margin-top: 28px;
}

.screen-signoff span {
  font-style: normal;
  font-family: var(--font-caps);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* Colophon */
.colophon {
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.colophon-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cream-deep), transparent);
}

.colophon-text {
  font-family: var(--font-caps);
  font-size: 9.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ash);
  white-space: nowrap;
}

/* Validação */
.field input:invalid:not(:placeholder-shown):not(:focus) {
  border-bottom-color: var(--wine-soft);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
