/* ============================================================
   Go Digital — Custom Styles
   Design tokens: Void #0A0E1A · Signal Violet #6C5CE7 ·
   Tap Cyan #22D3EE · Ivory #F5F3FF · Slate #8B92B0
   ============================================================ */

:root {
  --void: #0A0E1A;
  --void-soft: #10162A;
  --violet: #6C5CE7;
  --cyan: #22D3EE;
  --ivory: #F5F3FF;
  --slate: #8B92B0;
  --whatsapp: #25D366;
  --danger: #F87171;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--void);
  color: var(--ivory);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-display { font-family: 'Space Grotesk', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Background ambience ---------- */
.bg-void { background-color: var(--void); }
.bg-void-soft { background-color: var(--void-soft); }

.ambient-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px circle at 15% 10%, rgba(108, 92, 231, 0.18), transparent 60%),
    radial-gradient(500px circle at 85% 30%, rgba(34, 211, 238, 0.12), transparent 60%);
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: rgba(245, 243, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 243, 255, 0.08);
}

.glass-strong {
  background: rgba(16, 22, 42, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 243, 255, 0.1);
}

/* ---------- Signature: the tilting hero card ---------- */
.tilt-stage {
  perspective: 1400px;
}

.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
  will-change: transform;
  box-shadow: 0 30px 60px -20px rgba(108, 92, 231, 0.35), 0 10px 30px -10px rgba(0,0,0,0.5);
}

.tilt-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.16) 35%, rgba(34,211,238,0.25) 45%, transparent 60%);
  background-size: 250% 250%;
  background-position: 0% 0%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.9;
  transition: background-position 0.15s ease-out;
}

