/*
 * Base comum do site, da conta do hóspede e do painel.
 *
 * Linguagem: papel creme, tinta verde-escura, oliva da logo para estrutura,
 * terracota (a telha das casas) só para ação, amarelo da flor só como sinal.
 * Separação por filete e por valor, quase nunca por sombra. Cantos retos.
 */

@font-face {
  font-family: 'Young Serif';
  src: url('../fontes/young-serif.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('../fontes/figtree.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('../fontes/figtree-italico.woff2') format('woff2');
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --papel: #f5f0e5;
  --papel-2: #ece5d4;
  --papel-3: #e2d9c4;
  --folha: #fffdf8;
  --tinta: #1f2a1e;
  --tinta-2: #4b5145;
  --tinta-3: #5d6155;   /* 5:1 sobre papel-2; 4,5:1 até sobre papel-3 */
  --linha: rgba(31, 42, 30, .16);
  --linha-forte: rgba(31, 42, 30, .32);
  --oliva: #5b6921;
  --oliva-claro: #afbc75;
  --oliva-fundo: #e6e8cf;
  --flor: #f2c230;
  --flor-fundo: #f8e7b0;
  --telha: #a94b25;
  --telha-escura: #8a3b1b;
  --telha-fundo: #f3dccf;
  --verde-ok: #2f6b3a;
  --verde-ok-fundo: #dcebd8;
  --verde-ok-texto: #1f4a28;
  --perigo: #a1271c;
  --perigo-fundo: #f6d9d4;
  --perigo-texto: #6e1a12;
  --flor-texto: #5a4304;
  --flor-borda: #c9971b;
  --oliva-texto: #39421a;
  --serra: #2b3a33;

  --serifa: 'Young Serif', 'Georgia', serif;
  --texto: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  --titulo: var(--serifa);   /* fonte dos títulos e números grandes; o painel troca pela sans dele */

  --raio: 3px;
  --raio-2: 6px;
  --rapido: 140ms;
  --medio: 260ms;
  --curva: cubic-bezier(.2, .7, .2, 1);
  --sombra-flutuante: 0 18px 40px -18px rgba(31, 42, 30, .45), 0 2px 6px rgba(31, 42, 30, .08);
  --largura: 1240px;
  --margem: clamp(18px, 4vw, 48px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
p, li, dd, figcaption { text-wrap: pretty; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font: 400 1rem/1.55 var(--texto);
  font-feature-settings: 'tnum' 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.12; text-wrap: balance; }
p { margin: 0; }
a { color: var(--telha-escura); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--telha); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--telha); outline-offset: 2px; }
::selection { background: var(--flor-fundo); }

.icone { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.2em; }
.serifa { font-family: var(--serifa); }
.numeros { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.rotulo {
  font: 600 .72rem/1.2 var(--texto);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--oliva);
}
.discreto { color: var(--tinta-3); }
.so-leitor {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------------ botões */
.botao {
  --fundo: transparent;
  --cor: var(--tinta);
  --borda: var(--linha-forte);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 44px; padding: .65em 1.15em;
  border: 1px solid var(--borda); border-radius: var(--raio);
  background: var(--fundo); color: var(--cor);
  font-weight: 600; font-size: .95rem; line-height: 1.1; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--rapido), color var(--rapido), border-color var(--rapido), transform var(--rapido);
}
.botao:hover { --fundo: var(--papel-2); color: var(--cor); }
.botao:active { transform: translateY(1px); }
.botao[disabled], .botao[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.botao[aria-busy="true"] { cursor: progress; }
.botao[aria-busy="true"]::after {
  content: ''; width: .9em; height: .9em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: girar .7s linear infinite;
}
.botao--acao { --fundo: var(--telha); --cor: #fff; --borda: var(--telha); }
.botao--acao:hover { --fundo: var(--telha-escura); --borda: var(--telha-escura); color: #fff; }
.botao--escuro { --fundo: var(--tinta); --cor: var(--papel); --borda: var(--tinta); }
.botao--escuro:hover { --fundo: #33402f; color: var(--papel); }
.botao--texto { --borda: transparent; padding-inline: .4em; color: var(--telha-escura); }
.botao--texto:hover { --fundo: transparent; text-decoration: underline; color: var(--telha); }
.botao--perigo { --cor: var(--perigo); --borda: rgba(161, 39, 28, .4); }
.botao--perigo:hover { --fundo: var(--perigo-fundo); color: var(--perigo); }
.botao--pequeno { min-height: 34px; padding: .4em .8em; font-size: .85rem; }
.botao--icone { padding: 0; width: 44px; }
.botao--largo { width: 100%; }

@keyframes girar { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ campos */
.campo { display: grid; gap: .35rem; min-width: 0; }
.campo > span:first-child, .campo__rotulo {
  font-size: .82rem; font-weight: 600; color: var(--tinta-2);
}
.campo small { color: var(--tinta-3); font-size: .8rem; }
.entrada, .campo input:not([type="checkbox"]):not([type="radio"]), .campo select, .campo textarea {
  width: 100%; min-height: 44px; padding: .6em .75em;
  border: 1px solid var(--linha-forte); border-radius: var(--raio);
  background: var(--folha); color: var(--tinta);
  transition: border-color var(--rapido), box-shadow var(--rapido);
}
.campo textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .entrada:focus {
  outline: none; border-color: var(--oliva); box-shadow: 0 0 0 3px rgba(91, 105, 33, .18);
}
.campo input[aria-invalid="true"] { border-color: var(--perigo); }
/* Aviso da máscara (mascaras.js), logo abaixo do campo errado. */
.campo__aviso { color: var(--perigo); font-size: .8rem; line-height: 1.35; }
.campo__aviso[hidden] { display: none; }
input.entrada[aria-invalid="true"] { border-color: var(--perigo); }
.campo select {
  appearance: none; padding-right: 2.2em;
  background-image: linear-gradient(45deg, transparent 50%, var(--tinta-2) 50%), linear-gradient(135deg, var(--tinta-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.marcar { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; line-height: 1.4; }
.marcar input { width: 20px; height: 20px; margin: .1em 0 0; accent-color: var(--oliva); flex: none; }

.senha-com-olho { position: relative; display: block; }
.senha-com-olho input { padding-right: 46px !important; }
.senha-olho {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 40px; display: grid; place-items: center;
  border: 0; background: none; color: currentColor; opacity: .7; cursor: pointer; border-radius: var(--raio);
}
.senha-olho:hover { opacity: 1; }
input::-ms-reveal { display: none; }

.mensagem { padding: .7rem .85rem; border-left: 3px solid; font-size: .92rem; border-radius: 0 var(--raio) var(--raio) 0; }
.mensagem--erro { border-color: var(--perigo); background: var(--perigo-fundo); color: var(--perigo-texto); }
.mensagem--ok { border-color: var(--verde-ok); background: var(--verde-ok-fundo); color: var(--verde-ok-texto); }
.mensagem--info { border-color: var(--oliva); background: var(--oliva-fundo); color: var(--oliva-texto); }
.mensagem--teste { border-color: var(--flor); background: var(--flor-fundo); color: var(--flor-texto); }

/* ------------------------------------------------------------ selos de situação */
.selo {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .18em .55em; border: 1px solid currentColor; border-radius: 2px;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.selo--pendente { color: var(--flor-texto); background: var(--flor-fundo); border-color: var(--flor-borda); }
.selo--confirmada { color: var(--verde-ok-texto); background: var(--verde-ok-fundo); }
.selo--hospedada { color: var(--papel); background: var(--oliva); border-color: var(--oliva); }
.selo--finalizada { color: var(--tinta-3); }
.selo--cancelada, .selo--expirada { color: var(--perigo); background: transparent; border-style: dashed; }

/* ------------------------------------------------------------ recados */
.avisos {
  position: fixed; z-index: 90; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  max-width: min(420px, calc(100vw - 32px)); pointer-events: none;
}
.avisos > div { display: grid; gap: 8px; }
.aviso { pointer-events: auto; }
.aviso {
  padding: .8rem 1rem; border-radius: var(--raio); background: var(--tinta); color: var(--papel);
  box-shadow: var(--sombra-flutuante); font-size: .92rem; animation: entrar var(--medio) var(--curva);
}
.aviso--erro { background: var(--perigo); }
.aviso--ok { background: var(--verde-ok); }
.aviso--saindo { opacity: 0; transform: translateY(6px); transition: opacity .24s, transform .24s; }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------ diálogo */
dialog.dialogo {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0;
  border: 1px solid var(--linha-forte); border-radius: var(--raio-2);
  background: var(--folha); color: var(--tinta); box-shadow: var(--sombra-flutuante);
}
dialog.dialogo::backdrop { background: rgba(31, 42, 30, .45); }

/* Abrir e fechar com movimento curto (@starting-style + display discreto). Sem
   suporte, o diálogo só aparece e some, como antes. */
dialog.dialogo, dialog.dialogo::backdrop {
  transition: opacity var(--rapido) ease, transform var(--medio) var(--curva), overlay var(--medio) allow-discrete, display var(--medio) allow-discrete;
}
dialog.dialogo:not([open]) { opacity: 0; transform: translateY(10px) scale(.985); }
dialog.dialogo:not([open])::backdrop { opacity: 0; }
@starting-style {
  dialog.dialogo[open] { opacity: 0; transform: translateY(10px) scale(.985); }
  dialog.dialogo[open]::backdrop { opacity: 0; }
}
.dialogo__cabeca { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem .4rem; }
.dialogo__cabeca h2 { font-family: var(--titulo); font-size: 1.35rem; }
.dialogo__corpo { padding: .6rem 1.25rem 1.1rem; display: grid; gap: 1rem; }
.dialogo__pe { display: flex; justify-content: flex-end; gap: .6rem; padding: .9rem 1.25rem 1.2rem; border-top: 1px solid var(--linha); flex-wrap: wrap; }

/* ------------------------------------------------------------ carregando */
.carregando {
  min-height: 1.2em; border-radius: 2px;
  background: linear-gradient(90deg, var(--papel-2) 0 40%, var(--papel-3) 50%, var(--papel-2) 60% 100%) 0 0 / 300% 100%;
  animation: brilho 1.3s linear infinite;
}
@keyframes brilho { to { background-position: -150% 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------ recibo (conta da estadia: site e painel) */
.recibo { display: grid; padding: 1.2rem 1.3rem; background: var(--folha); border: 1px solid var(--linha); border-radius: var(--raio); font-variant-numeric: tabular-nums; }
.recibo p { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--linha); }
.recibo p span:first-child small { display: block; color: var(--tinta-3); font-size: .82rem; }
.recibo__titulo { font-weight: 700; border-bottom: 1px solid var(--linha-forte) !important; }
.recibo__desconto { color: var(--verde-ok); }
.recibo__total { border-bottom: 1px solid var(--linha-forte) !important; }
.recibo__total strong, .recibo__sinal strong { font-family: var(--titulo); font-weight: 400; font-size: 1.45rem; }
.recibo__sinal { background: var(--flor-fundo); margin: .4rem -1.3rem 0; padding-inline: 1.3rem !important; border-bottom: 0 !important; }
.recibo__resto { color: var(--tinta-3); border-bottom: 0 !important; }

.passo__acoes { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ------------------------------------------------------------ pular para o conteúdo */
.pular { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: .7rem 1rem; background: var(--tinta); color: var(--papel); }
.pular:focus { left: 8px; }

/* ------------------------------------------------------------ toque: alvos de 44 px */
@media (pointer: coarse) {
  .botao--pequeno { min-height: 44px; }
  .botao--icone.botao--pequeno { width: 44px; }
  .senha-olho { width: 44px; height: 44px; right: 0; }
  .marcar input { width: 24px; height: 24px; }
  .mapa__controles select, .mapa__controles input { min-height: 44px; }
}

/* ------------------------------------------------------------ carregando (reserva o espaço do conteúdo) */
.carregando--linha { height: 3rem; }
.carregando--tabela { height: 22rem; }
.carregando--livro { height: 59rem; }
@media (max-width: 860px) { .carregando--livro { height: 78rem; } }