/* ─────────────────────────────────────────────────────────
   SORTIGITAL SaaS — Design system
   Paleta EXACTA del landing · Solo modo oscuro
   ───────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ── TOKENS ────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  --bg: #08091A;
  --surface: #0F1229;
  --surface-2: #161A35;
  --surface-3: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.07);
  --border-gold: rgba(242, 168, 0, 0.35);
  --border-mint: rgba(0, 255, 55, 0.35);
  --border-coral: rgba(255, 61, 90, 0.30);

  --gold: #F2A800;
  --gold-dim: rgba(242, 168, 0, 0.10);
  --gold-glow: rgba(242, 168, 0, 0.30);

  --coral: #FF3D5A;
  --coral-dim: rgba(255, 61, 90, 0.12);
  --coral-glow: rgba(255, 61, 90, 0.28);

  --mint: #00D68F;
  --mint-dim: rgba(0, 214, 143, 0.12);
  --mint-glow: rgba(0, 214, 143, 0.25);

  --text: #EEEEFF;
  --text-muted: #b4b7d1;
  --text-faint: rgba(238, 238, 255, 0.28);

  --nav-blur-bg: rgba(8, 9, 26, 0.90);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --nav-h: 62px;
}

/* ── RESET ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── NOISE GRAIN — capa premium sobre todo ──────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── ANIMATIONS ─────────────────────────────────────────── */
@keyframes float-glow {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(60px, -50px) scale(1.08);
  }

  66% {
    transform: translate(-40px, 40px) scale(0.93);
  }
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-scale {
  from {
    opacity: 0;
    transform: scale(0.93);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes reveal-right {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pip-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .45;
    transform: scale(.65);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tick-glow {

  0%,
  100% {
    text-shadow: 0 0 8px var(--gold-glow);
  }

  50% {
    text-shadow: 0 0 24px var(--gold-glow), 0 0 48px var(--gold-glow);
  }
}

@keyframes fc-float-1 {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-10px)
  }
}

@keyframes fc-float-2 {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-8px)
  }
}

.reveal {
  animation: reveal-up 0.55s cubic-bezier(.25, .8, .25, 1) both;
}

.reveal-scale {
  animation: reveal-scale 0.50s cubic-bezier(.25, .8, .25, 1) both;
}

.reveal-right {
  animation: reveal-right 0.50s cubic-bezier(.25, .8, .25, 1) both;
}

.d1 {
  animation-delay: .06s;
}

.d2 {
  animation-delay: .13s;
}

.d3 {
  animation-delay: .20s;
}

.d4 {
  animation-delay: .27s;
}

.d5 {
  animation-delay: .34s;
}

.d6 {
  animation-delay: .41s;
}

/* ── BACKGROUND SCENE ───────────────────────────────────── */
.bg-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(242, 168, 0, .055) 1px, transparent 1px);
  background-size: 28px 28px;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: float-glow linear infinite;
}

.bg-glow-gold {
  width: 860px;
  height: 860px;
  top: -280px;
  right: -220px;
  background: radial-gradient(circle, rgba(242, 168, 0, .14) 0%, rgba(242, 168, 0, .04) 45%, transparent 65%);
  animation-duration: 26s;
}

.bg-glow-coral {
  width: 700px;
  height: 700px;
  bottom: -240px;
  left: -180px;
  background: radial-gradient(circle, rgba(255, 61, 90, .10) 0%, rgba(255, 61, 90, .03) 45%, transparent 65%);
  animation-duration: 20s;
  animation-delay: -10s;
}

.bg-glow-mint {
  width: 420px;
  height: 420px;
  top: 40%;
  left: 25%;
  background: radial-gradient(circle, rgba(0, 214, 143, .05) 0%, transparent 65%);
  animation-duration: 34s;
  animation-delay: -5s;
}

/* ── NAV ─────────────────────────────────────────────────── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--nav-blur-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -.04em;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}

.nav-pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow);
  animation: pip-pulse 2.4s ease-in-out infinite;
}

.nav-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-user {
  font-size: .82rem;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .63rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 4px 10px;
  border-radius: 100px;
}

.badge-test {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.badge-prod {
  background: var(--mint-dim);
  color: var(--mint);
  border: 1px solid rgba(0, 214, 143, .3);
}

.badge-live {
  background: var(--coral-dim);
  color: var(--coral);
  border: 1px solid var(--border-coral);
}

.badge-done {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-super {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: 'Outfit', inherit;
  font-size: .9rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  transition: opacity .2s, transform .2s, box-shadow .2s;
  text-decoration: none;
  letter-spacing: .2px;
}

.btn:hover {
  opacity: .88;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
  opacity: .78;
}

.btn:disabled {
  opacity: .38;
  cursor: not-allowed;
  transform: none !important;
}

/* Primary: gold bg, black text — igual al landing */
.btn-gold {
  background: var(--gold);
  color: #000 !important;
  box-shadow: 0 6px 20px var(--gold-glow);
}

