/* Partiu — estilos do protótipo. Identidade: fotos do litoral, vidro fosco, azul-marinho do mar, cantos arredondados e títulos em itálico. */
html, body { margin: 0; }
[hidden] { display: none !important; }
img { max-width: 100%; }

/* Layout: um celular centralizado no desktop e em tela cheia no telefone. Tema claro com azul-marinho de destaque. */
:root {
  /* espaço padrão do topo até o conteúdo (área da barra de status / notch), igual em todas as telas */
  --safe-top: max(20px, calc(env(safe-area-inset-top) + 10px)); /* celular de verdade: só o notch do aparelho */
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --fill: #F4F4F5; /* fundos suaves em cinza bem claro */
  --line: #E8E8EA;
  --ink: #1B1F27;
  --sec: #7E8492;
  --muted: #B9BEC8;
  --brand: #111111;
  --brand-deep: #000000;
  --brand-soft: #F2F2F3;
  --brand-sky: #8A8A8E; /* cinza médio, só para detalhes pequenos */
  --glass: rgba(255, 255, 255, .16);
  --glass-line: rgba(255, 255, 255, .34);
  --screen: #FFFFFF; /* telas em branco puro; o preto é o destaque */
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); display: flex; align-items: center; justify-content: center; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, p { margin: 0; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.7px; text-wrap: balance; }
h1 em { font-style: italic; color: var(--brand); }

