/* Paleta de álbum de formatura: azul-marinho, dourado e papel envelhecido. */
:root {
  --navy: #14284b;
  --navy-2: #1f3a66;
  --gold: #c9a227;
  --gold-soft: #f4e7bd;
  --paper: #f7f3ea;
  --card: #ffffff;
  --ink: #1d2433;
  --muted: #5d6578;
  --line: #e3ddcf;
  --ok: #2e7d4f;
  --danger: #b3261e;
  --radius: 16px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  background-image: radial-gradient(circle at 50% -20%, #e9e1cc 0, transparent 60%);
  min-height: 100vh;
}
body.with-bars { padding-top: 76px; padding-bottom: 104px; }

h1, h2 { font-family: var(--serif); color: var(--navy); line-height: 1.25; }
h1 { font-size: 1.65em; margin: .2em 0 .5em; }
h2 { font-size: 1.2em; margin: 0 0 .6em; }
a { color: var(--navy-2); }
p { margin: 0 0 .9em; }

.wrap { max-width: 680px; margin: 0 auto; padding: 20px 18px 40px; }
.enter { animation: enter .35s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 22px;
  margin: 16px 0;
  box-shadow: 0 1px 2px rgba(20, 40, 75, .06), 0 8px 24px rgba(20, 40, 75, .07);
}

.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72em; font-weight: 700; color: var(--gold); margin: 0; }
.lead { font-size: 1.08em; color: var(--ink); }
.muted, .hint { color: var(--muted); font-size: .88em; }
.fineprint { text-align: center; color: var(--muted); font-size: .82em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- barras fixas ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 10; background: var(--navy); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.topbar-inner { max-width: 680px; margin: 0 auto; padding: 14px 18px 12px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.topbar-step { font-weight: 600; font-size: .85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-save { font-size: .75em; color: var(--gold-soft); white-space: nowrap; }
.progress { height: 6px; background: rgba(255,255,255,.15); }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #e8c75a); transition: width .4s ease; }

.bottombar {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  background: rgba(247, 243, 234, .94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottombar-inner { max-width: 680px; margin: 0 auto; padding: 14px 18px; display: flex; justify-content: space-between; gap: 12px; }
.bottombar-inner .btn-primary { flex: 1; max-width: 360px; margin-left: auto; }

/* ---------- botões ---------- */
.btn {
  font: inherit; font-weight: 700; font-size: .95em;
  min-height: 54px; padding: 12px 22px;
  border-radius: 12px; border: 0; cursor: pointer;
  transition: transform .1s, background .2s, box-shadow .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 4px 14px rgba(20, 40, 75, .25); }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; color: var(--navy); border: 2px solid var(--line); }
.btn-link { background: none; border: 0; color: var(--navy-2); font: inherit; font-size: .9em; text-decoration: underline; cursor: pointer; padding: 10px 0; min-height: 44px; }
.btn-big { width: 100%; margin-top: 18px; font-size: 1.05em; min-height: 60px; }

/* ---------- campos ---------- */
.label { display: block; font-weight: 700; margin: 22px 0 8px; color: var(--navy); }
input[type=text], input[type=password], textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 14px 16px; border: 2px solid var(--line); border-radius: 12px; background: #fffdf8;
  transition: border-color .2s, box-shadow .2s;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 162, 39, .18); }
textarea { resize: vertical; min-height: 110px; }
.shake { animation: shake .4s; border-color: var(--danger) !important; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- boas-vindas ---------- */
.welcome { text-align: center; padding-top: 18px; }
.welcome .card { text-align: left; }
.emblem {
  width: 118px; height: 118px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, var(--navy-2), var(--navy));
  border: 4px solid var(--gold);
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 8px var(--gold), 0 12px 30px rgba(20, 40, 75, .3);
  color: var(--gold-soft);
}
.emblem span { font-family: var(--serif); font-size: 2.6em; font-weight: 700; line-height: 1; }
.emblem small { text-transform: uppercase; letter-spacing: .2em; font-size: .62em; }
.emblem-done { background: radial-gradient(circle at 35% 30%, #3c9a64, var(--ok)); }

/* ---------- abertura de etapa ---------- */
.intro { text-align: center; padding: 8vh 6px 0; }
.intro-icon {
  font-size: 3.2em; width: 1.9em; height: 1.9em; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--card); border: 3px solid var(--gold-soft);
  box-shadow: 0 8px 24px rgba(20, 40, 75, .1);
}
.intro h1 { font-size: 2em; }

/* ---------- pergunta ---------- */
.question { font-size: 1.4em; margin-top: .35em; }
.help { color: var(--muted); }
.example {
  background: var(--gold-soft); border-left: 5px solid var(--gold);
  border-radius: 10px; padding: 14px 16px; margin: 6px 0 22px;
  font-size: .92em; color: #4a3f1c;
}
.example strong { display: block; margin-bottom: 4px; color: #6b5512; }
.example p { margin: 0 0 .4em; font-style: italic; }
.example p:last-child { margin-bottom: 0; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border: 2px solid var(--line); border-radius: 14px; background: #fffdf8;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.option:hover { border-color: #cfc5ad; }
.option.selected { border-color: var(--gold); background: #fffaeb; box-shadow: 0 0 0 3px rgba(201, 162, 39, .15); }
.option:focus-within { box-shadow: 0 0 0 4px rgba(201, 162, 39, .35); }
.option-mark {
  flex: none; width: 28px; height: 28px; margin-top: 1px;
  border: 2px solid #b9b09a; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
input[type=checkbox] + .option-mark { border-radius: 8px; }
.option.selected .option-mark { background: var(--gold); border-color: var(--gold); }
.option.selected .option-mark::after { content: "✓"; color: #fff; font-weight: 900; font-size: .85em; }
.option-body { display: flex; flex-direction: column; gap: 3px; }
.option-title { font-weight: 600; }
.option-desc { color: var(--muted); font-size: .88em; }
.option-naosei { border-style: dashed; background: transparent; }
.option-naosei .option-title { font-weight: 500; color: var(--muted); }
.tag {
  display: inline-block; margin-left: 8px; padding: 1px 9px; vertical-align: 2px;
  border-radius: 999px; background: var(--navy); color: var(--gold-soft);
  font-size: .68em; font-weight: 700; letter-spacing: .03em; white-space: nowrap;
}
.comment { margin-top: 14px; }

/* ---------- revisão ---------- */
.review-section h2 { padding-bottom: 8px; border-bottom: 2px solid var(--gold-soft); }
.review-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
  width: 100%; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 14px 4px; cursor: pointer;
}
.review-item:last-child { border-bottom: 0; }
.review-item:hover { background: #fffaeb; }
.review-q { grid-column: 1; font-size: .85em; color: var(--muted); }
.review-a { grid-column: 1; font-weight: 600; white-space: pre-line; }
.review-c { grid-column: 1; font-size: .88em; color: var(--ink); }
.review-a.vazia { color: #a8a08c; font-weight: 400; font-style: italic; }
.review-edit { grid-column: 2; grid-row: 1 / span 3; align-self: center; font-size: .8em; font-weight: 700; color: var(--navy-2); }
.erro { color: var(--danger); font-weight: 700; }

/* ---------- painel admin ---------- */
.admin .wrap { max-width: 860px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; }
.admin table { width: 100%; border-collapse: collapse; font-size: .9em; }
.admin td, .admin th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78em; font-weight: 700; }
.badge-enviado { background: #dcefe3; color: var(--ok); }
.badge-rascunho { background: var(--gold-soft); color: #6b5512; }
.q-admin { font-weight: 700; margin: 18px 0 6px; font-size: .92em; }
.resposta { white-space: pre-wrap; background: var(--paper); padding: 10px 14px; border-radius: 10px; }
.resposta.vazia { color: #a8a08c; font-style: italic; }

@media (max-width: 420px) {
  body { font-size: 18px; }
  .card { padding: 22px 16px; }
  .question { font-size: 1.28em; }
  .btn { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .enter, .shake { animation: none; }
  .progress-fill { transition: none; }
}