.btn-gold:hover {
  box-shadow: 0 10px 30px var(--gold-glow);
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-2);
  transform: none;
  opacity: 1;
}

/* Danger */
.btn-danger {
  background: var(--coral-dim);
  color: var(--coral);
  border: 1px solid var(--border-coral);
}

.btn-danger:hover {
  background: rgba(255, 61, 90, .2);
}

/* Sizes */
.btn-sm {
  font-size: .78rem;
  padding: 7px 14px;
  border-radius: var(--r-sm);
}

.btn-lg {
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: var(--r-lg);
}

.btn-block {
  width: 100%;
}

/* ── FORMS ───────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.form-input,
.form-select,
.form-textarea {
  font-family: 'Outfit', inherit;
  font-size: .92rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-faint);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: .73rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* Mode toggle */
.mode-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
}

.mode-option {
  flex: 1;
  display: flex;
}

.mode-option input {
  position: absolute;
  opacity: 0;
}

.mode-option label {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  transition: background .2s, color .2s;
}

.mode-option:has(input:checked) label {
  background: var(--gold);
  color: #000;
  box-shadow: 0 2px 10px var(--gold-glow);
}

/* ── AUTH — split layout ─────────────────────────────────── */
.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 420px 1fr;
  position: relative;
  z-index: 1;
}

.auth-panel-left {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 48px;
  position: relative;
  overflow: hidden;
}

.auth-panel-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 10%, rgba(242, 168, 0, .12) 0%, transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(255, 61, 90, .07) 0%, transparent 50%);
  pointer-events: none;
}

.auth-panel-left .brand {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -.04em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.auth-panel-left .brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
  animation: pip-pulse 2.4s ease-in-out infinite;
}

.auth-panel-left h2 {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -.035em;
  margin-bottom: 16px;
  text-wrap: balance;
}

.auth-panel-left h2 em {
  color: var(--gold);
  font-style: normal;
}

.auth-panel-left>p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 36px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .88rem;
  color: var(--text-muted);
}

.auth-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}

.app-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px 16px 28px;
  font-size: .75rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-footer a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  transition: opacity .15s;
}
.app-footer a:hover { opacity: .75; text-decoration: underline; }

.wheel-deco {
  position: absolute;
  bottom: -50px;
  right: -50px;
  opacity: .25;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: conic-gradient(#F2A800 0deg 30deg, #0F1229 30deg 60deg, #FF3D5A 60deg 90deg,
      #0F1229 90deg 120deg, #00D68F 120deg 150deg, #0F1229 150deg 180deg,
      #F2A800 180deg 210deg, #161A35 210deg 240deg, #FF3D5A 240deg 270deg,
      #161A35 270deg 300deg, #F2A800 300deg 330deg, #0F1229 330deg 360deg);
  animation: spin 22s linear infinite;
}

.auth-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

@media (max-width: 820px) {
  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-panel-left {
    display: none;
  }

  .auth-panel-right {
    min-height: 100vh;
  }
}

/* Auth card */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--coral), transparent);
}

.auth-brand {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -.04em;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
}

.auth-title {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-footer {
  margin-top: 24px;
  font-size: .82rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-footer a {
  color: var(--gold);
  font-weight: 700;
}

.auth-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ── MAIN LAYOUT ─────────────────────────────────────────── */
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 28px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -.03em;
}

.page-header p {
  font-size: .88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── WELCOME HERO ────────────────────────────────────────── */
.welcome-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 36px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
}

.welcome-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 40%, var(--coral) 70%, transparent);
}

.welcome-hero::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: conic-gradient(rgba(242, 168, 0, .2) 0deg 60deg, rgba(255, 61, 90, .15) 60deg 120deg,
      rgba(0, 214, 143, .1) 120deg 180deg, rgba(242, 168, 0, .15) 180deg 240deg,
      rgba(255, 61, 90, .1) 240deg 300deg, rgba(0, 214, 143, .15) 300deg 360deg);
  animation: spin 32s linear infinite;
  opacity: .18;
}

