/* Banvio — mobile-first base styles. Classic luxury: navy, violet, warm white, Inter. */
:root {
  --navy: #1E2A4A;
  --navy-soft: #3A4668;
  --violet: #6B3FA0;
  --violet-dark: #54307F;
  --violet-tint: #F1EBF8;
  --paper: #FBFAF7;
  --surface: #FFFFFF;
  --line: #E4E1EA;
  --text: #1E2A4A;
  --muted: #5E6478;
  --danger: #B42318;
  --danger-tint: #FDECEA;
  --ok-tint: #ECF6EF;
  --radius: 14px;
  --tap: 52px;
  --shadow: 0 1px 2px rgba(30, 42, 74, .06), 0 4px 16px rgba(30, 42, 74, .06);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 17px; line-height: 1.5; background: var(--paper); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
p { margin: 0 0 1rem; }
a { color: var(--violet); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Wordmark: "Ban" navy, "vio" violet */
.wordmark { font-weight: 700; font-size: 2rem; letter-spacing: -.02em; margin: 0; }
.wordmark .ban { color: var(--navy); }
.wordmark .vio { color: var(--violet); }
.wordmark--small { font-size: 1.05rem; }

/* Sign-in screens */
body.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; background: var(--surface); border-radius: 20px; padding: 28px 22px; box-shadow: var(--shadow); }
.auth-brand { text-align: center; margin-bottom: 20px; }
.business-logo { max-width: 180px; max-height: 72px; object-fit: contain; }
.business-name { font-weight: 700; font-size: 1.3rem; margin: 0; }
.auth-foot { text-align: center; margin-top: 20px; color: var(--muted); font-size: .85rem; display: flex; flex-direction: column; gap: 2px; }

/* Forms: large, thumb-friendly */
.stack > * + * { margin-top: 14px; }
.field { display: block; }
.field span { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
input, select { width: 100%; min-height: var(--tap); padding: 12px 14px; font: inherit; color: inherit; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
input:focus, select:focus { outline: 3px solid var(--violet-tint); border-color: var(--violet); }
.code-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.secret-key { font-family: ui-monospace, Menlo, monospace; font-size: 1.05rem; background: var(--violet-tint); padding: 12px; border-radius: 10px; text-align: center; word-break: break-all; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 20px; border-radius: 12px; font: inherit; font-weight: 600; border: 0; cursor: pointer; text-decoration: none; }
.btn--block { width: 100%; }
.btn--primary { background: var(--violet); color: #fff; }
.btn--primary:active { background: var(--violet-dark); }
.btn--secondary { background: var(--violet-tint); color: var(--violet-dark); }
.btn--ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn--link { background: none; color: var(--muted); min-height: 44px; width: 100%; margin-top: 8px; }
.btn:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

.notice { padding: 12px 14px; border-radius: 10px; background: var(--ok-tint); }
.notice--error { background: var(--danger-tint); color: var(--danger); }

/* Signed-in app */
body.app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-business { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-logo { height: 28px; width: auto; }
.topbar-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page { max-width: 760px; margin: 0 auto; padding: 20px 16px; }
.page > section + section, .page > * + section { margin-top: 24px; }
.hello h1 { margin-bottom: .25rem; }
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.switcher { display: grid; gap: 12px; }
.inline-form { display: grid; gap: 12px; }
.section-title { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.module-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
.module-tile { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 4px; border-left: 4px solid var(--violet); }
.module-name { font-weight: 600; }
.module-desc { color: var(--muted); font-size: .92rem; }
.badge { justify-self: start; margin-top: 6px; font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--violet-tint); color: var(--violet-dark); }
.error-card { text-align: center; }
.error-code { font-size: 3rem; font-weight: 700; color: var(--violet); margin: 0; }

/* Page headers, lists, groups */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-weight: 500; }
.quick-links { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 0 18px; }
.quick-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 12px 16px; color: inherit; text-decoration: none; }
a.list-row:active { background: var(--violet-tint); }
.list-row--add { color: var(--violet); font-weight: 600; }
.list-main { display: grid; gap: 2px; min-width: 0; }
.list-title { font-weight: 600; }
.list-sub { color: var(--muted); font-size: .9rem; margin: 0; overflow-wrap: anywhere; }
.list-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--violet-tint); color: var(--violet-dark); white-space: nowrap; }
.pill--warn { background: #FFF4E5; color: #8A4B00; }
.pill--muted { background: #EEF0F4; color: var(--muted); }
.group + .group { margin-top: 24px; }
.group-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.group-head h2 { margin: 0; }
.btn--small { min-height: 44px; padding: 0 14px; font-size: .9rem; }
.btn--danger { background: var(--danger-tint); color: var(--danger); }
.danger-zone { margin-top: 20px; }
.facts { display: grid; gap: 10px; margin: 12px 0 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.copy-field { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.link-card { border: 2px solid var(--violet); }
textarea { width: 100%; padding: 12px 14px; font: inherit; color: inherit; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); resize: vertical; }
.check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 6px 0; cursor: pointer; }
.check input { width: 24px; height: 24px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--violet); }
.check small { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
fieldset.choice { border: 0; padding: 0; margin: 0; }
fieldset.choice legend { font-weight: 600; font-size: .95rem; margin-bottom: 4px; padding: 0; }
.two-col, .three-col { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.three-col { grid-template-columns: repeat(3, 1fr); }
.more-fields summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--violet); cursor: pointer; }
.more-fields[open] summary { margin-bottom: 8px; }
.more-fields > * + * { margin-top: 14px; }
.empty { text-align: center; color: var(--muted); }

/* Bottom navigation, within thumb reach */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--navy); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 64px; color: #C9CEDD; text-decoration: none; font-size: .78rem; font-weight: 500; }
.bottom-nav-item.is-active { color: #fff; }
.bottom-nav-item.is-active .icon { background: var(--violet); }
.bottom-nav-item.is-disabled { opacity: .45; pointer-events: none; }
.icon { width: 26px; height: 6px; border-radius: 3px; background: #C9CEDD; display: block; }

@media (min-width: 640px) {
  .module-grid { grid-template-columns: 1fr 1fr; }
  .switcher, .inline-form { grid-template-columns: 1fr auto; align-items: end; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
