/* ==========================================================================
   KONVITES — Design system "app nativo"
   Mobile-first · tokens · componentes · shell (app bar + tab bar / rail)
   ========================================================================== */

/* ---------- Fontes (self-hosted, funcionam offline) ---------- */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('../fonts/playfair-display-latin.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;

  --bg: #f6f3ed;
  --bg-elev: #fbf9f5;
  --surface: #ffffff;
  --surface-2: #f2eee6;
  --surface-3: #e9e3d8;
  --line: #e7e0d3;
  --line-strong: #d6cdbd;
  --text: #16171f;
  --text-2: #4d505c;
  --muted: #747887;
  --ink: #16171f;
  --ink-2: #262836;
  --on-ink: #ffffff;
  --gold: #c9a84c;
  --gold-2: #e3c878;
  --gold-ink: #7a5d12;
  --gold-soft: #f6edd3;
  --green: #0f7b5f;
  --green-soft: #e3f4ec;
  --red: #c2352b;
  --red-soft: #fdeceb;
  --amber: #a86a06;
  --amber-soft: #fdf1dc;
  --blue: #2457c5;
  --blue-soft: #e7eefc;

  --btn-primary-bg: var(--ink);
  --btn-primary-fg: #fff;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;

  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 30px; --fs-4xl: 36px;

  --shadow-1: 0 1px 2px rgba(22, 23, 31, .05), 0 1px 1px rgba(22, 23, 31, .03);
  --shadow-2: 0 6px 20px rgba(22, 23, 31, .08), 0 2px 6px rgba(22, 23, 31, .04);
  --shadow-3: 0 18px 50px rgba(22, 23, 31, .18), 0 4px 14px rgba(22, 23, 31, .08);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --appbar-h: 56px;
  --tabbar-h: 64px;
  --rail-w: 248px;
  --content-w: 760px;
  --gutter: 16px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 120ms;
  --t-med: 220ms;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101117;
    --bg-elev: #14151c;
    --surface: #1a1c24;
    --surface-2: #22252f;
    --surface-3: #2b2e3a;
    --line: #2a2d38;
    --line-strong: #3a3e4c;
    --text: #f3f0e9;
    --text-2: #c9c7c1;
    --muted: #9a9eab;
    --ink: #f3f0e9;
    --ink-2: #e0ddd5;
    --on-ink: #16171f;
    --gold-ink: #e3c878;
    --gold-soft: #2e2817;
    --green: #4cc9a0;
    --green-soft: #12291f;
    --red: #ff7b72;
    --red-soft: #2e1614;
    --amber: #f0b44c;
    --amber-soft: #2c2210;
    --blue: #8ab0ff;
    --blue-soft: #16213a;
    --btn-primary-bg: var(--gold);
    --btn-primary-fg: #16171f;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 8px 24px rgba(0, 0, 0, .45);
    --shadow-3: 0 20px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

@media (min-width: 1024px) {
  :root { --gutter: 28px; --appbar-h: 64px; }
}

/* ---------- Transições entre páginas (View Transitions, cross-document) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: k-vt-out 160ms var(--ease) both; }
::view-transition-new(root) { animation: k-vt-in 220ms var(--ease-out) both; }
.appbar { view-transition-name: k-appbar; }
.tabbar { view-transition-name: k-tabbar; }
::view-transition-old(k-appbar), ::view-transition-new(k-appbar),
::view-transition-old(k-tabbar), ::view-transition-new(k-tabbar) { animation: none; }
@keyframes k-vt-out { to { opacity: 0; transform: translateX(-12px); } }
@keyframes k-vt-in { from { opacity: 0; transform: translateX(16px); } }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-padding-top: calc(var(--appbar-h) + var(--safe-t) + 16px); }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  text-rendering: optimizeLegibility;
}
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 70%, transparent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.ic { flex: none; }
::selection { background: var(--gold-soft); color: var(--text); }

/* ---------- App shell ---------- */
.app { padding-top: calc(var(--appbar-h) + var(--safe-t)); padding-bottom: calc(var(--s-8) + var(--safe-b)); padding-left: var(--safe-l); padding-right: var(--safe-r); }
@supports not (view-transition-name: none) { .app { animation: k-page-in 260ms var(--ease-out) both; } }
.app.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--s-6)); }
.app.has-bottom-bar { padding-bottom: calc(96px + var(--safe-b)); }
.app.has-tabbar.has-bottom-bar { padding-bottom: calc(var(--tabbar-h) + 96px + var(--safe-b)); }
@keyframes k-page-in { from { opacity: 0; transform: translateY(6px); } }