.welcome-greeting {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gold);
  margin-bottom: 8px;
  font-weight: 700;
}

.welcome-name {
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -.04em;
}

.welcome-sub {
  font-size: .88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.welcome-stats {
  display: flex;
  gap: 32px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.welcome-stat-n {
  font-size: 1.45rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.welcome-stat-l {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}

/* ── SORTEO CARDS ────────────────────────────────────────── */
.sorteos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.sorteo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}

.sorteo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--coral));
  opacity: 0;
  transition: opacity .2s;
}

.sorteo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 20%, rgba(242, 168, 0, .05) 50%, transparent 80%);
  transform: translateX(-100%);
  transition: transform .7s ease;
}

.sorteo-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35), 0 0 0 1px rgba(242, 168, 0, .12);
}

.sorteo-card:hover::before {
  opacity: 1;
}

.sorteo-card:hover::after {
  transform: translateX(100%);
}

.sorteo-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.sorteo-card-title {
  font-size: .98rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}

.sorteo-card-company {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sorteo-card-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 12px 0;
}

.sorteo-stat {
  display: flex;
  flex-direction: column;
}

.sorteo-stat-n {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  animation: tick-glow 3s ease-in-out infinite;
}

.sorteo-stat-l {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}

.sorteo-card-actions {
  display: flex;
  gap: 8px;
}

/* Progress bar */
.progress-bar-wrap {
  background: var(--surface-2);
  border-radius: 100px;
  height: 3px;
  margin-bottom: 14px;
}

.progress-bar-fill {
  height: 3px;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--gold), var(--coral));
  transition: width .5s ease;
  box-shadow: 0 0 6px var(--gold-glow);
}

/* FAB */
.create-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  color: #000;
  font-size: 1.6rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--gold-glow);
  transition: transform .2s, box-shadow .2s;
}

.create-fab:hover {
  transform: scale(1.12) rotate(45deg);
  box-shadow: 0 12px 36px var(--gold-glow);
}

/* ── STATS ROW ───────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  transition: border-color .2s, transform .2s;
}

.stat-box:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
}

.stat-box-label {
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-box-value {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.stat-box-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── WINNER BANNER ───────────────────────────────────────── */
.winner-banner {
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: 0 0 24px rgba(242, 168, 0, .12);
}

.winner-banner-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.winner-banner-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gold);
  font-weight: 700;
}

.winner-banner-name {
  font-size: 1.1rem;
  font-weight: 800;
}

.winner-banner-ticket {
  margin-left: auto;
  text-align: right;
}

.winner-ticket-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  animation: tick-glow 2.5s ease-in-out infinite;
}

/* ── QR SECTION ──────────────────────────────────────────── */
.qr-section {
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(242, 168, 0, .08);
  position: relative;
  overflow: hidden;
}

.qr-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--coral));
}

.qr-canvas-wrap {
  background: #08091A;
  border-radius: 12px;
  padding: 8px;
  border: 1px solid var(--border-gold);
  flex-shrink: 0;
}

.qr-info {
  flex: 1;
  min-width: 0;
}

.qr-label {
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gold);
  margin-bottom: 6px;
}

.qr-url {
  font-size: .8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 12px;
}

.qr-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── CONTENT SPLIT ───────────────────────────────────────── */
.content-split {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

/* ── TABLE SECTION ───────────────────────────────────────── */
.table-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.table-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-header h3 {
  font-size: .92rem;
  font-weight: 700;
}

.participants-table {
  width: 100%;
  border-collapse: collapse;
}

.participants-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.participants-table td {
  padding: 12px 16px;
  font-size: .82rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.participants-table tr:last-child td {
  border-bottom: none;
}

.participants-table tr:hover td {
  background: var(--surface-2);
}

.participants-table .row-winner td {
  background: var(--gold-dim);
}

.ticket-num {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  animation: tick-glow 3s ease-in-out infinite;
}

.table-empty {
  text-align: center;
  padding: 52px 20px;
  color: var(--text-muted);
  font-size: .88rem;
}

.overflow-x {
  overflow-x: auto;
}

/* ── ACTIONS SIDEBAR ─────────────────────────────────────── */
.actions-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-card-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}

.action-hint {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── CONFIG BAR ──────────────────────────────────────────── */
.config-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 20px;
  overflow: hidden;
}

.config-bar-toggle {
  width: 100%;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-family: 'Outfit', inherit;
  font-size: .9rem;
  font-weight: 600;
}

.config-bar-toggle:hover {
  background: var(--surface-2);
}

.config-bar-toggle .toggle-icon {
  transition: transform .3s;
}

.config-bar-toggle.open .toggle-icon {
  transform: rotate(180deg);
}

.config-panel-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.25, .8, .25, 1);
  display: block !important;
  padding: 0 20px;
}