.phone { position: relative; width: 402px; height: 874px; max-height: none; background: var(--surface); border-radius: 58px; overflow: hidden; overflow: clip; box-shadow: 0 0 0 11px #0B0B0D, 0 0 0 13px #3B3B40, 0 0 0 14px #1A1A1D, 0 40px 90px rgba(0, 0, 0, .28); } /* proporção do iPhone 17 Pro (402 × 874 pt) */
/* celular de verdade: o app ocupa a tela inteira, por baixo do notch e da barra do navegador (Safari no iPhone).
   --tb é a altura da barra do navegador quando ela aparece (a tela grande menos a área visível);
   o que fica embaixo (abas, botões, painel do mapa) sobe essa altura para não ficar escondido. */
:root { --tb: 0px; }
@media (max-width: 500px) {
  :root { --tb: max(0px, calc(100lvh - 100dvh)); }
  html, body { height: 100vh; height: 100lvh; background: transparent; }
  body { display: block; }
  .phone { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; max-height: none; border-radius: 0; box-shadow: none; }
  .screen:not(#main) { padding-bottom: var(--tb); }
  .phone::after { display: none; }
  /* no Safari a barra de status e a do endereço pegam a cor do fundo: no mapa, a mesma cor do mapa */
  html[data-screen="main"], html[data-screen="main"] body, html[data-screen="main"] .phone { background: #F7F4EE; }
}
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

.btn-primary { width: 100%; min-height: 56px; border: 0; border-radius: 999px; background: var(--brand); color: var(--surface); font-size: 17px; font-weight: 700; transition: opacity .15s, transform .15s; }
.btn-primary:not(:disabled):active { transform: scale(.97); }
.btn-primary:disabled { background: var(--line); color: var(--sec); cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.icon-btn.filled { background: var(--fill); }
.icon-btn.round { border: 1px solid #D4D4D9; border-radius: 50%; background: var(--surface); }
.label { font-size: 13px; font-weight: 600; color: var(--sec); }
.sub { font-size: 17px; color: var(--sec); line-height: 1.4; }

/* atalho de desenvolvimento para a página com todas as telas (só em telas largas) */
.dev-link { position: fixed; z-index: 50; left: 16px; top: 16px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 20px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.dev-link:hover { color: var(--ink); }
.dev-wx { top: 64px; border: 0; cursor: pointer; font-family: inherit; }
.dev-wx svg { flex: none; }
@media (max-width: 500px) { .dev-link { display: none; } }

/* transições entre telas e entre etapas */
@keyframes in-f { from { opacity: 0; transform: translateX(32px); } }
@keyframes in-b { from { opacity: 0; transform: translateX(-32px); } }
@keyframes out { to { opacity: 0; transform: scale(.985); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }
.screen.enter-f { animation: in-f .36s cubic-bezier(.2, .8, .2, 1); }
.screen.enter-b { animation: in-b .36s cubic-bezier(.2, .8, .2, 1); }
.screen.leave { animation: out .24s ease forwards; pointer-events: none; }
.step-f > * { animation: in-f .34s cubic-bezier(.2, .8, .2, 1) both; }
.step-b > * { animation: in-b .34s cubic-bezier(.2, .8, .2, 1) both; }
.step-f > :nth-child(2), .step-b > :nth-child(2) { animation-delay: .04s; }
.step-f > :nth-child(3), .step-b > :nth-child(3) { animation-delay: .08s; }
.step-f > :nth-child(n+4), .step-b > :nth-child(n+4) { animation-delay: .12s; }
.swap { animation: rise-in .38s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { .screen.enter-f, .screen.enter-b, .step-f > *, .step-b > *, .swap { animation: none; } }

/* ---------- barra inferior: fixa e flutuando sobre todas as abas da área logada ---------- */
.tabbar { position: absolute; z-index: 1500; left: 50%; bottom: calc(var(--tb) + max(14px, env(safe-area-inset-bottom))); transform: translateX(-50%); display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6); box-shadow: 0 10px 30px rgba(0, 0, 0, .14), inset 0 0 0 1px rgba(0, 0, 0, .07);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .25s; animation: tab-in .5s cubic-bezier(.34, 1.56, .64, 1) backwards; }
.tabbar[hidden] { display: flex; opacity: 0; pointer-events: none; transform: translate(-50%, 140%); }
@keyframes tab-in { from { transform: translate(-50%, 140%); } }
.tab-ind { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; width: var(--iw, 0); transform: translateX(var(--ix, 0)); border-radius: 999px; background: var(--brand); box-shadow: 0 4px 12px rgba(17, 17, 17, .28); transition: transform .45s cubic-bezier(.34, 1.3, .64, 1), width .45s cubic-bezier(.34, 1.3, .64, 1); }
.tabbar button { position: relative; z-index: 1; min-height: 48px; min-width: 52px; padding: 0 14px; border: 0; border-radius: 999px; background: none; display: flex; align-items: center; justify-content: center; gap: 0; font-size: 14px; font-weight: 600; color: var(--sec); transition: color .25s, padding .35s cubic-bezier(.2, .8, .2, 1); }
.tabbar button:active .tab-ic { transform: scale(.86); }
.tab-ic { display: grid; transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.tab-l { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .38s cubic-bezier(.2, .8, .2, 1), opacity .25s, margin .38s; }
.tabbar button[aria-current="page"] { color: #fff; padding: 0 18px 0 16px; }
.tabbar button[aria-current="page"] .tab-l { max-width: 90px; opacity: 1; margin-left: 8px; }
/* painéis por cima (escolher lugares, horários, busca, publicar) escondem a barra */
.phone:has(.disc:not([hidden]), .choose:not([hidden]), #when:not([hidden]), #tripsSheet:not([hidden]), .search-view:not([hidden]), .compose-wrap:not([hidden]), #main.has-found) .tabbar { opacity: 0; pointer-events: none; transform: translate(-50%, 140%); }
/* cabeçalho das abas: título grande, como no restante do app */
.tab-head { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-top) + 4px) 20px 6px; }
.tab-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tab-title h1 { font-size: 30px; }
.tab-title span { font-size: 14px; color: var(--sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* foco pelo teclado na barra: anel por dentro da pílula, sem sobrar para fora */
.tabbar button:focus { outline: none; }
.tabbar button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
.tabbar button[aria-current="page"]:focus-visible { box-shadow: inset 0 0 0 2px #fff; }


/* moldura de iPhone (no desktop em "Ver no celular" e entre 500 e 899px): Dynamic Island e barra de status */
.device-ui { display: none; position: absolute; z-index: 4000; left: 0; right: 0; top: 0; height: 54px; align-items: center; justify-content: space-between; padding: 6px 30px 0 46px; color: var(--ink); font-size: 16px; font-weight: 600; letter-spacing: -0.2px; pointer-events: none; font-variant-numeric: tabular-nums; }
.device-ui .island { position: absolute; left: 50%; top: 11px; width: 124px; height: 36px; margin-left: -62px; border-radius: 18px; background: #000; }
.device-ui .sb-icons { display: inline-flex; align-items: center; gap: 6px; }
html[data-screen="login"] .device-ui, html[data-screen="intro"] .device-ui { color: #fff; }
@media (min-width: 501px) and (max-width: 899px) { .device-ui { display: flex; } }
@media (min-width: 900px) { html.phone-mode .device-ui { display: flex; } }
/* a alça do painel não mostra contorno de foco por cima do mapa; pelo teclado, a própria alça escurece */
.grabber-btn:focus { outline: none; }
.grabber-btn:focus-visible span { background: var(--ink); width: 48px; }

/* app embutido na landing (?embed=1): ocupa o iframe inteiro, sem moldura nem botões de desenvolvimento */
html.embed body { display: block; background: var(--surface); }
html.embed .phone { width: 100%; height: 100%; max-height: none; border-radius: 0; box-shadow: none; }
html.embed .dev-link, html.embed .view-toggle { display: none !important; }
/* na landing os celulares mostram a mesma barra de status e Dynamic Island do app */
html.embed .device-ui { display: flex !important; }

/* o iPhone mantém a proporção real (402 × 874): em janelas baixas ele diminui inteiro, em vez de encurtar */
@media (min-width: 501px) and (max-width: 899px) { .phone { zoom: var(--phone-k, 1); } }
@media (min-width: 900px) { html.phone-mode .phone { zoom: var(--phone-k, 1); } }

/* dentro da moldura de iPhone (Dynamic Island desenhada), o conteúdo começa mais abaixo, em todas as telas */
@media (min-width: 501px) and (max-width: 899px) { :root { --safe-top: 68px; } }
@media (min-width: 900px) { html.phone-mode { --safe-top: 68px; } }
html.embed { --safe-top: 68px; }
/* degradê branco no topo das telas que rolam: o conteúdo some suave embaixo da barra de status / notch */
.phone::after { content: ""; position: absolute; z-index: 3500; left: 0; right: 0; top: 0; height: calc(var(--safe-top) + 2px); background: linear-gradient(#fff 70%, rgba(255,255,255,0)); pointer-events: none; opacity: 0; transition: opacity .2s; }
html[data-screen="plan"] .phone::after, html[data-screen="feed"] .phone::after, html[data-screen="conta"] .phone::after, html[data-screen="quiz"] .phone::after { opacity: 1; }
@media (min-width: 900px) { html:not(.phone-mode) .phone::after { display: none; } }
html.embed .phone::after { display: none; }
/* botões redondos de ação (mapa e roteiro): agenda, Maps, editar, nova viagem */
.ph-acts { flex: none; display: flex; align-items: center; gap: 6px; }
.ph-ic { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; transition: border-color .2s, transform .15s; }
.ph-ic:hover { border-color: var(--ink); }
.ph-ic:active { transform: scale(.92); }
.ph-edit { background: var(--brand); border-color: var(--brand); color: #fff; }
.ph-edit:hover { background: var(--brand-deep); }
.ph-edit i { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1.5px var(--brand); font-style: normal; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