.page { width: 100%; max-width: var(--content-w); margin: 0 auto; padding: var(--s-2) var(--gutter) 0; }
.page--wide { max-width: 1120px; }
.page--narrow { max-width: 560px; }

/* App bar */
.appbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  padding-top: var(--safe-t);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med), background var(--t-med);
}
.appbar.is-scrolled { border-bottom-color: var(--line); }
.appbar-inner {
  height: var(--appbar-h);
  display: grid; grid-template-columns: minmax(48px, 1fr) auto minmax(48px, 1fr); align-items: center; gap: var(--s-2);
  padding: 0 calc(var(--s-2) + var(--safe-r)) 0 calc(var(--s-2) + var(--safe-l));
  max-width: 1280px; margin: 0 auto;
}
.appbar-lead { display: flex; align-items: center; min-width: 0; }
.appbar-title { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62vw; transition: opacity var(--t-med), transform var(--t-med); }
.appbar--large .appbar-title { opacity: 0; transform: translateY(4px); }
.appbar--large.is-scrolled .appbar-title { opacity: 1; transform: none; }
.appbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.appbar-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--r-full); color: var(--text);
  transition: background var(--t-fast), transform var(--t-fast);
}
.appbar-btn:active { background: var(--surface-2); transform: scale(.94); }
.appbar-back { margin-left: -4px; }
.appbar-btn .badge-count { position: absolute; top: 6px; right: 5px; }
.appbar-link { font-weight: 700; color: var(--gold-ink); padding: 10px 12px; border-radius: var(--r-sm); min-height: 44px; display: inline-flex; align-items: center; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.01em; color: var(--text); padding: 0 8px; line-height: 1; white-space: nowrap; }
.brand span { color: var(--gold); }

/* Large title (estilo iOS) */
.large-title-wrap { padding: var(--s-2) 0 var(--s-4); }
.large-title { font-size: var(--fs-3xl); line-height: 1.12; font-weight: 800; letter-spacing: -.025em; }
.large-title.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
.large-sub { margin-top: 6px; color: var(--muted); font-size: var(--fs-md); }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); }

/* Tab bar */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 45;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 calc(var(--s-1) + var(--safe-r)) var(--safe-b) calc(var(--s-1) + var(--safe-l));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabbar-h); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .01em;
  transition: color var(--t-fast), transform var(--t-fast);
}
.tab:active { transform: scale(.94); }
.tab.is-active { color: var(--text); }
.tab-icon { position: relative; display: grid; place-items: center; width: 56px; height: 30px; border-radius: var(--r-full); transition: background var(--t-med); }
.tab.is-active .tab-icon { background: var(--gold-soft); color: var(--gold-ink); }
.tab-dot { position: absolute; top: 3px; right: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--surface); }
.tab-count { position: absolute; top: -2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-style: normal; font-weight: 800; display: grid; place-items: center; }
.tab-create { color: var(--text); }
.tab-create-btn {
  display: grid; place-items: center; width: 52px; height: 52px; margin-top: -22px;
  border-radius: 18px; background: var(--ink); color: var(--on-ink);
  box-shadow: 0 10px 24px rgba(22, 23, 31, .28), 0 0 0 5px var(--bg);
  transition: transform var(--t-fast);
}
.tab-create .tab-label { margin-top: 1px; }
.tab-create:active .tab-create-btn { transform: scale(.92); }
.rail-brand, .rail-extra { display: none; }

