/* ==========================================================================
   Base, layout do app e camadas de navegação
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body { overflow: hidden; touch-action: manipulation; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; text-align: inherit; }
button:disabled { cursor: default; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
code { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 6px; }
[hidden] { display: none !important; }
.i { flex: none; display: block; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(138, 77, 255, 0.45); }
::-webkit-scrollbar { width: 0; height: 0; }

.muted { color: var(--text-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.cap { text-transform: capitalize; }
.link { color: var(--cyan); font-weight: 700; }
.pad-x { padding: 0 var(--gutter); }
.bottom-space { height: calc(var(--tabbar-h) + var(--safe-b) + 40px); }

/* ------------------------------ Moldura do app ------------------------------ */
#app {
  position: relative;
  width: 100%;
  max-width: var(--app-w);
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--scene);
  contain: layout paint; /* fixed/absolute ficam presos à coluna do app no desktop */
  isolation: isolate;
  overflow: clip; /* impede o navegador de rolar a moldura ao focar um campo (a UI subia e cortava o topo) */
}

/* Contêineres de tela têm tamanho fixo: só os filhos com overflow:auto rolam. */
#tabs, #pages, #full, .tab-view, .page, .full-view, .screen, .login, .onb, .explore, .evp, .prof,
.chat, .editor, .boost, .tpage, .gate, .meet, .sheet-wrap { overflow: clip; }

@media (min-width: 620px) and (min-height: 720px) {
  body {
    display: grid;
    place-items: center;
    background:
      radial-gradient(900px 600px at 15% 10%, rgba(123, 47, 247, 0.22), transparent 60%),
      radial-gradient(700px 500px at 85% 90%, rgba(255, 62, 154, 0.16), transparent 60%),
      var(--bg);
  }
  #app {
    height: min(920px, calc(100dvh - 48px));
    border-radius: 38px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 80px -20px rgba(138, 77, 255, 0.35);
  }
  #splash { border-radius: 38px; }
}

#tabs { position: absolute; inset: 0; transition: transform var(--t-slow) var(--ease-out); }
.tab-view {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transform: scale(0.985);
  transition: opacity 0.26s var(--ease), transform 0.36s var(--ease-out), visibility 0s linear 0.26s;
}
.tab-view.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity 0.26s var(--ease), transform 0.36s var(--ease-out); }

#tabbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 15; pointer-events: none; transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease-out); }
html.has-full #tabbar { opacity: 0; transform: translateY(30px); }

#pages { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.page {
  position: absolute; inset: 0;
  background: var(--scene);
  transform: translate3d(100%, 0, 0);
  transition: transform 0.46s var(--ease-out);
  will-change: transform;
  pointer-events: auto;
  overflow: hidden;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
}
.page::after { content: ''; position: absolute; inset: 0; background: #08030f; opacity: 0; pointer-events: none; transition: opacity 0.46s var(--ease-out); z-index: 50; }
.page.is-in { transform: none; }
.page.is-under { transform: translate3d(-22%, 0, 0); }
.page.is-under::after { opacity: 0.5; }
.page.is-out { transform: translate3d(100%, 0, 0); pointer-events: none; }
html.has-page #tabs { transform: translate3d(-22%, 0, 0); }
html.has-page #tabbar { transform: translate3d(-22%, 0, 0); }

#full { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.full-view { position: absolute; inset: 0; background: var(--scene); opacity: 0; transition: opacity 0.45s var(--ease); pointer-events: auto; overflow: hidden; }
.full-view.is-in { opacity: 1; }
.full-view.is-out { opacity: 0; pointer-events: none; }

#overlays { position: absolute; inset: 0; z-index: 60; pointer-events: none; }
#overlays > * { pointer-events: auto; }

/* ------------------------------ Splash ------------------------------ */
#splash {
  position: fixed; inset: 0; z-index: 999;
  display: grid; place-items: center;
  background: radial-gradient(420px 420px at 50% 45%, rgba(255, 62, 154, 0.28), transparent 70%), var(--scene);
  transition: opacity 0.55s var(--ease);
}
#splash svg { animation: splash 1.1s var(--ease) infinite alternate; filter: drop-shadow(0 12px 40px rgba(255, 92, 138, 0.6)); }
#splash.is-out { opacity: 0; pointer-events: none; }
@keyframes splash { from { transform: scale(0.92); } to { transform: scale(1.04); } }

/* ------------------------------ Telas raiz ------------------------------ */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--scene); }
.screen__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--safe-t) + 14px) var(--gutter) 10px;
}
.screen__title { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.screen__actions { display: flex; gap: 8px; }
.screen__scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
.page-pad { padding: calc(var(--safe-t) + 12px) var(--gutter); }
.page-loading { position: absolute; inset: 0; display: grid; place-items: center; }

.section-title { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; padding: 22px var(--gutter) 12px; }
.section-row { display: flex; align-items: center; justify-content: space-between; padding-right: 8px; }
.section-row .section-title { padding-right: 0; }
.section-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin: 22px 0 10px; }

/* Aurora animada (login, onboarding, conhecer alguém) */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(60px); opacity: 0.55; will-change: transform; }
.aurora i:nth-child(1) { background: radial-gradient(circle, #FFA64D 0%, transparent 62%); top: -30%; left: -30%; animation: aur1 14s var(--ease) infinite alternate; }
.aurora i:nth-child(2) { background: radial-gradient(circle, #FF3E9A 0%, transparent 60%); bottom: -35%; right: -35%; animation: aur2 17s var(--ease) infinite alternate; }
.aurora i:nth-child(3) { background: radial-gradient(circle, #7B2FF7 0%, transparent 60%); top: 30%; left: 20%; width: 45vmax; height: 45vmax; opacity: 0.4; animation: aur3 20s var(--ease) infinite alternate; }
.aurora--soft i { opacity: 0.32; }
@keyframes aur1 { to { transform: translate3d(18%, 12%, 0) scale(1.1); } }
@keyframes aur2 { to { transform: translate3d(-16%, -10%, 0) scale(1.15); } }
@keyframes aur3 { to { transform: translate3d(-20%, 14%, 0) scale(0.9); } }
