/* Bella V2 — Reset + base + tipografia.
 * App = container de strips. Cada strip tem sua cor de fundo (a cor da porta).
 */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Caveat:wght@500;600;700&family=Reenie+Beanie&family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-serif);
  background-color: var(--background);
  background-image:
    radial-gradient(oklch(0.24 0.03 35 / 0.04) 1px, transparent 1px),
    radial-gradient(oklch(0.24 0.03 35 / 0.025) 1px, transparent 1px);
  background-size: 22px 22px, 7px 7px;
  background-position: 0 0, 11px 11px;
  background-attachment: fixed;
  color: var(--foreground);
  height: 100dvh;
  overflow: hidden;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

/* Tela de auth permite scroll quando o teclado encolhe o viewport */
body[data-authed="false"] {
  overflow-y: auto;
  height: auto;
  min-height: 100dvh;
}

/* ─── App shell ─── */
#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.005em;
}

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  font-size: 16px;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
  font-family: inherit;
  font-size: 16px;
  color: inherit;
}

img { display: block; max-width: 100%; }

/* ─── SVG icons inline (de js/data/icons.js) ─── */
.bella-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  color: currentColor;
}

/* ─── Splash (boot inicial) — "capa de scrapbook" ───
   Selo da abelha (disco terracota) ACIMA da polaroide do bebê, saudação
   manuscrita e wordmark serifada. Glow de papel craft ao fundo, rotações
   intencionais e entrada escalonada. Curva forte (Emil): ease-out com punch. */
#splash {
  --splash-ease: cubic-bezier(0.23, 1, 0.32, 1);
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 38%,
      color-mix(in oklab, var(--cream, #FAF4E6) 70%, transparent) 0%,
      transparent 62%),
    var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;                 /* a tela toda é toque-pra-pular */
  transition: opacity 0.35s ease;
}
#splash.hiding { opacity: 0; pointer-events: none; }

.splash-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
}

/* ── Selo da abelha — ASSINATURA discreta (foto do bebê é a protagonista; HIG +
   pesquisa de mercado: marca não rouba a cena, foto/personalização no centro) ── */
