html,
body,
#root {
  min-height: 100%;
  margin: 0;
}

/* Stop iOS rubber-band overscroll: pulling past the top/bottom made the whole
   page (incl. the sticky nav bars) bounce/translate. `none` pins the scroll
   range so nothing moves beyond content. No effect on desktop web. */
html,
body {
  overscroll-behavior: none;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--bg);
}

.source-auth {
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 10%, rgba(107, 87, 255, 0.2), transparent 34%),
    radial-gradient(circle at 86% 16%, rgba(255, 143, 203, 0.16), transparent 32%),
    var(--bg);
}

.source-auth-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 0 calc(56px + env(safe-area-inset-bottom, 0px));
}

.source-auth-card {
  margin: 48px auto 0;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--sh-3);
  padding: 28px;
  backdrop-filter: blur(14px);
}

.source-auth-card h1 {
  margin: 12px 0 8px;
  font-size: clamp(32px, 9vw, 54px);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.source-auth-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.source-auth .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--chip);
  color: var(--muted);
}

.source-auth .badge.pri {
  background: var(--pri-50);
  color: var(--pri-700);
}

.source-auth-form {
  display: grid;
  gap: 12px;
}

.source-auth-form label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.source-auth-form input {
  height: 52px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 0 16px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
}

.source-auth-form input:focus {
  border-color: var(--pri);
  box-shadow: 0 0 0 4px var(--pri-50);
}

.source-auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.source-auth .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.source-auth .btn:hover {
  transform: translateY(-1px);
}

.source-auth .btn:active {
  transform: scale(0.98);
}

.source-auth .btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.source-auth .btn.primary {
  background: var(--pri);
  color: #fff;
  box-shadow: var(--sh-pri);
}

.source-auth .btn.primary:hover {
  background: var(--pri-600);
}

.source-auth .btn.outline {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.source-auth .btn.outline:hover {
  box-shadow: inset 0 0 0 1.5px var(--muted-2);
}

.source-auth .btn.ghost {
  background: var(--chip);
  color: var(--ink);
  box-shadow: none;
}

.source-auth .btn.lg {
  min-height: 52px;
  padding: 0 22px;
  font-size: 15.5px;
  border-radius: 14px;
}

.source-auth .btn.block {
  width: 100%;
}

.source-auth .btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.source-social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.source-social-row .btn {
  justify-content: center;
}

.source-auth-note {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  background: var(--pri-50);
  color: var(--pri-700);
  font-size: 13px;
  line-height: 1.45;
}

.source-route-status {
  margin: 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .source-auth-shell {
    width: min(100% - 24px, 520px);
    padding-top: 18px;
  }

  .source-auth-card {
    margin-top: 28px;
    padding: 20px;
    border-radius: 24px;
  }

  .source-social-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Native / mobile bottom tab bar (.bk-tabbar) ─────────────────────────────
 * Shown only at mobile widths (and therefore always in the Capacitor app).
 * Injected globally by SourceTabBar in bookuno-source-router.jsx. */
.bk-tabbar { display: none; }

@media (max-width: 720px) {
  .bk-tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9000;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--card, #fff);
    border-top: 1px solid var(--line, #ece9f6);
    box-shadow: 0 -8px 24px rgba(20, 12, 50, 0.06);
    -webkit-backdrop-filter: saturate(1.4) blur(8px);
    backdrop-filter: saturate(1.4) blur(8px);
  }
  .bk-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px 4px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--muted, #6b6b78);
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: -0.01em;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease, background .15s ease, transform .1s ease;
  }
  .bk-tab .bk-tab-ic { display: inline-flex; }
  .bk-tab.act { color: var(--pri, #6B57FF); }
  .bk-tab.act .bk-tab-ic { transform: translateY(-1px); }
  .bk-tab:active { transform: scale(0.94); }

  /* Keep page content clear of the fixed bar. */
  .web { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
}

/* Reduced motion: page transition snaps instead of fading */
@media (prefers-reduced-motion: reduce) {
  .page-fade-in { animation-duration: 0.01ms !important; }
}
