:root {
  /* Tema do sistema O Instante (terracota) */
  --paper: #F2E9DA;
  --paper-2: #E9DDC8;
  --card: #FAF3E6;
  --ink: #2B2723;
  --ink-soft: #6B6157;
  --gold: #B4543A;
  --gold-deep: #98432C;
  --line: #D9CBB3;
  --ok: #3E7A56;
  --err: #A8402F;
  --radius: 16px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* Tema do evento (Ju): paleta, flor e letras da celebracao, separado do sistema */
body.tema-evento {
  --paper: #FAF7F2;
  --paper-2: #F2EDE4;
  --card: #fff;
  --ink: #2E3136;
  --ink-soft: #5B6068;
  --gold: #B08D57;
  --gold-deep: #8F6F3E;
  --line: #E3DACB;
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; }
/* a Cormorant desenha dígitos "antigos" (1 parece I, 0 parece O): forçar algarismos normais */
h1, h2, h3, .stat b, .brand, .hero .when, .quote { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
a { color: var(--gold-deep); }
.wrap { max-width: 520px; margin: 0 auto; padding: 28px 20px 56px; }
.wrap.wide { max-width: 1100px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }

.hero { padding-top: 24px; }
.hero .lily { width: 92px; margin: 0 auto 8px; display: block; color: var(--gold); }
.eyebrow { letter-spacing: .22em; text-transform: uppercase; font-size: 12px; color: var(--gold-deep); }
.hero h1 { font-size: clamp(38px, 11vw, 54px); margin-top: 10px; }
.hero .when { margin: 6px 0 22px; color: var(--ink-soft); }
.rule { width: 64px; height: 1px; background: var(--gold); margin: 18px auto; border: 0; }
.quote { font-family: var(--serif); font-size: 22px; font-style: italic; color: var(--ink); margin: 18px 4px 28px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; box-shadow: 0 1px 0 rgba(46,49,54,.03);
}
.stack > * + * { margin-top: 14px; }

label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date],
select, textarea {
  width: 100%; padding: 13px 14px; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.row .narrow { flex: 0 0 118px; }

.btn {
  display: inline-block; width: 100%; padding: 15px 20px; font: inherit; font-weight: 600;
  text-align: center; text-decoration: none; cursor: pointer; border-radius: 999px;
  border: 1px solid var(--gold-deep); background: var(--ink); color: var(--paper);
  letter-spacing: .02em;
}
.btn:hover { background: #1f2226; }
.btn.gold { background: var(--gold); border-color: var(--gold-deep); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { width: auto; padding: 8px 16px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }

.notice { font-size: 13.5px; color: var(--ink-soft); background: var(--paper-2); border-radius: 12px; padding: 10px 12px; }
.error { color: var(--err); font-size: 14px; min-height: 1.2em; }
.screen[hidden] { display: none; }

.files { list-style: none; padding: 0; margin: 14px 0 0; max-height: 46vh; overflow: auto; }
.files li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .st { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.files .st.ok { color: var(--ok); }
.files .st.bad { color: var(--err); }
.bar { height: 8px; background: var(--paper-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { margin-top: 4px; }

/* painel */
.topbar { background: var(--ink); color: var(--paper); }
.topbar .in { max-width: 1100px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar .brand { font-family: var(--serif); font-size: 22px; margin-right: auto; }
.topbar a { color: var(--paper); text-decoration: none; opacity: .85; font-size: 15px; }
.topbar a.on, .topbar a:hover { opacity: 1; border-bottom: 1px solid var(--gold); }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat b { display: block; font-family: var(--sans); font-weight: 600; font-size: 34px; color: var(--gold-deep); line-height: 1.1; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; position: relative; background: var(--paper-2); border-radius: 12px; overflow: hidden; aspect-ratio: 1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.gallery .vid { display: grid; place-items: center; height: 100%; font-size: 13px; color: var(--ink-soft); }
.gallery .pick { position: absolute; top: 6px; left: 6px; z-index: 2; background: rgba(255,255,255,.88); border-radius: 8px; padding: 4px 6px; line-height: 0; }
.gallery .pick input { width: 18px; height: 18px; margin: 0; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(20,22,25,.92); display: grid; place-items: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 10px; }
.lightbox .lb-close { position: absolute; top: 12px; right: 16px; background: none; border: 0; color: #fff; font-size: 38px; cursor: pointer; line-height: 1; }
.lightbox .lb-bar { margin-top: 14px; color: #fff; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; font-size: 14px; }
.brandline { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center;
  font-size: 12.5px; letter-spacing: .06em; color: var(--ink-soft); }
.brandline .mark { font-family: var(--serif); font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-deep); }
.brandline .dot { margin: 0 6px; opacity: .6; }
.brandline a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.how { list-style: none; padding: 0; margin: 4px 0 8px; }
.how li { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; }
.how li span { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-deep);
  display: grid; place-items: center; font-size: 13px; font-weight: 600; margin-top: 1px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters select { width: auto; min-width: 190px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.qr-card { text-align: center; }
.qr-card img { width: 210px; max-width: 100%; }
.qr-card .url { word-break: break-all; font-size: 12px; color: var(--ink-soft); }
.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 99px; background: var(--paper-2); color: var(--ink-soft); }
.tag.off { background: #f3dcd6; color: var(--err); }
/* ---------- celular: nada cortado, letras legíveis, botões fáceis de tocar ---------- */
.row { flex-wrap: wrap; }
input[type=file] { max-width: 100%; min-width: 0; }
img, svg, video, audio, canvas { max-width: 100%; }
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  input, select, textarea { font-size: 16px !important; }          /* evita o zoom automático do iPhone */
  .btn { min-height: 46px; }
  .btn.small { min-height: 40px; padding: 9px 16px; }
  .topbar .in { gap: 4px 14px; padding: 8px 14px; }
  .topbar .brand { flex: 1 0 100%; margin: 0 0 2px; }
  .topbar a { display: inline-block; padding: 9px 4px; min-height: 40px; font-size: 15px; }
  th { font-size: 13px; }
  .brandline, .notice, .tip { font-size: 13.5px; }
  .wrap.wide { padding-left: 14px; padding-right: 14px; }
  .filters select { min-width: 0; width: 100%; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .row .narrow { flex: 0 0 104px; }
}
.searchbox { display: flex; gap: 6px; margin-left: auto; }
.searchbox input { padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1);
                   color: #fff; width: 150px; font: inherit; font-size: 14px; }
.searchbox input::placeholder { color: rgba(255,255,255,.6); }
.searchbox button { background: transparent; border: 0; color: #fff; cursor: pointer; font-size: 18px; padding: 0 4px; }
@media (max-width: 640px) { .searchbox { flex: 1 0 100%; margin: 4px 0 0; } .searchbox input { flex: 1; width: auto; } }
.result { display: block; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line);
          border-radius: 14px; padding: 14px 16px; margin-top: 10px; }
.result:hover { border-color: var(--gold); }
.result b { font-family: var(--serif); font-size: 20px; }
@media print {
  .topbar, .no-print { display: none !important; }
  .qr-card { break-inside: avoid; page-break-inside: avoid; border: 1px solid #999; }
}

.mark { display: block; margin: 0 auto 10px; color: var(--gold); }
.slogan { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink-soft); margin: 10px 0 0; }

/* Identidade do evento na página de envio: logo e flor do cartão de mesa */
.evt-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.evt-bg img { position: absolute; height: auto; max-width: none; }
body.tema-evento main#app { position: relative; z-index: 1; }
.evt-logo { text-align: center; margin: 0 auto 8px; }
.evt-logo img { display: block; margin: 0 auto; width: auto; height: auto; max-width: min(80vw, 360px); }

/* ---------- letras maiores (público 45+): só na tela, para não mexer na impressão dos cartões ---------- */
@media screen {
  body { font-size: 20px; line-height: 1.6; }
  .small { font-size: 17px; }
  label { font-size: 17.5px; }
  .eyebrow { font-size: 15px; }
  .notice, .tip, .brandline { font-size: 16.5px; }
  .error { font-size: 17px; }
  .files li, .check { font-size: 17.5px; }
  .btn { font-size: 19px; }
  .btn.small { font-size: 17.5px; padding: 10px 18px; }
  .topbar a { font-size: 17.5px; }
  .topbar .brand { font-size: 24px; }
  table { font-size: 17.5px; }
  th { font-size: 14.5px; }
  .tag { font-size: 14.5px; }
  .qr-card .url { font-size: 14px; }
  .gallery figcaption { font-size: 14px; }
  .lightbox .lb-bar { font-size: 17px; }
  input, select, textarea { font-size: 18px !important; }
  /* textos pequenos escritos direto nas páginas */
  [style*="font-size:11px"], [style*="font-size:12px"], [style*="font-size:13px"],
  [style*="font-size:14px"], [style*="font-size:15px"], [style*="font-size: 12px"], [style*="font-size: 13px"] { font-size: 17px !important; }
}
@media (max-width: 640px) {
  body { font-size: 20px; }
  .topbar a { font-size: 17.5px; }
  .brandline, .notice, .tip { font-size: 16.5px; }
  th { font-size: 14.5px; }
}

/* ---------- admin: blocos separados (cada evento e cada pessoa tem o seu quadro) ---------- */
.help-top { max-width: 760px; }
.blk { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 18px 18px 16px; margin: 0 0 22px; box-shadow: 0 2px 0 rgba(46,49,54,.04); }
.blk:nth-of-type(even) { background: #FCFAF5; }
.blk-h { border-bottom: 2px solid var(--paper-2); margin-bottom: 14px; padding-bottom: 10px; }
.blk-h h3 { margin: 0 0 4px; font-size: 28px; line-height: 1.2; }
.blk .nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 4px 0 14px; }
.blk .nums div { background: var(--paper-2); border-radius: 12px; padding: 10px 12px; text-align: center; }
.blk .nums b { display: block; font-size: 26px; line-height: 1.15; color: var(--gold-deep); }
.blk .nums span { font-size: 15px; color: var(--ink-soft); }
.blk .nums .bad b { color: var(--err); }
.blk .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.blk .help { font-size: 16.5px; color: var(--ink-soft); line-height: 1.5; margin: 6px 0 10px; }
.blk .red, .grp.warn .red { color: var(--err); }
.blk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 12px; }
.grp { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; background: rgba(255,255,255,.6); }
.grp h4 { margin: 0 0 4px; font-size: 20px; font-family: var(--sans); font-weight: 700; }
.grp.warn { border-color: #d9a193; background: #fdf3ef; }
.grp form > * + * { margin-top: 8px; }
.grp .btn.small { margin-top: 6px; }
.phone-row { display: flex; gap: 8px; }
.phone-row select { flex: 0 0 auto; width: auto; max-width: 48%; }
.phone-row input { flex: 1; min-width: 0; }
.newuser { background: #fffaf0 !important; border-style: dashed; }
.ucard .blk-h h3 { font-size: 26px; }
@media (max-width: 640px) {
  .blk { padding: 14px 12px; }
  .blk .nums { grid-template-columns: repeat(2, 1fr); }
  .blk-grid { grid-template-columns: 1fr; }
  .blk .acts .btn { flex: 1 1 100%; }
}

/* ---------- faixa de contexto: onde estou e como entrei ---------- */
.ctx-ribbon { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 9px 16px; font-size: 17px; line-height: 1.3; }
.ctx-ribbon .ctx-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.ctx-ribbon .ctx-sub { opacity: .85; font-size: 15.5px; }
.ctx-ribbon a { margin-left: auto; color: inherit; text-decoration: underline; font-weight: 600; }
.ctx-ribbon.admin { background: #23262b; color: #f3e6c9; }
.ctx-ribbon.admin .ctx-dot { background: #d9b46a; }
.ctx-ribbon.user { background: #B08D57; color: #fff; }
.ctx-ribbon.user .ctx-dot { background: #fff; }
.ctx-ribbon.via { background: #4b3a72; color: #fff; }
.ctx-ribbon.via .ctx-dot { background: #d9b46a; }
.space-chip { display: inline-block; font-size: 15px; font-weight: 700; padding: 3px 12px; border-radius: 999px; border: 1.5px solid var(--gold, #B08D57); color: var(--gold-deep, #8a6a37); background: #fff8ea; white-space: nowrap; vertical-align: middle; }
.space-chip.mine { background: #B08D57; color: #fff; border-color: #98743f; }

/* ---------- janelinhas redondas: capa do álbum, foto de perfil, logo ---------- */
.cv { display: inline-grid; place-items: center; width: var(--s, 56px); height: var(--s, 56px); border-radius: 50%; overflow: hidden; position: relative;
      flex: 0 0 auto; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); background: #fff; vertical-align: middle; }
.cv img { width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; }
.cv.mono { background: hsl(var(--h, 35) 45% 86%); color: hsl(var(--h, 35) 40% 27%); font-weight: 700; font-size: calc(var(--s, 56px) * .38); letter-spacing: .02em; }
.cv.lock { background: var(--paper-2); font-size: calc(var(--s, 56px) * .46); }
.cv.lockav i { position: absolute; right: -2px; bottom: -2px; font-style: normal; font-size: calc(var(--s, 56px) * .34); background: #fff; border-radius: 50%; padding: 1px; line-height: 1; }
.album-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.album-row:first-of-type { border-top: 0; }
.album-row .t { flex: 1; min-width: 0; }
.album-row .t strong { display: block; line-height: 1.25; }
.kind-tag { display: inline-block; font-size: 14.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin-top: 3px; }
.kind-tag.fest { background: #f6e3dc; color: #8c3f2a; }
.kind-tag.priv { background: #e4eaf3; color: #34527a; }
.who { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 6px; }
.who h1 { margin: 0; }
.thx-box { margin-top: 18px; max-width: 520px; margin-left: auto; margin-right: auto; text-align: center; }
.thx-box input, .thx-box textarea { width: 100%; margin-top: 8px; padding: 12px; border-radius: 12px; border: 1px solid #d9cbb3; font: inherit; background: #fff; color: #2b2723; }
.thx-box .row { justify-content: center; }

/* ---------- resumo de confirmações (quem vai) ---------- */
.rsvp-box { margin-bottom: 16px; border-color: var(--gold); }
.rsvp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rsvp-grid div { background: var(--paper-2); border-radius: 14px; padding: 12px 8px; text-align: center; }
.rsvp-grid b { display: block; font-size: 36px; line-height: 1.1; color: var(--ink); }
.rsvp-grid span { font-size: 16px; color: var(--ink-soft); }
.rsvp-grid .ok b { color: var(--ok); }
.rsvp-grid .no b { color: var(--err); }
@media (max-width: 640px) { .rsvp-grid { grid-template-columns: repeat(2, 1fr); } }

/* links usados como caixa (ex.: lista de presentes): sem isto o navegador os trata como texto em linha e as caixas se sobrepõem */
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover, a.card:focus-visible { border-color: var(--gold); }
a.card + a.card { margin-top: 14px; }
