@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Mulish'; src: url('/fonts/mulish-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Mulish'; src: url('/fonts/mulish-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Mulish'; src: url('/fonts/mulish-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --wine: #6E142D;
  --wine-deep: #520E21;
  --gold: #B8964F;
  --gold-text: #7D6020;
  --gold-soft: #D9BE82;
  --champagne: #F0E3CC;
  --beige: #F5ECDD;
  --offwhite: #FBF7F0;
  --brown: #3B2A20;
  --brown-soft: #6B5647;
  --line: #E3D5BE;
  --danger: #8E1F2B;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Mulish', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 10px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--offwhite);
  color: var(--brown);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
main:focus { outline: none; }
[hidden] { display: none !important; }
a { color: var(--wine); text-underline-offset: 3px; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; color: var(--wine); text-wrap: balance; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; border-radius: 4px; }

.view { animation: fade .45s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slide-next { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes slide-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

/* Base */
.brand { text-align: center; margin-bottom: 28px; }
.brand-mark { font: 600 12px/1.5 var(--sans); letter-spacing: .24em; margin-right: -.24em; text-transform: uppercase; color: var(--gold-text); }
.eyebrow { font: 600 12px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text); margin: 0 0 14px; }
.title { font-size: 38px; margin-bottom: 12px; }
.lead { color: var(--brown-soft); font-size: 18px; }
.center { text-align: center; }
.rule { width: 56px; height: 1px; background: var(--gold); margin: 26px auto; }
.narrow { max-width: 540px; margin: 0 auto; padding: 36px var(--gutter) 48px; }
.notice { background: var(--champagne); padding: 12px 16px; border-radius: var(--radius); text-align: center; }
.noscript { padding: 40px var(--gutter); text-align: center; }
.draft { background: var(--beige); border: 1px dashed var(--gold); color: var(--brown); border-radius: 8px; font-size: 13px; line-height: 1.4; padding: 8px 12px; margin: 0 0 20px; text-align: center; }
.foot { text-align: center; margin-top: 36px; font-size: 14px; }
.foot a { color: var(--brown-soft); }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none;
  min-height: 52px; padding: 12px 24px; border-radius: 8px; border: 1px solid transparent;
  font: 700 14px/1.3 var(--sans); letter-spacing: .06em; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s, opacity .2s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-wide { width: 100%; }
.btn-primary { background: var(--wine); color: var(--offwhite); box-shadow: inset 0 0 0 1px rgba(217, 190, 130, .35); }
.btn-primary:hover:not(:disabled) { background: var(--wine-deep); }
.btn-outline { background: transparent; color: var(--wine); border-color: var(--wine); }
.btn-outline:hover { background: var(--beige); }
.btn-quiet { background: transparent; color: var(--brown-soft); font-weight: 600; letter-spacing: .02em; }
.btn-quiet:hover:not(:disabled) { color: var(--wine); }
.btn-danger { background: var(--danger); color: #fff; }

/* Apresentação */
.landing { max-width: 600px; margin: 0 auto; padding: 44px var(--gutter) 40px; text-align: center; }
.landing-title { font-size: clamp(42px, 12vw, 64px); line-height: 1.05; margin-bottom: 18px; }
.year { display: block; font-style: italic; color: var(--gold-text); }
.subtitle { font: italic 500 22px/1.35 var(--serif); color: var(--brown); margin: 0 auto; max-width: 28em; }
.welcome { text-align: left; margin-bottom: 30px; }
.welcome p:last-child { font: italic 500 21px/1.4 var(--serif); color: var(--wine); margin: 22px 0 0; padding-left: 16px; border-left: 2px solid var(--gold); }

/* Formulário */
.form { margin-top: 24px; }
.field { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 8px; padding: 0; line-height: 1.4; }
input[type=text], input[type=email], select {
  width: 100%; min-height: 52px; padding: 12px 14px; font: inherit; color: var(--brown);
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
input[type=text]:focus, input[type=email]:focus, select:focus { border-color: var(--wine); outline: 1px solid var(--wine); }
[aria-invalid=true] { border-color: var(--danger) !important; }
.why { color: var(--brown-soft); font-size: 14px; line-height: 1.5; margin: 8px 0 0; }
.field-error, .form-error { color: var(--danger); font-size: 14px; font-weight: 600; margin: 8px 0 0; }
.form-error { margin: 0 0 16px; }
.choices { display: grid; gap: 8px; }
.field .choice, .check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.field .choice { padding: 13px 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin: 0; transition: border-color .2s, background-color .2s; }
.choice:has(input:checked) { border-color: var(--wine); background: var(--beige); }
input[type=radio], input[type=checkbox] { accent-color: var(--wine); width: 20px; height: 20px; flex: none; margin: 2px 0 0; }
.consents { border-top: 1px solid var(--line); padding-top: 22px; margin-bottom: 16px; }
.check { font-size: 15px; line-height: 1.5; margin-bottom: 14px; }
.check em { color: var(--brown-soft); font-style: normal; }
.optional { background: var(--beige); border-radius: var(--radius); padding: 4px 16px; margin-bottom: 24px; font-size: 15px; }
.optional summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
.optional .check { margin-top: 14px; }
.optional-block { margin-bottom: 14px; }
.form .btn-quiet { margin-top: 6px; }

/* Questionário */
.quiz { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter) 112px; min-height: 100dvh; }
.quiz-head { position: sticky; top: 0; z-index: 3; background: var(--offwhite); padding: 16px 0 12px; margin-bottom: 8px; }
.quiz-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.progress-label { font-weight: 700; font-size: 14px; color: var(--wine); }
.progress-count { font-size: 13px; color: var(--brown-soft); }
.progress { height: 5px; background: var(--champagne); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--wine), #8E2B46); border-radius: 3px; transition: width .4s cubic-bezier(.2, .7, .3, 1); }
.quiz-body.slide-next { animation: slide-next .36s ease both; }
.quiz-body.slide-back { animation: slide-back .36s ease both; }
.quiz .draft { margin: 4px 0 0; }
.pause { font: italic 500 20px/1.35 var(--serif); color: var(--gold-text); margin: 18px 0 0; }
.question { border: 0; padding: 0; margin: 0; min-width: 0; }
.question-text { font: 500 27px/1.22 var(--serif); color: var(--wine); padding: 0; margin: 20px 0 20px; display: block; }
.options { display: grid; gap: 10px; }
.option {
  position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 15px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  box-shadow: 0 1px 2px rgba(59, 42, 32, .04);
  transition: border-color .2s, background-color .2s, box-shadow .2s, transform .15s;
}
.option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.option-letter {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--gold); color: var(--gold-text); font: 600 18px/1 var(--serif); transition: background-color .2s, color .2s;
}
.option-text { line-height: 1.45; font-size: 16px; }
@media (hover: hover) { .option:hover { border-color: var(--gold); } }
.option:has(input:checked) { border-color: var(--wine); background: var(--beige); box-shadow: inset 0 0 0 1px var(--wine); }
.option:has(input:checked) .option-letter { background: var(--wine); border-color: var(--wine); color: var(--offwhite); }
.option:has(input:focus-visible) { outline: 2px solid var(--wine); outline-offset: 2px; }
.quiz-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  padding: 10px max(var(--gutter), calc(50vw - 300px)) calc(10px + env(safe-area-inset-bottom));
  background: rgba(251, 247, 240, .96); border-top: 1px solid var(--line);
}