/* Desktop: a tab bar transforma-se em rail lateral */
@media (min-width: 1024px) {
  .app.has-tabbar { padding-left: var(--rail-w); padding-bottom: var(--s-10); }
  .app.has-tabbar .appbar { left: var(--rail-w); }
  .app.has-tabbar.has-bottom-bar { padding-bottom: 120px; }
  .tabbar {
    inset: 0 auto 0 0; width: var(--rail-w); height: 100vh;
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    padding: calc(var(--s-6) + var(--safe-t)) var(--s-4) var(--s-6);
    border-top: 0; border-right: 1px solid var(--line);
    background: var(--surface);
  }
  .rail-brand { display: block; font-size: 26px; padding: 6px 12px 22px; }
  .rail-extra { display: flex; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; height: 48px; padding: 0 10px; border-radius: var(--r-sm); font-size: var(--fs-md); }
  .tab:hover { background: var(--surface-2); color: var(--text); }
  .tab-icon { width: 30px; height: 30px; border-radius: 10px; }
  .tab.is-active { background: var(--surface-2); }
  .tab.is-active .tab-icon { background: transparent; }
  .tab-dot { right: 0; }
  .rail-brand { order: -2; }
  .tab-create { order: -1; flex-direction: row; justify-content: center; gap: 8px; height: 48px; margin: 0 0 14px; padding: 0 14px; border-radius: var(--r-sm); background: var(--ink); color: var(--on-ink); font-size: var(--fs-md); }
  .tab-create:hover { background: var(--ink-2); color: var(--on-ink); }
  .tab-create.is-active { background: var(--ink); }
  .tab-create-btn { width: auto; height: auto; margin: 0; background: transparent; box-shadow: none; color: inherit; border-radius: 0; }
  .tab-create .tab-label { margin: 0; }
  .app.has-tabbar .appbar .appbar-lead .brand { display: none; }
  .rail-install { margin-top: auto; }
  .appbar-title { max-width: 50vw; }
}