.config-panel-body.open {
  max-height: 1400px;
  padding: 20px;
  border-top: 1px solid var(--border);
}

.config-panel-body .cfg-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Logo */
.logo-config-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.logo-preview-wrap {
  width: 80px;
  height: 80px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.logo-preview-placeholder {
  font-size: 1.6rem;
}

.logo-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

/* ── MODALS ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, .65);
  animation: reveal-scale .25s cubic-bezier(.25, .8, .25, 1);
  position: relative;
  overflow: hidden;
}

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--coral), transparent);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-sub {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ── TOAST ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 18px;
  min-width: 260px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  animation: reveal-up .25s ease;
}

.toast.toast-success {
  border-left: 3px solid var(--mint);
}

.toast.toast-error {
  border-left: 3px solid var(--coral);
}

.toast-msg {
  font-size: .85rem;
  color: var(--text);
}

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── TEST BANNER ─────────────────────────────────────────── */
.test-mode-banner {
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.test-mode-banner p {
  font-size: .85rem;
  color: var(--text);
}

.test-mode-banner strong {
  color: var(--gold);
}

/* ── SUPERADMIN ──────────────────────────────────────────── */
.super-hero {
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 24px rgba(242, 168, 0, .08);
  position: relative;
  overflow: hidden;
}

.super-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--coral));
}

.super-hero-text h1 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 4px;
}

.super-hero-text p {
  font-size: .88rem;
  color: var(--text-muted);
}

.super-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.super-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  text-align: center;
}

.super-stat-n {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}

.super-stat-l {
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-top: 4px;
}

.data-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.data-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 11px 16px;
  font-size: .82rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--surface-2);
}

/* ── LOADING ─────────────────────────────────────────────── */
.loading-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.spinner-ring {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-bottom: 12px;
}

/* ── UTILS ───────────────────────────────────────────────── */
.text-muted {
  color: var(--text-muted);
}

.text-gold {
  color: var(--gold);
}

.text-coral {
  color: var(--coral);
}

.text-mint {
  color: var(--mint);
}

.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.gap-8 {
  gap: 8px;
}

.gap-10 {
  gap: 10px;
}

.mt-4 {
  margin-top: 4px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-16 {
  margin-bottom: 16px;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .content-split {
    grid-template-columns: 1fr;
  }

  .actions-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .action-card {
    flex: 1;
    min-width: 190px;
  }

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .super-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .super-hero {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .page-content {
    padding: 20px 16px;
  }

  .app-nav {
    padding: 0 16px;
  }

  .auth-card {
    padding: 28px 20px;
  }

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

  .modal {
    padding: 24px 18px;
  }

  .super-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .welcome-hero {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}

/* ── Language dropdown ────────────────────────────────────── */
.lang-switcher {
  display: inline-flex;
  align-items: center;
}

.lang-dropdown {
  position: relative;
}

/* Trigger chip */
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
  line-height: 1;
}

.lang-trigger:hover {
  color: var(--text);
  border-color: rgba(242,168,0,.4);
}

.lang-trigger[aria-expanded="true"] {
  color: var(--gold);
  border-color: rgba(242,168,0,.4);
  background: var(--gold-dim);
}

.lang-globe {
  font-size: .8rem;
  opacity: .75;
  line-height: 1;
}

.lang-current {
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.lang-chevron {
  opacity: .55;
  transition: transform .2s;
  flex-shrink: 0;
}

.lang-trigger[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

/* Dropdown menu */
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 148px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
  z-index: 9999;
}

.lang-menu.open {
  display: block;
  animation: lang-drop .14s cubic-bezier(.25,.8,.25,1) both;
}

@keyframes lang-drop {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.lang-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background .1s;
}

.lang-opt:hover {
  background: rgba(255,255,255,.05);
}

.lang-opt.lang-opt-active {
  background: var(--gold-dim);
}

.lang-opt-code {
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold);
  min-width: 20px;
}

.lang-opt-name {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.lang-opt.lang-opt-active .lang-opt-name {
  color: var(--text);
}

/* Fixed float (login, register) — menu opens upward */
.lang-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.lang-float .lang-menu {
  top: auto;
  bottom: calc(100% + 6px);
  animation-name: lang-rise;
}

@keyframes lang-rise {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}