/* ============================================================
   layout.css — App shell, pages, header, navigation
   ============================================================ */

#app { min-height: 100dvh; display: flex; flex-direction: column; position: relative; }

/* ---- Pages ---- */
.page { display: none; flex: 1; flex-direction: column; animation: pageIn .25s ease; }
.page.active { display: flex; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Header ---- */
.header {
  height: calc(var(--header-h) + var(--safe-t));
  padding-top: var(--safe-t);
  display: flex; align-items: center; padding-inline: 16px;
  background: var(--surface); border-bottom: 1px solid var(--divider);
  position: sticky; top: 0; z-index: 20; gap: 8px;
}
.header .title { font-size: 16px; font-weight: 700; flex: 1; }
.header .back { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text); transition: background .15s; }
.header .back:active { background: var(--surface-2); }
.header .action { color: var(--primary); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: var(--radius-xs); transition: background .15s; }
.header .action:active { background: var(--primary-pale); }

/* ---- Scroll area ---- */
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px); }
.scroll.no-nav { padding-bottom: 24px; }

/* ---- Bottom navigation ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--divider);
  display: flex; z-index: 30; box-shadow: 0 -1px 3px rgba(0, 0, 0, .05);
}
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-3); transition: color .15s; position: relative; }
.nav-item.active { color: var(--primary); }
.nav-item .material-icons-round { font-size: 24px; transition: font-size .15s; }
.nav-item.active .material-icons-round { font-size: 26px; }
.nav-item span:not(.badge) { font-size: 10px; font-weight: 500; }
.nav-item .badge { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); min-width: 16px; height: 16px; border-radius: 8px; background: var(--error); color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* ---- Auth hero (login / OTP) ---- */
.auth-hero { background: var(--primary); padding: 48px 24px 40px; text-align: center; }
.auth-hero-logo { background: rgba(255, 255, 255, .12); border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.auth-hero-logo.lg { width: 72px; height: 72px; }
.auth-hero-logo.sm { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 12px; }
.auth-hero-logo .material-icons-round { color: #fff; }
.auth-hero-logo.lg .material-icons-round { font-size: 36px; }
.auth-hero-logo.sm .material-icons-round { font-size: 28px; }
.auth-hero-title { color: #fff; font-size: 22px; font-weight: 800; }
.auth-hero-sub { color: rgba(255, 255, 255, .6); font-size: 13px; margin-top: 4px; }

/* ---- Login method toggle ---- */
.login-tabs { display: flex; gap: 0; margin-bottom: 16px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; }
.login-tab { flex: 1; padding: 10px; border-radius: var(--radius-xs); font-weight: 600; font-size: 13px; transition: background .15s, color .15s, box-shadow .15s; color: var(--text-3); }
.login-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---- Centered shell (desktop) ---- */
@media (min-width: 481px) {
  .page, .modal-sheet { max-width: var(--shell-max); margin-inline: auto; }
  .bottom-nav { right: auto; left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--shell-max); border-radius: var(--radius) var(--radius) 0 0; }
  .fab { left: calc(50% - (var(--shell-max) / 2) + 16px); }
}
