/* =========================================================================
   Base compartilhada: cores, letras, botões, campos e avisos.
   Usada pelo site (site.css) e pela área da dona (admin.css).
   ========================================================================= */

@font-face {
  font-family: 'Lilita One';
  src: url('/fontes/lilita-one.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Paleta de festa */
  --uva: #35134f;          /* texto e títulos */
  --uva-suave: #6b5a78;    /* texto secundário */
  --chiclete: #d81f66;     /* ação principal */
  --chiclete-escuro: #b3124f;
  --limao: #ffc83d;        /* destaque e foco */
  --piscina: #1fa9b8;      /* painel alto, detalhes */
  --laranja: #ff8a3d;
  --rosa: #ff9cc0;
  --lilas: #b48adb;
  --lavanda: #f3edfa;      /* fundos suaves */
  --papel: #ffffff;
  --borda: #e6dcef;
  --verde-whats: #1c7a4c;

  /* Situações */
  --livre-fundo: #dff5ea;
  --livre-texto: #0f6b3f;
  --ocupado-fundo: #f2ecf6;
  --ocupado-texto: #6e5a7e;
  --sem-data-fundo: #fff4d6;
  --sem-data-texto: #7a5600;
  --erro-fundo: #fde8ef;
  --erro-texto: #9b1048;

  --fonte-titulo: 'Lilita One', 'Arial Rounded MT Bold', ui-rounded, system-ui, sans-serif;
  --fonte-texto: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --raio-grande: 22px;
  --raio-medio: 14px;
  --raio-pilula: 999px;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--papel);
  color: var(--uva);
  font-family: var(--fonte-texto);
  font-size: 1rem;
  line-height: 1.5;
}

h1,
h2,
h3 {
  font-family: var(--fonte-titulo);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  letter-spacing: 0.005em;
}

p {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--chiclete-escuro);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--limao);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--uva);
  border-radius: 6px;
}

.visualmente-oculto {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.pular {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--uva);
  color: var(--papel);
  border-radius: var(--raio-medio);
  text-decoration: none;
}

.pular:focus {
  top: 12px;
}

/* ---------- Botões ---------- */

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: var(--raio-pilula);
  background: var(--lavanda);
  color: var(--uva);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.botao:active:not(:disabled) {
  transform: scale(0.97);
}

.botao:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.botao svg {
  flex: none;
  width: 22px;
  height: 22px;
}

.botao--primario {
  background: var(--chiclete);
  color: var(--papel);
}

.botao--primario:hover:not(:disabled) {
  background: var(--chiclete-escuro);
}

.botao--contorno {
  background: var(--papel);
  border-color: var(--borda);
}

.botao--contorno:hover:not(:disabled) {
  border-color: var(--uva);
}

.botao--whats {
  background: var(--verde-whats);
  color: var(--papel);
}

.botao--whats:hover {
  background: #155f3b;
}

.botao--perigo {
  background: var(--papel);
  color: var(--erro-texto);
  border-color: #f3b8cd;
}

.botao--grande {
  width: 100%;
  min-height: 56px;
  font-size: 1.0625rem;
}

.botao--icone {
  width: 48px;
  min-width: 48px;
  padding: 0;
}

/* ---------- Campos ---------- */

.campo {
  display: grid;
  gap: 6px;
}

.campo > label,
.campo > .campo__rotulo {
  font-weight: 700;
}

.campo__ajuda {
  color: var(--uva-suave);
  font-size: 0.875rem;
}

input[type='text'],
input[type='tel'],
input[type='date'],
input[type='time'],
input[type='password'],
input[type='number'],
input[type='search'],
select,
textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid var(--borda);
  border-radius: var(--raio-medio);
  background: var(--papel);
  font-size: 1rem; /* 16px: evita o zoom automático no iPhone */
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--uva);
}

input[aria-invalid='true'] {
  border-color: var(--chiclete);
}

.escolha {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.escolha legend {
  font-weight: 700;
  margin-bottom: 6px;
  padding: 0;
}

.escolha label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 2px solid var(--borda);
  border-radius: var(--raio-medio);
  font-weight: 700;
  cursor: pointer;
}

.escolha input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.escolha label:has(input:checked) {
  border-color: var(--uva);
  background: var(--uva);
  color: var(--papel);
}

.escolha label:has(input:focus-visible) {
  outline: 3px solid var(--limao);
  outline-offset: 2px;
}

/* ---------- Selos de situação ---------- */

.selo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--raio-pilula);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.selo::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.selo--livre {
  background: var(--livre-fundo);
  color: var(--livre-texto);
}

.selo--ocupado {
  background: var(--ocupado-fundo);
  color: var(--ocupado-texto);
}

.selo--sem-data {
  background: var(--sem-data-fundo);
  color: var(--sem-data-texto);
}

/* ---------- Mensagens ---------- */

.mensagem-erro {
  padding: 12px 14px;
  border-radius: var(--raio-medio);
  background: var(--erro-fundo);
  color: var(--erro-texto);
  font-weight: 600;
}

.mensagem-erro:empty {
  display: none;
}

.avisos {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 60;
  display: grid;
  gap: 8px;
  width: min(92vw, 460px);
  transform: translateX(-50%);
  pointer-events: none;
}

.aviso-flutuante {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--raio-medio);
  background: var(--uva);
  color: var(--papel);
  font-weight: 600;
  pointer-events: auto;
  animation: aviso-entra 0.2s ease-out;
}

.aviso-flutuante--erro {
  background: var(--erro-texto);
}

.aviso-flutuante button {
  flex: none;
  min-height: 40px;
  padding: 6px 14px;
  border: 2px solid currentColor;
  border-radius: var(--raio-pilula);
  background: transparent;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
}

@keyframes aviso-entra {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