.card-gradient {
  background: linear-gradient(135deg, #6C5CE7 0%, #4C3FD6 40%, #22D3EE 100%);
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: linear-gradient(135deg, var(--violet), #4C3FD6);
  color: var(--ivory);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 8px 24px -8px rgba(108, 92, 231, 0.6);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.btn-ghost {
  border: 1px solid rgba(245, 243, 255, 0.16);
  color: var(--ivory);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-ghost:hover { background: rgba(245, 243, 255, 0.06); border-color: rgba(245,243,255,0.3); }
.btn-ghost:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.btn-whatsapp {
  background: var(--whatsapp);
  color: #06210F;
}
.btn-whatsapp:hover { filter: brightness(1.08); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Inputs ---------- */
.input-field {
  background: rgba(245, 243, 255, 0.04);
  border: 1px solid rgba(245, 243, 255, 0.14);
  color: var(--ivory);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.input-field::placeholder { color: rgba(139, 146, 176, 0.7); }
.input-field:focus {
  border-color: var(--cyan);
  background: rgba(245, 243, 255, 0.06);
  outline: none;
}

/* ---------- Slug pill ---------- */
.slug-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

/* ---------- Step numbers (justified: real 3-step sequence) ---------- */
.step-index {
  font-family: 'Space Grotesk', sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 1px rgba(245, 243, 255, 0.35);
  color: transparent;
}

/* ---------- Toggle switch (publish/unpublish) ---------- */
.toggle-track {
  width: 46px; height: 26px; border-radius: 999px;
  background: rgba(245, 243, 255, 0.14);
  position: relative;
  transition: background 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle-track.on { background: var(--violet); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ivory);
  transition: transform 0.2s ease;
}
.toggle-track.on .toggle-thumb { transform: translateX(20px); }

/* ---------- Status badge ---------- */
.badge-live {
  background: rgba(37, 211, 102, 0.12);
  color: #4ADE80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.badge-draft {
  background: rgba(139, 146, 176, 0.12);
  color: var(--slate);
  border: 1px solid rgba(139, 146, 176, 0.25);
}
.badge-blocked {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

/* ---------- Public card page ---------- */
.public-card-shell {
  background: linear-gradient(180deg, var(--void-soft) 0%, var(--void) 100%);
}

.action-tile {
  transition: transform 0.15s ease, background 0.15s ease;
}
.action-tile:hover { transform: translateY(-3px); }

/* ---------- Generic digital card shell (theme CSS files style it) ---------- */
.gd-card {
  border-radius: 24px;
  overflow: hidden;
  background: var(--card-panel-bg, var(--void-soft));
  color: var(--card-fg, var(--ivory));
}
.gd-card-top {
  position: relative;
  padding: 24px;
  padding-bottom: 32px;
  background: var(--card-bg, linear-gradient(135deg, #6C5CE7, #22D3EE));
  color: var(--card-fg, #fff);
}
.gd-card-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1.1rem;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.35);
  position: relative; z-index: 1;
}
.gd-card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem; font-weight: 600; line-height: 1.2;
}
.gd-card-tagline { font-size: 0.85rem; opacity: 0.8; margin-top: 2px; }
.gd-card-heading {
  position: relative; z-index: 1; /* stays above any theme's decorative shapes */
  min-width: 0; /* lets long names/taglines truncate instead of overflowing */
}
.gd-card-body {
  padding: 24px;
  background: var(--card-panel-bg, var(--void-soft));
  color: var(--card-muted, var(--slate));
}
.gd-card-actions {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 18px;
}
.gd-card-action {
  border-radius: 12px; padding: 12px 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11px;
  background: rgba(128,128,128,0.1);
  color: var(--card-fg, var(--ivory));
  transition: transform 0.15s ease;
}
.gd-card-action:hover { transform: translateY(-2px); }
.gd-card-action.gd-action-whatsapp { background: var(--wa); color: #06210F; }
.gd-card-detail {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.88rem; padding: 8px 0;
  color: var(--card-fg, var(--ivory));
}
.gd-card-chip {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 0.75rem; margin: 3px 4px 3px 0;
  background: rgba(128,128,128,0.14);
  color: var(--card-accent, var(--cyan));
  border: 1px solid rgba(128,128,128,0.25);
}
.gd-card-social {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(128,128,128,0.12);
  color: var(--card-fg, var(--ivory));
}
.gd-card-qr-embed {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 10px; padding: 8px; margin-top: 16px;
  width: fit-content;
}

/* ---------- Theme picker (dashboard) ---------- */
.theme-option {
  cursor: pointer;
  border-radius: 16px;
  border: 2px solid transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
  overflow: hidden;
}
.theme-option:hover { transform: translateY(-2px); }
.theme-option.selected { border-color: var(--cyan); }
.theme-option-swatch { height: 64px; }

/* ---------- Broadcast banner (dashboard) ---------- */
.broadcast-card {
  border-left: 3px solid var(--violet);
  background: rgba(108, 92, 231, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
}

/* ---------- Profile-complete modal (Google signup gate) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,14,26,0.85);
  z-index: 90; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
/* Beats Tailwind's .hidden reliably — same-specificity class rules would
   otherwise fight based on injection order, which is what caused modals
   to sometimes render open/mis-centered instead of hidden. */
.modal-backdrop.hidden { display: none !important; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: rgba(245,243,255,0.15); border-radius: 999px; }

/* ---------- View visibility (router) ----------
   Only ever set display:none on the OFF state — never force a specific
   display value on the ON state. Views like #view-auth rely on Tailwind's
   `flex` utility for centering; a same-specificity ".view.active{display:
   block}" rule was overriding that utility and breaking centering. */
.view:not(.active) { display: none !important; }

/* ---------- Loader ---------- */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(245,243,255,0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
#toast-container {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 8px;
  width: 92%; max-width: 380px;
}
.toast {
  padding: 12px 16px; border-radius: 12px;
  font-size: 0.9rem;
  animation: toast-in 0.25s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Table ---------- */
.admin-table th { color: var(--slate); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-table tr { border-bottom: 1px solid rgba(245,243,255,0.06); }
.admin-table tr:hover { background: rgba(245,243,255,0.02); }

/* Large touch targets on mobile */
@media (max-width: 640px) {
  .btn-primary, .btn-ghost, .btn-whatsapp { min-height: 46px; }
}