/* ---------- Tipografia utilitária ---------- */
.h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.015em; line-height: 1.25; }
.h3 { font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; }
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.bold { font-weight: 700; }
.center { text-align: center; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nums { font-variant-numeric: tabular-nums; }

/* ---------- Secções ---------- */
.section { margin-top: var(--s-6); }
.page > .section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: 0 2px var(--s-3); min-height: 32px; }
.section-title { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.01em; }
.section-label { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 4px var(--s-2); }
.section-link { font-size: var(--fs-sm); font-weight: 700; color: var(--gold-ink); display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 4px; }
.stack > * + * { margin-top: var(--s-3); }
.stack-lg > * + * { margin-top: var(--s-6); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row-wrap { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: var(--s-4) 0; border: 0; }

/* ---------- Cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-pad { padding: var(--s-4); }
.card-pad-lg { padding: var(--s-5); }
.card-title { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.01em; }
.card-sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.card-link { display: block; transition: transform var(--t-fast), box-shadow var(--t-fast); }
.card-link:active { transform: scale(.985); }

.hero-card {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, rgba(201, 168, 76, .38), transparent 55%), linear-gradient(150deg, #1d1f2b 0%, #16171f 60%, #12131a 100%);
  border-radius: var(--r-xl); padding: var(--s-5);
  box-shadow: 0 18px 40px rgba(22, 23, 31, .22);
}
.hero-card .eyebrow { color: var(--gold-2); }
.hero-card h2, .hero-card h1 { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.15; margin-top: 6px; letter-spacing: -.005em; }
.hero-card p { color: rgba(255, 255, 255, .74); font-size: var(--fs-sm); margin-top: 6px; }

/* ---------- Listas (rows estilo nativo) ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.list-row {
  position: relative; display: flex; align-items: center; gap: var(--s-3);
  min-height: 60px; padding: var(--s-3) var(--s-4); width: 100%; text-align: left;
  transition: background var(--t-fast);
}
a.list-row:active, button.list-row:active, .list-row.is-pressable:active { background: var(--surface-2); }
.list-row + .list-row::before { content: ''; position: absolute; top: 0; left: var(--s-4); right: 0; height: 1px; background: var(--line); }
.list-row.has-icon + .list-row.has-icon::before, .list .has-icon + .has-icon::before { left: 64px; }
.row-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); color: var(--text-2); }
.row-icon.gold { background: var(--gold-soft); color: var(--gold-ink); }
.row-icon.green { background: var(--green-soft); color: var(--green); }
.row-icon.red { background: var(--red-soft); color: var(--red); }
.row-icon.blue { background: var(--blue-soft); color: var(--blue); }
.row-icon.amber { background: var(--amber-soft); color: var(--amber); }
.row-icon.ink { background: var(--ink); color: var(--on-ink); }
.row-body { flex: 1; min-width: 0; display: block; }
.row-title, .row-sub { display: block; }
.row-title { font-weight: 700; font-size: var(--fs-md); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title.wrap { white-space: normal; }
.row-sub { color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub.wrap { white-space: normal; }
.row-trail { flex: none; display: flex; align-items: center; gap: var(--s-2); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.row-chev { color: var(--line-strong); margin-right: -6px; }
.list-row.danger .row-title { color: var(--red); }

/* ---------- Botões ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent;
  font-size: var(--fs-md); font-weight: 700; letter-spacing: -.005em; line-height: 1; white-space: nowrap;
  background: var(--surface-2); color: var(--text);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); box-shadow: 0 6px 16px rgba(22, 23, 31, .18); }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1b1608; box-shadow: 0 6px 16px rgba(201, 168, 76, .32); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-tonal { background: var(--gold-soft); color: var(--gold-ink); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-light { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .18); }
.btn-white { background: #fff; color: #16171f; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: var(--fs-lg); border-radius: 16px; padding: 0 24px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: var(--fs-sm); border-radius: 12px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn.is-loading { pointer-events: none; color: transparent !important; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: var(--btn-spinner, rgba(255, 255, 255, .9)) var(--btn-spinner, rgba(255, 255, 255, .9)) transparent transparent;
  animation: k-spin .7s linear infinite;
}
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after, .btn-tonal.is-loading::after, .btn:not(.btn-primary):not(.btn-gold):not(.btn-danger-solid):not(.btn-success).is-loading::after { --btn-spinner: var(--text); }
@keyframes k-spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: var(--s-2); }
.btn-row > .btn { flex: 1; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--surface-2); color: var(--text-2); transition: transform var(--t-fast), background var(--t-fast);
}
.icon-btn:active { transform: scale(.92); background: var(--surface-3); }
.icon-btn.danger { color: var(--red); background: var(--red-soft); }
.icon-btn.plain { background: transparent; }

/* Ações rápidas em grelha (tipo app) */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); }
.quick-action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--r-md); text-align: center; font-size: 12px; font-weight: 700; color: var(--text-2); transition: transform var(--t-fast), background var(--t-fast); min-height: 44px; }
.quick-action:active { transform: scale(.95); background: var(--surface-2); }
.quick-action .qa-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow-1); }
.quick-action.gold .qa-icon { background: var(--gold-soft); border-color: transparent; color: var(--gold-ink); }
.quick-action.ink .qa-icon { background: var(--ink); border-color: transparent; color: var(--on-ink); }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--text-2);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.no-dot::before { display: none; }
.badge-ativo, .badge-confirmado, .badge-aprovado, .badge-success { background: var(--green-soft); color: var(--green); }
.badge-rascunho, .badge-pendente, .badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-arquivado, .badge-cancelado, .badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-recusado, .badge-danger, .badge-reembolsado, .badge-falhado { background: var(--red-soft); color: var(--red); }
.badge-info { background: var(--blue-soft); color: var(--blue); }
.badge-gold { background: var(--gold-soft); color: var(--gold-ink); }
.badge-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; font-style: normal; line-height: 1; }

