/* ═══════════════════════════════════════════════════════════════════════
   EduTokens — Stylesheet v2
   Mobile-first (max-width 430px). Sin frameworks, vanilla CSS.
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* ── Design tokens ─────────────────────────────────────────────────── */

:root {
  /* Brand */
  --primary: #5B5BF7;
  --primary-dark: #4747d6;
  --primary-glow: rgba(91, 91, 247, 0.25);

  /* Gradientes contextuales — cada sección de la app tiene su identidad */
  --grad-landing:  linear-gradient(135deg, #4F46E5 0%, #7C3AED 40%, #A855F7 100%);
  --grad-auth:     linear-gradient(160deg, #312E81 0%, #4C1D95 60%, #7C3AED 100%);
  --grad-student:  linear-gradient(135deg, #0F766E 0%, #0D9488 60%, #14B8A6 100%);
  --grad-admin:    linear-gradient(135deg, #1E293B 0%, #334155 60%, #475569 100%);
  --grad-success:  linear-gradient(135deg, #16A34A 0%, #22C55E 100%);
  --grad-warning:  linear-gradient(135deg, #D97706 0%, #F59E0B 100%);
  --grad-danger:   linear-gradient(135deg, #DC2626 0%, #EF4444 100%);

  /* Superficies */
  --bg:            #F8FAFC;
  --card:          #FFFFFF;
  --surface-dark:  #0F172A;
  --surface-dark2: #1E293B;

  /* Semánticos */
  --success:       #16A34A;
  --success-bg:    #F0FDF4;
  --error:         #DC2626;
  --error-bg:      #FEF2F2;
  --warning:       #D97706;
  --warning-bg:    #FFFBEB;
  --info-bg:       #EFF6FF;

  /* Texto */
  --text:          #0F172A;
  --text-muted:    #64748B;
  --text-light:    #94A3B8;
  --text-inverse:  #F1F5F9;

  /* Bordes y radios */
  --border:        #E2E8F0;
  --border-light:  #F1F5F9;
  --radius:        16px;
  --radius-sm:     10px;
  --radius-xs:     8px;

  /* Sombras */
  --shadow:        0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(91,91,247,.04);
  --shadow-md:     0 4px 24px rgba(0,0,0,.06);
  --shadow-lg:     0 12px 40px rgba(91,91,247,.10);
  --shadow-xl:     0 20px 60px rgba(0,0,0,.15);
}

/* ── Reset ──────────────────────────────────────────────────────────── */

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mono { font-family: 'DM Mono', monospace; }

/* ── App shell (mobile-first viewport) ──────────────────────────────── */

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  overflow-y: auto;
  display: none;
  animation: screenIn 0.25s ease;
}

.screen.active { display: flex; flex-direction: column; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Unified content padding ────────────────────────────────────────── */

.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 80px;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}

.header-back {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--primary);
  font-weight: 500;
  font-size: 14px;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  padding: 4px 0;
}

.header-back:hover { opacity: 0.75; }

.header-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  flex: 1;
}

.header-action {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.15s;
  font-size: 14px;
}

.header-action:hover { background: var(--border); }

/* ── Bottom navigation ──────────────────────────────────────────────── */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 6px 4px;
  transition: all 0.15s;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
}

.nav-icon  { font-size: 20px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 500; color: var(--text-light); transition: color 0.15s; }
.nav-item.active .nav-label { color: var(--primary); font-weight: 600; }

/* ── Cards ──────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-sm { padding: 14px 16px; }

/* ── Balance card (gradiente contextual por rol) ────────────────────── */

.balance-card {
  border-radius: var(--radius);
  padding: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  background: var(--grad-student);
}

.balance-card.admin { background: var(--grad-admin); }

.balance-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.balance-card::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -20px;
  width: 200px; height: 200px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.balance-label    { font-size: 12px; font-weight: 500; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; position: relative; z-index: 1; }
.balance-amount   { font-size: 52px; font-weight: 600; line-height: 1; display: flex; align-items: baseline; gap: 8px; position: relative; z-index: 1; }
.balance-unit     { font-size: 18px; font-weight: 400; opacity: 0.7; }
.balance-wallet   { font-size: 11px; opacity: 0.6; margin-top: 10px; font-family: 'DM Mono', monospace; position: relative; z-index: 1; }
.balance-status   { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; background: rgba(255,255,255,.15); border-radius: 20px; padding: 4px 10px; font-size: 12px; position: relative; z-index: 1; }
.dot-pulse        { width: 6px; height: 6px; background: #4ade80; border-radius: 50%; animation: dotPulse 2s infinite; }

@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Metrics grid ───────────────────────────────────────────────────── */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 14px 12px;
  text-align: center;
}

.metric-value { font-size: 22px; font-weight: 600; color: var(--primary); line-height: 1.1; }
.metric-label { font-size: 10px; color: var(--text-muted); margin-top: 4px; line-height: 1.3; }

/* ── Transaction items ───────────────────────────────────────────────── */

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.tx-item:hover       { background: #F8FAFC; }
.tx-item:last-child  { border-bottom: none; }

.tx-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.tx-icon.income  { background: var(--success-bg); color: var(--success); }
.tx-icon.expense { background: var(--error-bg);   color: var(--error); }

.tx-info  { flex: 1; min-width: 0; }
.tx-name  { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tx-amount { font-size: 15px; font-weight: 600; white-space: nowrap; }
.tx-amount.income  { color: var(--success); }
.tx-amount.expense { color: var(--error); }

/* ── Badges ──────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 500;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-primary { background: #EEF2FF; color: var(--primary); }
.badge-muted   { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 12px; font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.15s;
  border: none; text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:active   { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary:disabled:hover { background: var(--primary); }

.btn-secondary {
  background: var(--card);
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: #EEF2FF; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover { background: #EEF2FF; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 14px;
}

.btn-sm { padding: 9px 16px; font-size: 13px; width: auto; border-radius: 8px; }

/* ── Section header ──────────────────────────────────────────────────── */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 12px;
}

.section-title { font-size: 15px; font-weight: 600; }
.section-link  { font-size: 13px; color: var(--primary); cursor: pointer; font-weight: 500; background: none; border: none; font-family: 'DM Sans', sans-serif; }

/* ── Avatar ──────────────────────────────────────────────────────────── */

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 16px;
}

/* ── Inputs ──────────────────────────────────────────────────────────── */

.input-group { margin-bottom: 16px; }

.input-label {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  margin-bottom: 6px; display: block;
}

.input {
  width: 100%; padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; color: var(--text);
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(91,91,247,.10);
}

textarea.input { resize: vertical; min-height: 72px; }

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2364748B' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── Auth screens ────────────────────────────────────────────────────── */

.login-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--grad-auth);
  padding: 40px 20px;
}

.login-header { color: #fff; text-align: center; margin-bottom: 40px; }
.login-logo   { font-size: 48px; font-weight: 700; margin-bottom: 8px; }
.login-title  { font-size: 24px; font-weight: 600; opacity: 0.95; }
.login-sub    { font-size: 13px; opacity: 0.7; margin-top: 6px; }

.login-body {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
}

.login-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
}

.login-tab {
  flex: 1; padding: 12px;
  text-align: center; font-size: 14px;
  font-weight: 600; cursor: pointer; color: var(--text-muted);
  border: none; background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.login-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Reusable tabs bar ───────────────────────────────────────────────── */

.tabs-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabs-bar .tab {
  flex-shrink: 0;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}

.tabs-bar .tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Alerts / Messages ───────────────────────────────────────────────── */

.error-msg {
  background: var(--error-bg);
  border: 1px solid #FECDD3;
  color: var(--error);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}

.error-msg.show { display: block; animation: shakeIn 0.3s ease; }

.success-msg {
  background: var(--success-bg);
  border: 1px solid #BBF7D0;
  color: var(--success);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}

.success-msg.show { display: block; }

@keyframes shakeIn {
  0%   { transform: translateX(-6px); }
  25%  { transform: translateX(6px); }
  50%  { transform: translateX(-3px); }
  75%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

/* ── Loading Overlay (unificado — usado en purchase y global) ────────── */

.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
}

.loading-overlay.show { display: flex; }

.loading-overlay .spinner-ring {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-overlay .loading-text {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 0 24px;
}

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

/* ── Password Modal ──────────────────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-dialog {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  width: calc(100% - 48px);
  max-width: 360px;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-dialog h3 {
  font-size: 16px; font-weight: 600; margin-bottom: 6px;
}

.modal-dialog p {
  font-size: 12px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5;
}

.modal-dialog .input { width: 100%; margin-bottom: 16px; }

.modal-actions {
  display: flex; gap: 10px;
}

.modal-actions button { flex: 1; margin: 0; }

/* ── Skeleton loading ────────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 4px;
}

.skeleton-text:last-child { width: 65%; }

.skeleton-card {
  height: 80px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.skeleton-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
}

.skeleton-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.skeleton-row:last-child { border-bottom: none; }

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Staggered animation ─────────────────────────────────────────────── */

.stagger-container > .stagger-item {
  opacity: 0;
  transform: translateY(12px);
  animation: staggerIn 0.4s ease forwards;
}

.stagger-container > .stagger-item:nth-child(1) { animation-delay: 0.00s; }
.stagger-container > .stagger-item:nth-child(2) { animation-delay: 0.06s; }
.stagger-container > .stagger-item:nth-child(3) { animation-delay: 0.12s; }
.stagger-container > .stagger-item:nth-child(4) { animation-delay: 0.18s; }
.stagger-container > .stagger-item:nth-child(5) { animation-delay: 0.24s; }
.stagger-container > .stagger-item:nth-child(6) { animation-delay: 0.30s; }
.stagger-container > .stagger-item:nth-child(7) { animation-delay: 0.36s; }
.stagger-container > .stagger-item:nth-child(8) { animation-delay: 0.42s; }

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

/* ── Product cards ───────────────────────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.product-img {
  width: 100%; height: 80px;
  border-radius: 8px;
  background: linear-gradient(135deg, #EEF2FF, #F5F3FF);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}

.product-name { font-size: 14px; font-weight: 600; }
.product-desc { font-size: 12px; color: var(--text-muted); }
.product-cost { font-size: 13px; color: var(--primary); font-weight: 500; }

/* ── Admin stats / tables / chart ────────────────────────────────────── */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.admin-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.admin-stat-val { font-size: 28px; font-weight: 700; color: var(--primary); }
.admin-stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.04em; }

.chart-wrap  { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 12px 0; }
.chart-bar   { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; transition: opacity 0.15s; opacity: 0.7; }
.chart-bar:hover { opacity: 1; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th { text-align: left; padding: 12px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-table td { padding: 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.admin-table tr:last-child td { border-bottom: none; }

/* ── Success screen ──────────────────────────────────────────────────── */

.success-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh; padding: 40px 20px; text-align: center;
}

.success-circle {
  width: 96px; height: 96px;
  background: var(--grad-success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px; font-size: 48px;
}

/* ── Contextual gradient accents ─────────────────────────────────────── */

.grad-accent-landing { background: var(--grad-landing); color: #fff; border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden; }
.grad-accent-auth    { background: var(--grad-auth);    color: #fff; border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden; }
.grad-accent-student { background: var(--grad-student); color: #fff; border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden; }
.grad-accent-admin   { background: var(--grad-admin);   color: #fff; border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden; }

/* ── Dark info box ───────────────────────────────────────────────────── */

.info-box-dark {
  background: var(--surface-dark);
  color: #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 12px;
  line-height: 1.6;
}

.info-box-dark .info-box-label {
  font-size: 11px;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

/* ── Landing page hero ───────────────────────────────────────────────── */

.landing-hero {
  background: var(--grad-landing);
  color: #fff;
  text-align: center;
  padding: 60px 30px 40px;
  position: relative;
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
}

.landing-hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 20%;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}

.landing-hero > * { position: relative; z-index: 1; }

/* ── Step-by-step (register, onboarding) ─────────────────────────────── */

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.step-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}

.step-dot.active  { background: var(--primary); transform: scale(1.3); }
.step-dot.done    { background: var(--success); }

.step-line {
  width: 32px; height: 2px;
  background: var(--border);
  transition: background 0.3s ease;
}

.step-line.done { background: var(--success); }

.step-section { display: none; }
.step-section.active { display: block; animation: stepIn 0.3s ease; }

@keyframes stepIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Advanced toggle (login) ─────────────────────────────────────────── */

.advanced-toggle {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 20px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.advanced-toggle:hover { border-color: var(--primary); color: var(--primary); }

.advanced-section {
  display: none;
  margin-top: 12px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.advanced-section.show { display: block; }

/* ── Inline spinner (botones) ────────────────────────────────────────── */

.spinner-inline {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ── Scrollbar ───────────────────────────────────────────────────────── */

::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .app        { max-width: 100%; }
  .bottom-nav { max-width: 100%; }
  .metrics-grid    { grid-template-columns: repeat(2, 1fr); }
  .admin-grid      { grid-template-columns: 1fr; }
  .product-grid    { grid-template-columns: repeat(2, 1fr); }
  .landing-hero    { padding: 48px 24px 32px; }
}