/* Conclusão e revelação */
.complete-mark { font: 500 54px/1 var(--serif); color: var(--gold-text); margin: 28px 0 18px; }
.conclude .btn-quiet { margin-top: 8px; }
.revealing { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 30px; padding: 32px; text-align: center; background: var(--wine); color: var(--offwhite); }
.revealing p { font: italic 500 26px/1.35 var(--serif); max-width: 22em; margin: 0; animation: fade 1s .2s ease both; }
.revealing-ring { width: 64px; height: 64px; border: 1px solid rgba(217, 190, 130, .35); border-top-color: var(--gold-soft); border-radius: 50%; animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Resultado */
.result { max-width: 680px; margin: 0 auto; padding-bottom: 40px; }
.cover { background: var(--wine); color: var(--offwhite); padding: 44px var(--gutter) 40px; text-align: center; }
.cover .brand-mark { color: var(--gold-soft); display: block; margin-bottom: 28px; }
.cover .eyebrow { color: var(--gold-soft); margin-bottom: 12px; }
.cover h1 { color: var(--offwhite); font-size: clamp(42px, 11vw, 58px); }
.cover .shared-title { font-size: clamp(34px, 9vw, 46px); }
.cover-line { font: italic 500 20px/1.35 var(--serif); margin: 14px 0 0; color: var(--champagne); }
.result > .draft { margin: 16px var(--gutter) 0; }
.r-section { padding: 36px var(--gutter) 8px; }
.r-number { font: 500 16px/1 var(--serif); color: var(--gold-text); margin: 0 0 8px; letter-spacing: .08em; }
.r-title { font-size: 32px; margin-bottom: 18px; }
.r-headline { font: italic 500 26px/1.25 var(--serif); color: var(--brown); margin-bottom: 16px; }
.map-note { color: var(--brown-soft); font-size: 15px; }
.map { list-style: none; padding: 0; margin: 20px 0 16px; display: grid; gap: 22px; }
.map-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; margin-bottom: 8px; line-height: 1.35; }
.map-name { font-weight: 600; font-size: 15px; }
.map-value { font-size: 14px; color: var(--brown-soft); white-space: nowrap; }
.map-value strong { color: var(--wine); font-size: 17px; }
.map-track { display: block; height: 10px; background: var(--champagne); border-radius: 5px; overflow: hidden; }
.map-bar { display: block; height: 100%; width: var(--w); background: var(--wine); border-radius: 5px; animation: grow 1s .25s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes grow { from { width: 0; } }
.r-highlight { background: var(--beige); margin-top: 36px; padding-bottom: 24px; border-top: 1px solid var(--gold-soft); border-bottom: 1px solid var(--gold-soft); }
.r-final { background: var(--wine); color: var(--offwhite); padding: 44px var(--gutter) 34px; margin-top: 40px; }
.r-final h2 { color: var(--gold-soft); font: 600 13px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; margin-bottom: 20px; }
.r-final p { font: 500 23px/1.42 var(--serif); }
.r-final p:first-of-type { font-size: 29px; line-height: 1.25; color: #fff; }
.r-final p:last-child { color: var(--gold-soft); font-style: italic; margin-bottom: 0; }
.method { font-size: 13.5px; line-height: 1.55; color: var(--brown-soft); padding: 24px var(--gutter) 0; margin: 0; }
.actions { padding: 32px var(--gutter) 0; display: grid; gap: 14px; }
.actions-title { font-size: 28px; }
.share-box { display: grid; gap: 10px; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.private-link { background: var(--beige); padding: 16px; border-radius: var(--radius); }
.private-link h3 { font-size: 22px; }
.private-link .btn { margin-top: 12px; }
.action-status { color: var(--wine); font-size: 14px; font-weight: 600; margin: 0; min-height: 1.4em; }
.privacy { margin: 18px var(--gutter) 0; border-top: 1px solid var(--line); padding-top: 12px; font-size: 15px; }
.privacy summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.privacy .why { margin-bottom: 8px; }
/* Ranking das alternativas */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rank-help { font-size: 14.5px; color: var(--brown-soft); margin: 0 0 12px; line-height: 1.5; }
.rank-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rank-card { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; }
.rank-badge { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px dashed var(--gold); color: var(--gold-text); font: 600 17px/1 var(--serif); }
.rank-card.is-ranked { border-color: var(--wine); background: var(--beige); }
.rank-card.is-ranked .rank-badge { background: var(--wine); border: 0; color: var(--offwhite); }
.rank-card.is-dragging { box-shadow: 0 8px 24px rgba(59, 42, 32, .18); transform: scale(1.01); z-index: 2; }
.rank-pick { all: unset; cursor: pointer; padding: 6px 0; line-height: 1.45; font-size: 16px; color: var(--brown); }
.rank-pick:disabled { cursor: default; }
.rank-pick:focus-visible { outline: 2px solid var(--wine); outline-offset: 4px; border-radius: 4px; }
.rank-tools { display: flex; flex-direction: column; gap: 4px; }
.rank-tools button { width: 38px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--wine); font: 600 17px/1 var(--sans); cursor: pointer; }
.rank-tools button:disabled { opacity: .3; cursor: default; }
.rank-grip { cursor: grab; touch-action: none; user-select: none; }
.rank-grip:active { cursor: grabbing; }
.rank-reset { min-height: 40px; padding: 8px 0; margin-top: 4px; font-size: 13px; }
@media (min-width: 720px) { .rank-pick { font-size: 17px; } }
.year-title { font: 500 34px/1.15 var(--serif); color: var(--wine); margin: 4px 0 14px; text-wrap: balance; }
.r-map { padding-top: 18px; }
.r-subtitle { font-size: 24px; margin-bottom: 6px; }
.conquests { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
.conquests li { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 8px; padding: 14px 16px; display: grid; gap: 6px; }
.conquests strong { color: var(--brown); font-weight: 700; line-height: 1.45; }
.conquests span { color: var(--brown-soft); font-size: 15.5px; line-height: 1.55; }
.directions { margin: 14px 0 0; padding-left: 0; list-style: none; counter-reset: dir; display: grid; gap: 14px; }
.directions li { counter-increment: dir; position: relative; padding-left: 40px; }
.directions li::before { content: counter(dir); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--wine); color: var(--offwhite); font: 600 16px/1 var(--serif); }
.r-final .phrase { font: italic 500 30px/1.3 var(--serif); color: #fff; margin: 0; }
.attempt-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px var(--gutter); }
.private-link .confirm-delete { border-color: var(--wine); }
.landing .btn-quiet { margin-top: 8px; }
.confirm-delete { background: #fff; border: 1px solid var(--danger); border-radius: var(--radius); padding: 14px; margin-top: 8px; }

@media (min-width: 720px) {
  :root { --gutter: 40px; }
  body { font-size: 18px; }
  .narrow, .landing { padding-top: 72px; }
  .question-text { font-size: 33px; margin-top: 28px; }
  .option { padding: 17px 20px; }
  .option-text { font-size: 17px; }
  .result { padding-top: 40px; }
  .cover { border-radius: 14px 14px 0 0; padding-top: 60px; padding-bottom: 54px; }
  .r-title { font-size: 36px; }
  .r-final { border-radius: 0 0 14px 14px; }
  .actions .btn-wide { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* Impressão e PDF */
@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; font-size: 11.5pt; line-height: 1.5; }
  .no-print, .foot, .draft { display: none !important; }
  .view, .map-bar { animation: none !important; }
  .result { max-width: none; padding: 0; }
  .cover, .r-final, .r-highlight, .map-bar, .map-track { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cover { border-radius: 0; padding: 24pt; }
  .r-section { padding: 16pt 0 0; }
  .r-highlight { padding: 14pt; margin-top: 16pt; }
  .r-final { border-radius: 0; padding: 20pt; margin-top: 16pt; }
  .r-final p { font-size: 15pt; }
  .r-final p:first-of-type { font-size: 19pt; }
  .method { padding: 12pt 0 0; font-size: 9pt; }
  h2, h3 { break-after: avoid; }
  p, .map-row, .r-final { break-inside: avoid; }
}