.chips { display: flex; gap: var(--s-2); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 15px; border-radius: var(--r-full); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.chip:active { transform: scale(.96); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip .chip-count { font-size: 11px; opacity: .7; }

/* Segmented control */
.segmented { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-2); }
.segmented > * {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 10px;
  border-radius: 11px; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); transition: background var(--t-med), color var(--t-med), box-shadow var(--t-med);
}
.segmented > .is-active, .segmented > [aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- Formulários ---------- */
.form-stack > * + * { margin-top: var(--s-4); }
.field { display: block; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); margin: 0 2px 7px; }
.field-label .opt { font-weight: 500; color: var(--muted); font-size: var(--fs-xs); }
.field-hint { font-size: var(--fs-xs); color: var(--muted); margin: 6px 2px 0; line-height: 1.45; }
.field-error { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--red); font-weight: 600; margin: 6px 2px 0; }
.input, .select, .textarea,
.k input[type="text"]:not(.raw), .k input[type="email"]:not(.raw), .k input[type="password"]:not(.raw), .k input[type="tel"]:not(.raw),
.k input[type="number"]:not(.raw), .k input[type="url"]:not(.raw), .k input[type="date"]:not(.raw), .k input[type="time"]:not(.raw),
.k input[type="search"]:not(.raw), .k input:not([type]):not(.raw), .k select:not(.raw), .k textarea:not(.raw) {
  display: block; width: 100%; min-height: 52px; padding: 13px 15px;
  font-size: 16px; /* evita zoom no iOS */ line-height: 1.35; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 14px;
  outline: 0; -webkit-appearance: none; appearance: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.k textarea:not(.raw), .textarea { min-height: 112px; resize: vertical; }
.k select:not(.raw), .select { padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23747887' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.k input::placeholder, .k textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.k input:focus:not(.raw), .k select:focus:not(.raw), .k textarea:focus:not(.raw), .input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent);
}
.k input[readonly]:not(.raw) { background: var(--surface-2); color: var(--text-2); }
.k .is-invalid, .k input.is-invalid { border-color: var(--red) !important; }
.k input[type="file"]:not(.raw) { padding: 12px; font-size: 14px; min-height: 52px; border-style: dashed; background: var(--surface-2); cursor: pointer; }
.k input[type="file"]::file-selector-button { font: inherit; font-weight: 700; font-size: 13px; border: 0; border-radius: 10px; padding: 8px 12px; margin-right: 10px; background: var(--ink); color: var(--on-ink); cursor: pointer; }
.input-group { position: relative; }
.input-group > .ic, .input-group > .input-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-group > input { padding-left: 46px !important; }
.input-group .input-action { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); border-radius: 12px; }
.input-group.has-action > input { padding-right: 50px !important; }
.search-field { position: relative; }
.search-field input { padding-left: 44px !important; min-height: 46px !important; border-radius: 14px !important; background: var(--surface-2) !important; border-color: transparent !important; }
.search-field input:focus { background: var(--surface) !important; border-color: var(--gold) !important; }
.search-field > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Switch nativo */
.switch { position: relative; flex: none; width: 52px; height: 32px; -webkit-appearance: none; appearance: none; border-radius: 16px; background: var(--surface-3); border: 0; cursor: pointer; transition: background var(--t-med); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform var(--t-med) var(--ease); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); min-height: 60px; cursor: pointer; }

/* Checkbox / radio cards */
.check-card { display: flex; align-items: center; gap: var(--s-3); padding: 14px var(--s-4); min-height: 56px; border: 1.5px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast); }
.check-card:active { transform: scale(.985); }
.check-card input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.check-card:has(input:checked) { border-color: var(--ink); background: var(--gold-soft); }
.check-card .cc-body { flex: 1; min-width: 0; }
.check-card .cc-title { font-weight: 700; display: block; }
.check-card .cc-sub { font-size: var(--fs-sm); color: var(--muted); display: block; }

/* Barra fixa inferior (CTA principal) */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 38;
  padding: var(--s-3) calc(var(--gutter) + var(--safe-r)) calc(var(--s-3) + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
  transition: transform var(--t-med) var(--ease-out), opacity var(--t-med);
}
.has-tabbar .bottom-bar { bottom: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--s-3); }
.bottom-bar-inner { max-width: var(--content-w); margin: 0 auto; display: flex; gap: var(--s-2); align-items: center; }
.bottom-bar-inner > .btn { flex: 1; }
.bottom-bar-inner > .btn.btn-fit { flex: none; }
.bottom-bar .bb-meta { flex: 1; min-width: 0; }
.bottom-bar .bb-meta small { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.bottom-bar .bb-meta strong { display: block; font-size: var(--fs-lg); font-weight: 800; }
.bottom-bar.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
@media (min-width: 1024px) {
  .has-tabbar .bottom-bar { left: var(--rail-w); bottom: 0; padding-bottom: calc(var(--s-3) + var(--safe-b)); }
}

/* FAB */
.fab { position: fixed; right: calc(var(--gutter) + var(--safe-r)); bottom: calc(var(--s-4) + var(--safe-b)); z-index: 37; display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 20px 0 16px; border-radius: 18px; background: var(--ink); color: var(--on-ink); font-weight: 800; box-shadow: var(--shadow-3); transition: transform var(--t-fast); }
.fab:active { transform: scale(.95); }
.has-tabbar .fab { bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--s-4)); }
@media (min-width: 1024px) { .has-tabbar .fab { bottom: var(--s-8); right: var(--s-8); } }

