/* ==========================================================================
   afora, sua viagem inteira em um só lugar
   Sistema de design: suave, arredondado, pastel, sobre creme.
   Mobile-first, com barra de navegação inferior.
   ========================================================================== */

:root {
  --cream: #F4EFE6;      /* fundo */
  --cream-2: #EFE9DD;
  --paper: #FFFDF9;      /* cartões */
  --ink: #201C1B;        /* texto/preto suave */
  --ink-soft: #6E655E;   /* texto secundário */
  --line: #EAE3D6;       /* linhas sutis */

  --mint: #5FC79E;       /* verde pin (primária) */
  --mint-soft: #C6EAD8;
  --blue: #8FB4F2;       /* azul serenity */
  --blue-soft: #D3E1FA;
  --pink: #F4A9C4;       /* rosa */
  --pink-soft: #FBD7E3;
  --yellow: #F5D96B;     /* amarelo */
  --yellow-soft: #FBEEB4;
  --gray: #E7E3DC;

  --shadow: 0 10px 26px rgba(32, 28, 27, .10);
  --shadow-sm: 0 6px 16px rgba(32, 28, 27, .07);
  --shadow-pill: 0 4px 12px rgba(32, 28, 27, .10);
  --r-lg: 26px;
  --r: 20px;
  --r-sm: 14px;
  --col: 440px;   /* largura da coluna do app */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--cream); }
body {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, .display { font-family: 'Baloo 2', 'Nunito', sans-serif; font-weight: 700; line-height: 1.1; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 16px; color: var(--ink); }
img { display: block; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar:horizontal { height: 0; }   /* esconde a barra de scroll horizontal (fileiras de chips) */
::-webkit-scrollbar-thumb { background: #DAD3C6; border-radius: 99px; }
/* fileiras que rolam na horizontal: sem barra, só swipe */
[style*="overflow-x:auto"], [style*="overflow-x: auto"], [style*="overflow-x:scroll"] { scrollbar-width: none; -ms-overflow-style: none; }
[style*="overflow-x:auto"]::-webkit-scrollbar, [style*="overflow-x: auto"]::-webkit-scrollbar, [style*="overflow-x:scroll"]::-webkit-scrollbar { height: 0; display: none; }

/* Coluna do app (celular no centro) ---------------------------------------- */
#app { max-width: var(--col); margin: 0 auto; min-height: 100vh; position: relative; }
.screen { padding: 12px 18px calc(96px + env(safe-area-inset-bottom)); animation: rise .32s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes floatY { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes livePulse { 0%,100% { opacity: 1; transform: scale(1) } 50% { opacity: .35; transform: scale(.7) } }
@keyframes holo { 0% { background-position: 0% 50% } 50% { background-position: 100% 50% } 100% { background-position: 0% 50% } }

/* Barra de topo ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 10px; background: linear-gradient(var(--cream) 78%, rgba(244,239,230,0));
}
.topbar .brand { display: flex; align-items: center; gap: 2px; }
.topbar .brand svg { height: 30px; width: auto; display: block; }
.topbar .spacer { flex: 1; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--blue-soft);
  display: grid; place-items: center; font-family: 'Baloo 2'; font-weight: 700; color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; background: var(--paper);
  display: grid; place-items: center; box-shadow: var(--shadow-sm); color: var(--ink);
}

/* Cartões, pílulas, botões ------------------------------------------------- */
.card { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
  background: var(--paper); box-shadow: var(--shadow-pill);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 15px;
  padding: 13px 20px; border-radius: 99px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, filter .2s ease;
}
.btn:active { transform: scale(.97); }
.btn--mint { background: var(--mint); color: var(--ink); }
.btn--block { width: 100%; }
.btn--ghost { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }
.click { cursor: pointer; transition: transform .12s ease; }
.click:active { transform: scale(.98); }
.chip-pick {
  padding: 9px 14px; border-radius: 99px; background: var(--paper); color: var(--ink-soft);
  font-weight: 800; font-size: 13px; box-shadow: var(--shadow-sm); cursor: pointer; transition: background .15s, color .15s;
}
.chip-pick.on { background: var(--mint); color: #14201a; }

/* Barra de navegação inferior ---------------------------------------------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: var(--col); z-index: 50;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--paper); border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(32,28,27,.06);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 2px; color: var(--ink-soft); font-size: 10.5px; font-weight: 700;
  transition: color .18s;
}
.tabbar button svg { width: 23px; height: 23px; display: block; }
.tabbar button.on { color: var(--ink); }
.tabbar button.on .ic { background: var(--mint-soft); }
.tabbar button .ic {
  width: 46px; height: 30px; border-radius: 99px; display: grid; place-items: center;
  transition: background .2s;
}

/* Login / senha ------------------------------------------------------------ */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 12% 8%, var(--mint-soft), transparent 40%),
    radial-gradient(circle at 88% 92%, var(--blue-soft), transparent 42%),
    var(--cream);
}
.auth-card { width: 100%; max-width: 380px; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.field input {
  width: 100%; font-size: 15px; padding: 13px 15px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--cream); outline: none; transition: border .15s, background .15s; font-weight: 600;
}
.field input:focus { border-color: var(--mint); background: var(--paper); }

/* Genéricos ---------------------------------------------------------------- */
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 12px; }
.section-title h2 { font-size: 20px; }
.section-title .more { font-size: 13px; font-weight: 700; color: var(--mint); }
.muted { color: var(--ink-soft); }
.hide { display: none !important; }

.toast {
  position: fixed; bottom: 108px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 99px;
  font-size: 14px; font-weight: 700; z-index: 90; box-shadow: var(--shadow); animation: rise .3s ease; max-width: 90%;
}

/* Folha inferior (modal) --------------------------------------------------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(32,28,27,.4); z-index: 3000; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  position: relative;
  width: 100%; max-width: var(--col); background: var(--cream); border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); animation: up .28s cubic-bezier(.2,.8,.2,1);
  max-height: 92vh; overflow-y: auto;
}
@keyframes up { from { transform: translateY(100%) } to { transform: none } }
.sheet .grip { width: 50px; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--mint), var(--blue)); margin: 8px auto 20px; }
.sheet-x {
  position: absolute; top: 14px; right: 16px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--mint-soft); color: #2f7a5a;
  display: grid; place-items: center; font-size: 15px; font-weight: 900; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .12s ease;
}
.sheet-x:active { transform: scale(.9); }

/* Leaflet (mapa) ----------------------------------------------------------- */
.afora-pin { background: transparent !important; border: none !important; }
.afora-pin .pin-inner { position: absolute; left: 0; top: 0; transform: translate(-50%,-100%); font-family: 'Nunito', sans-serif; }
.leaflet-container { font-family: 'Nunito', sans-serif; background: #DCE7DC; }
.leaflet-container a { color: var(--ink); }

/* Telas maiores: mantém o app como um celular centralizado ----------------- */
@media (min-width: 620px) {
  body { background: radial-gradient(circle at 30% 10%, #EDE6D8, var(--cream) 60%); }
  #app { box-shadow: 0 30px 80px rgba(32,28,27,.14); background: var(--cream); }
}