.splash-badge {
  position: relative;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
  transform: rotate(2deg);
  animation: splashBadgeIn 0.6s var(--splash-ease) both;
}
/* halo de papel sutil atrás do disco */
.splash-badge-halo {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle,
    color-mix(in oklab, var(--peach, #E8A86B) 26%, transparent) 0%,
    transparent 70%);
  animation: splashHalo 3s ease-in-out 0.6s infinite;
}
/* disco terracota: o ícone quadrado vira disco via overflow:hidden */
.splash-badge-disc {
  position: relative;
  width: 52px; height: 52px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    var(--shadow-note, 1px 2px 0 rgba(42,26,14,.06), 3px 6px 14px rgba(42,26,14,.12)),
    inset 0 0 0 2px var(--card, #fff);
  animation: splashPulse 3s ease-in-out 0.6s infinite;
}
.splash-badge-disc img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* fitinha washi no topo do selo */
.splash-badge-tape {
  position: absolute;
  top: -5px; left: 50%; z-index: 1;
  width: 28px; height: 11px;
  transform: translateX(-50%) rotate(-4deg);
  background: oklch(0.86 0.08 90 / 0.78);
  border-radius: 1px;
  border-left: 1px dashed oklch(0.24 0.03 35 / 0.08);
  border-right: 1px dashed oklch(0.24 0.03 35 / 0.08);
  box-shadow: 0 1px 3px oklch(0.24 0.03 35 / 0.18);
}

/* ── Saudação manuscrita ── */
.splash-greet {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 30px;
  line-height: 1;
  color: var(--terracotta, #BC6038);
  margin: 0;
  text-align: center;
  transform: rotate(-1.5deg);
  animation: splashIn 0.55s var(--splash-ease) 0.08s both;
}

/* ── Polaroide do bebê ── */
.splash-polaroid {
  position: relative;
  transform: rotate(-3deg);            /* rotação fixa; entrada cuida da opacidade/translate */
  animation: splashPolaroidIn 0.6s var(--splash-ease) 0.16s both;
}
.splash-pol-tape {
  position: absolute;
  top: -12px; left: 50%;
  width: 88px; height: 20px;
  transform: translateX(-50%) rotate(3deg);
  background: oklch(0.86 0.08 90 / 0.75);
  border-radius: 1px;
  border-left: 1px dashed oklch(0.24 0.03 35 / 0.08);
  border-right: 1px dashed oklch(0.24 0.03 35 / 0.08);
  box-shadow: 0 1px 3px oklch(0.24 0.03 35 / 0.18);
}
.splash-pol-frame {
  background: var(--card, #fff);
  padding: 12px 12px 14px;
  box-shadow: var(--bella-shadow-polaroid, 0 3px 12px rgba(122, 80, 48, 0.16));
}
.splash-pol-img {
  width: 200px; height: 200px;
  max-width: 60vw; max-height: 60vw;
  background: var(--muted, #efe6dc);
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
  font-size: 74px;
  overflow: hidden;
}
.splash-pol-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.splash-pol-caption {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 24px;
  line-height: 1.1;
  color: var(--terracotta, #BC6038);
  text-align: center;
  padding-top: 10px;
  min-height: 1em;
}

/* ── Wordmark + dot ── */
.splash-logo {
  font-family: var(--font-display, 'Lora', serif);
  font-size: 26px; font-weight: 600; color: var(--primary, #BC6038);
  letter-spacing: -0.01em;
  margin-top: 6px;
  animation: splashIn 0.55s var(--splash-ease) 0.26s both;
}
/* Dica de toque-pra-pular — aparece depois de ~0,7s (quando a tela assenta) e
   pisca de leve, deixando óbvio que dá pra pular a abertura. */
.splash-hint {
  margin: 8px 0 0;
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted-foreground, #9a8a78);
  opacity: 0;
  animation:
    splashHintIn 0.5s ease 0.7s forwards,
    splashHintBlink 1.6s ease-in-out 1.2s infinite;
}
@keyframes splashHintIn   { to { opacity: 0.7; } }
@keyframes splashHintBlink { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.95; } }

/* ── Keyframes ── */
@keyframes splashIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
/* entradas que preservam a rotação fixa do elemento */
@keyframes splashBadgeIn {
  from { opacity: 0; transform: rotate(2deg) translateY(-10px) scale(0.92); }
  to   { opacity: 1; transform: rotate(2deg) translateY(0)     scale(1); }
}
@keyframes splashPolaroidIn {
  from { opacity: 0; transform: rotate(-3deg) translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: rotate(-3deg) translateY(0)    scale(1); }
}
/* pulso bem suave do selo — só um "respira", não compete com a foto */
@keyframes splashPulse {
  0%, 100% { transform: scale(1);     }
  50%      { transform: scale(1.035); }
}
@keyframes splashHalo {
  0%, 100% { opacity: 0.35; transform: scale(0.95); }
  50%      { opacity: 0.6;  transform: scale(1.06); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.4); opacity: 1; }
}

/* ─── Acessibilidade: foco visível padronizado (design guide §11) ─── */
:where(button, a, [role="button"], input, select, textarea, [tabindex]):focus {
  outline: none;
}
:where(button, a, [role="button"], input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--ring, var(--porta-color));
  outline-offset: 2px;
  border-radius: inherit;
}

/* ─── prefers-reduced-motion: desliga rotações e transições não-essenciais ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .polaroid,
  .polaroid-marco,
  .sticky-card,
  .sticky-card-l1,
  .sticky-card-r1,
  .hoje-fab,
  .bella-fab,
  .subtab-pill,
  .hand-tag,
  .polaroid-marco-tape,
  .sticky-tape,
  .polaroid-tape {
    transform: none !important;
  }

  /* Splash: sem pulso/halo/movimento — só o conteúdo, parado. As rotações
     "scrapbook" continuam (são estética, não movimento), exceto onde a regra
     genérica acima já zera (.splash-pol-tape herda de .polaroid-tape? não —
     então zeramos explícito o que tem transform animado). */
  .splash-badge-disc,
  .splash-badge-halo,
  #splash .dot {
    animation: none !important;
  }
  .splash-badge,
  .splash-greet,
  .splash-polaroid,
  .splash-logo {
    animation: none !important;
    opacity: 1 !important;
  }
}