/* ---------- Estatísticas ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.stats.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stats.cols-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .stats.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 14px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); min-width: 0; }
.stat strong { display: block; font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.stat.warn strong { color: var(--amber); }
.stat.good strong { color: var(--green); }
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > span, .progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--green)); transition: width .6s var(--ease-out); }

/* Ring */
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255, 255, 255, .12) 0); position: relative; flex: none; }
.ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #191a24; }
.ring b { position: relative; font-size: 15px; font-weight: 800; color: #fff; }

/* ---------- Estado vazio ---------- */
.empty { text-align: center; padding: var(--s-8) var(--s-5); }
.empty-art { width: 120px; height: 120px; margin: 0 auto var(--s-4); }
.empty-title { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.015em; }
.empty-text { color: var(--muted); max-width: 320px; margin: 6px auto 0; font-size: var(--fs-md); }
.empty .btn { margin-top: var(--s-5); }

/* ---------- Avisos inline ---------- */
.notice { display: flex; gap: var(--s-3); align-items: flex-start; padding: 14px var(--s-4); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.notice .ic { margin-top: 1px; }
.notice strong { color: var(--text); }
.notice-gold { background: var(--gold-soft); color: var(--gold-ink); }
.notice-gold strong { color: inherit; }
.notice-red { background: var(--red-soft); color: var(--red); }
.notice-green { background: var(--green-soft); color: var(--green); }
.notice-blue { background: var(--blue-soft); color: var(--blue); }
.notice a { font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; left: 0; right: 0; top: calc(var(--appbar-h) + var(--safe-t) + 8px); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 var(--gutter); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; width: min(480px, 100%);
  padding: 12px 14px 12px 12px; border-radius: 16px; background: #1d1f29; color: #fff;
  box-shadow: var(--shadow-3); font-size: var(--fs-sm); font-weight: 600; line-height: 1.4;
  animation: k-toast-in 320ms var(--ease-out) both;
}
.toast .toast-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: rgba(255, 255, 255, .1); }
.toast.success .toast-icon { background: #1f6f55; }
.toast.error .toast-icon { background: #a0322a; }
.toast.warning .toast-icon { background: #8a5f12; }
.toast .toast-text { flex: 1; }
.toast .toast-close { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: rgba(255, 255, 255, .6); margin: -6px -6px -6px 0; }
.toast.is-leaving { animation: k-toast-out 220ms var(--ease) both; }
@keyframes k-toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes k-toast-out { to { opacity: 0; transform: translateY(-10px) scale(.97); } }
@media (prefers-color-scheme: dark) { .toast { background: #2a2d39; } }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(10, 11, 16, .46); opacity: 0; transition: opacity var(--t-med); }
.sheet-backdrop.is-open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 96; max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-3);
  padding: 8px calc(var(--gutter) + var(--safe-r)) calc(var(--s-5) + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
  transform: translateY(105%); transition: transform 320ms var(--ease-out);
}
.sheet.is-open { transform: translateY(0); }
.sheet-grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 4px auto 14px; }
.sheet-title { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.015em; text-align: center; }
.sheet-text { color: var(--muted); text-align: center; margin: 6px auto 0; max-width: 360px; font-size: var(--fs-md); }
.sheet-actions { display: grid; gap: var(--s-2); margin-top: var(--s-5); }
.sheet .list { box-shadow: none; }
.sheet-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin: 4px auto 14px; background: var(--surface-2); }
.sheet-icon.danger { background: var(--red-soft); color: var(--red); }
.sheet-icon.gold { background: var(--gold-soft); color: var(--gold-ink); }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; bottom: 50%; width: min(440px, 92vw); border-radius: 26px; transform: translate(-50%, 60%) scale(.96); opacity: 0; transition: transform 260ms var(--ease-out), opacity 200ms; padding-bottom: var(--s-5); }
  .sheet.is-open { transform: translate(-50%, 50%); opacity: 1; }
  .sheet-grabber { display: none; }
}
body.sheet-open { overflow: hidden; }

/* Passos de instalação iOS */
.install-steps { counter-reset: s; display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.install-steps li { list-style: none; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); font-weight: 600; font-size: var(--fs-sm); }
.install-steps li::before { counter-increment: s; content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); font-weight: 800; font-size: 13px; }

/* ---------- Stepper (fluxo de criação) ---------- */
.stepper { padding: 2px var(--gutter) 10px; max-width: 1280px; margin: 0 auto; }
.stepper-meta { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.stepper-meta b { color: var(--text); }
.stepper-bars { display: flex; gap: 5px; }
.stepper-bars i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; position: relative; }
.stepper-bars i.done, .stepper-bars i.active { background: var(--gold); }
.stepper-bars i.active::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); animation: k-shimmer 1.6s infinite; }
.app.has-stepper { padding-top: calc(var(--appbar-h) + var(--safe-t) + 34px); }

/* ---------- Navegação: barra de progresso + skeleton ---------- */
.nav-progress { position: fixed; top: 0; left: 0; z-index: 100; height: 3px; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-2)); box-shadow: 0 0 10px rgba(201, 168, 76, .6); opacity: 0; transition: opacity 200ms; pointer-events: none; }
.nav-progress.is-active { opacity: 1; animation: k-nav 8s cubic-bezier(.08, .82, .17, 1) forwards; }
@keyframes k-nav { 0% { width: 0; } 10% { width: 35%; } 40% { width: 70%; } 100% { width: 92%; } }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); animation: k-shimmer 1.3s infinite; }
@keyframes k-shimmer { 100% { transform: translateX(100%); } }

/* Overlay de carregamento em ecrã inteiro */
.loading-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: var(--s-6); background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity var(--t-med); }
.loading-overlay.is-active, .loading-overlay.show, .loading-overlay.active { opacity: 1; pointer-events: auto; }
.loading-card { width: min(360px, 100%); text-align: center; padding: var(--s-6); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-3); }
.loading-card h2, .loading-card strong { display: block; font-size: var(--fs-lg); font-weight: 800; margin-top: var(--s-4); }
.loading-card p, .loading-card span { display: block; color: var(--muted); font-size: var(--fs-sm); margin-top: 6px; }
.spinner { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--gold); animation: k-spin .8s linear infinite; }

/* ---------- Avatar ---------- */
.avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1b1608; font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }

/* ---------- Cartão de evento ---------- */
.event-card { display: block; padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); transition: transform var(--t-fast); }
.event-card:active { transform: scale(.985); }
.event-card-top { display: flex; align-items: flex-start; gap: var(--s-3); }
.event-thumb { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--gold-soft); color: var(--gold-ink); }
.event-card-body { flex: 1; min-width: 0; }
.event-name { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.01em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; color: var(--muted); font-size: var(--fs-sm); }
.event-meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.event-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: var(--s-4) 0 var(--s-3); }
.event-mini div { text-align: center; padding: 8px 2px; border-radius: 12px; background: var(--surface-2); }
.event-mini b { display: block; font-size: var(--fs-lg); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.event-mini span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* ---------- Ecrã de autenticação / onboarding ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #16171f; }
.auth-hero { position: relative; color: #fff; padding: calc(var(--safe-t) + 20px) var(--s-6) 52px; background: radial-gradient(110% 80% at 100% 0%, rgba(201, 168, 76, .42), transparent 55%), linear-gradient(160deg, #1f2130, #16171f 70%); overflow: hidden; }
.auth-hero::after { content: ''; position: absolute; right: -60px; bottom: -80px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(227, 200, 120, .22); box-shadow: 0 0 0 28px rgba(227, 200, 120, .05), 0 0 0 56px rgba(227, 200, 120, .03); }
.auth-hero .brand { color: #fff; padding: 0; font-size: 24px; }
.auth-hero-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.auth-hero h1 { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.08; margin-top: 34px; max-width: 420px; position: relative; z-index: 1; }
.auth-hero p { color: rgba(255, 255, 255, .72); margin-top: 10px; max-width: 420px; font-size: var(--fs-md); position: relative; z-index: 1; }
.auth-sheet { position: relative; flex: 1; margin-top: -28px; background: var(--bg); border-radius: 28px 28px 0 0; padding: var(--s-6) var(--s-6) calc(var(--s-8) + var(--safe-b)); animation: k-sheet-up 420ms var(--ease-out) both; }
@keyframes k-sheet-up { from { transform: translateY(30px); opacity: .4; } }
.auth-sheet-inner { max-width: 440px; margin: 0 auto; }
.auth-title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); margin-top: 4px; font-size: var(--fs-md); }
.auth-links { display: grid; gap: 4px; margin-top: var(--s-5); text-align: center; }
.auth-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 700; font-size: var(--fs-md); color: var(--text-2); }
.auth-links a.strong { color: var(--gold-ink); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: var(--s-5) 0 var(--s-2); }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-back { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .1); }
@media (min-width: 900px) {
  .auth { flex-direction: row; }
  .auth-hero { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px; }
  .auth-hero h1 { font-size: 52px; margin-top: 0; }
  .auth-hero-top { position: absolute; top: 40px; left: 56px; right: 56px; }
  .auth-hero .auth-copy { margin: auto 0; }
  .auth-sheet { flex: 0 0 520px; margin: 0; border-radius: 0; display: flex; align-items: center; padding: 56px; }
  .auth-sheet-inner { width: 100%; }
}

/* ---------- Páginas para convidados (RSVP / bilhete) ---------- */
.guest { min-height: 100vh; min-height: 100dvh; background: radial-gradient(120% 50% at 50% 0%, rgba(201, 168, 76, .2), transparent 60%), var(--bg); padding: calc(var(--safe-t) + var(--s-5)) var(--gutter) calc(var(--safe-b) + var(--s-8)); }
.guest-wrap { max-width: 520px; margin: 0 auto; }
.guest-head { text-align: center; padding: var(--s-4) var(--s-2) var(--s-5); }
.guest-head .eyebrow { justify-content: center; }
.guest-head h1 { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.12; margin-top: 8px; letter-spacing: -.005em; }
.guest-head p { color: var(--muted); margin-top: 8px; }
.guest-foot { text-align: center; margin-top: var(--s-6); font-size: var(--fs-xs); color: var(--muted); }
.guest-foot .brand { font-size: 15px; padding: 0; }

/* ---------- Tabelas responsivas → cartões ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* ---------- Utilitários ---------- */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); } .mt-8 { margin-top: var(--s-8); }
.mb-2 { margin-bottom: var(--s-2); } .mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); }
.w-full { width: 100%; }
.only-desktop { display: none !important; }
@media (min-width: 1024px) { .only-desktop { display: revert !important; } .only-mobile { display: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.h-scroll { display: flex; gap: var(--s-3); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 8px; -webkit-overflow-scrolling: touch; }
.h-scroll::-webkit-scrollbar { display: none; }
.h-scroll > * { scroll-snap-align: start; flex: none; }
.tap { transition: transform var(--t-fast); }
.tap:active { transform: scale(.97); }

/* Hover só em dispositivos com rato (sem affordances dependentes de hover em touch) */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(1.04); }
  .btn-secondary:hover, .btn-ghost:hover { background: var(--surface-2); filter: none; }
  a.list-row:hover, button.list-row:hover { background: var(--bg-elev); }
  .event-card:hover, .card-link:hover { box-shadow: var(--shadow-2); }
  .chip:hover { border-color: var(--text-2); }
  .appbar-btn:hover { background: var(--surface-2); }
}

/* Movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

/* Modo standalone (app instalada): esconder convites para instalar */
@media (display-mode: standalone) { [data-install] { display: none !important; } }

/* Quando há uma barra de ação inferior visível, o botão central "Criar" deixa de sobressair */
@media (max-width: 1023px) {
  body:has(.bottom-bar:not(.is-hidden):not(.landing-bar)) .tab-create-btn { margin-top: 0; width: 48px; height: 40px; border-radius: 14px; box-shadow: none; }
}
