/* ============================================
   VERIFY SYSTEM - Design System
   HTML + CSS + JS vanilla · tema claro
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   1. DESIGN TOKENS
   ============================================ */
:root {
  /* ---- Brand (rojo Maxihogar) ---- */
  --brand-25: #FFF9F9;
  --brand-50: #FEF2F2;
  --brand-100: #FEE2E2;
  --brand-200: #FECACA;
  --brand-300: #FCA5A5;
  --brand-500: #EF4444;
  --brand-600: #DC2626;
  --brand-700: #B91C1C;
  --brand-800: #991B1B;
  --brand-900: #7F1D1D;

  /* ---- Neutros ---- */
  --gray-0: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* ---- Semántica principal ---- */
  --color-primary: var(--brand-600);
  --color-primary-hover: var(--brand-700);
  --color-primary-soft: var(--brand-100);
  --color-on-primary: #FFFFFF;
  --color-bg: var(--gray-100);
  --color-surface: var(--gray-0);
  --color-surface-muted: var(--gray-50);
  --color-text: var(--gray-800);
  --color-text-secondary: var(--gray-500);
  --color-text-muted: var(--gray-400);
  --color-border: var(--gray-200);
  --color-border-strong: var(--gray-300);
  --color-overlay: rgba(17, 24, 39, 0.55);

  /* ---- Colores de estado ---- */
  --color-approved: var(--success-600);
  --color-pending: var(--warning-500);
  --color-rejected: var(--error-600);

  /* ---- Feedback semántico ---- */
  --success-fg: #065F46;
  --success-bg: #ECFDF5;
  --success-border: #A7F3D0;
  --success-500: #10B981;
  --success-600: #059669;
  --success-700: #047857;

  --error-fg: #991B1B;
  --error-bg: #FEF2F2;
  --error-border: #FECACA;
  --error-500: #EF4444;
  --error-600: #DC2626;
  --error-700: #B91C1C;

  --warning-fg: #92400E;
  --warning-bg: #FFFBEB;
  --warning-border: #FDE68A;
  --warning-500: #F59E0B;
  --warning-600: #D97706;
  --warning-700: #B45309;

  --info-fg: #1E40AF;
  --info-bg: #EFF6FF;
  --info-border: #BFDBFE;
  --info-500: #3B82F6;
  --info-600: #2563EB;
  --info-700: #1D4ED8;

  /* ---- Estados ---- */
  --state-pending: var(--warning-500);
  --state-review: var(--info-500);
  --state-approved: var(--success-500);
  --state-rejected: var(--error-500);

  /* ---- Spacing (sistema 4px) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---- Tipografía ---- */
  --font-family: 'Work Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --tracking-wide: 0.05em;

  /* ---- Radios ---- */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-pill: 9999px;

  /* ---- Sombras ---- */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.1), 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(16, 24, 40, 0.1), 0 2px 4px -2px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(16, 24, 40, 0.1), 0 4px 6px -4px rgba(16, 24, 40, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(16, 24, 40, 0.1), 0 8px 10px -6px rgba(16, 24, 40, 0.1);
  --shadow-focus: 0 0 0 3px rgba(220, 38, 38, 0.2);

  /* ---- Breakpoints ---- */
  --bp-xs: 360px;
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;

  /* ---- Motion ---- */
  --dur-fast: 150ms;
  --dur-base: 200ms;
  --dur-slow: 300ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   2. RESET / BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, svg, video {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

::selection {
  background: var(--brand-200);
  color: var(--brand-900);
}

:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 4px;
}

a {
  color: var(--brand-600);
}

/* ============================================
   3. UTILIDADES
   ============================================ */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-sm {
  max-width: 400px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.hidden {
  display: none !important;
}

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

.text-right {
  text-align: right;
}

.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;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Spacing utilities */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* ============================================
   4. TIPOGRAFÍA
   ============================================ */
h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

.label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-secondary);
}

.caption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============================================
   5. ICONOS SVG
   ============================================ */
.icon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  vertical-align: middle;
}

.icon-sm { width: 1em; height: 1em; }
.icon-lg { width: 2rem; height: 2rem; }
.icon-xl { width: 3rem; height: 3rem; }

/* ============================================
   6. COMPONENTES GLOBALES
   ============================================ */

/* ---- Brand-mark (escudo + check) ---- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
  color: var(--color-on-primary);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-mark-lg {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.brand-mark-lg svg {
  width: 46px;
  height: 46px;
}

.brand-mark-ring {
  padding: 8px;
  border-radius: var(--radius-2xl);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px var(--brand-100), var(--shadow-lg);
  display: inline-flex;
}

/* ---- Botones ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  text-decoration: none;
  min-height: 48px;
}

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

.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-border);
}

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

.btn-outline:hover:not(:disabled) {
  background: var(--brand-50);
}

.btn-sm {
  padding: 10px 16px;
  font-size: var(--text-sm);
  min-height: 40px;
}

.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-pill);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-danger {
  background: var(--error-600);
  color: var(--color-on-primary);
}

.btn-danger:hover:not(:disabled) {
  background: var(--error-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-full {
  width: 100%;
}

/* Botones de estado (admin) */
.btn-status {
  min-height: 42px;
  padding: 10px 14px;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  color: var(--color-on-primary);
}

.btn-status:hover:not(:disabled) {
  filter: brightness(0.94);
  transform: translateY(-1px);
}

.btn-status--pending  { background: var(--warning-600); }
.btn-status--review   { background: var(--info-600); }
.btn-status--approved { background: var(--success-600); }
.btn-status--rejected { background: var(--error-600); }

/* Navegación */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.nav-buttons .btn {
  flex: 1;
}

/* ---- Cards ---- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.card-full {
  margin: 0;
  border-radius: 0;
}

.card-bordered {
  border: 1px solid var(--color-border);
}

.intro-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

/* ---- Formularios ---- */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 12px var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--text-base);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  background: var(--color-surface);
  color: var(--color-text);
  min-height: 48px;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-input.is-invalid {
  border-color: var(--error-500);
}

.form-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.input-with-icon {
  position: relative;
}

.input-with-icon .icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.input-with-icon .form-input {
  padding-left: 44px;
}

.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--color-text);
}

/* ---- Alertas ---- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.alert .icon {
  margin-top: 2px;
}

.alert-danger {
  background: var(--error-bg);
  color: var(--error-fg);
  border: 1px solid var(--error-border);
}

.alert-info {
  background: var(--brand-50);
  color: var(--brand-800);
  border: 1px solid var(--brand-200);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-fg);
  border: 1px solid var(--success-border);
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
  border: 1px solid var(--warning-border);
}

.inline-error {
  display: none;
  margin-top: var(--space-3);
}

.inline-error.show {
  display: flex;
}

/* Error bajo campo */
.field-error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--error-700);
}

.field-error .icon {
  width: 1.1em;
  height: 1.1em;
  margin-top: 1px;
}

/* ---- Info alert (tinte rojo brand) ---- */
.info-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px var(--space-4);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--brand-800);
  line-height: 1.5;
}

.info-alert .icon {
  color: var(--brand-600);
  margin-top: 2px;
}

.info-alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--brand-600);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---- Checklist ---- */
.checklist {
  list-style: none;
  margin: var(--space-4) 0;
}

.checklist li {
  padding: var(--space-2) 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.checklist .icon {
  color: var(--brand-600);
  width: 1.3em;
  height: 1.3em;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-pending {
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.badge-review {
  background: var(--info-bg);
  color: var(--info-fg);
}

.badge-approved {
  background: var(--success-bg);
  color: var(--success-fg);
}

.badge-rejected {
  background: var(--error-bg);
  color: var(--error-fg);
}

/* ---- Upload Area ---- */
.upload-area {
  border: 2px dashed var(--brand-300);
  border-radius: var(--radius-md);
  padding: var(--space-10) var(--space-5);
  text-align: center;
  background: var(--brand-50);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  position: relative;
  overflow: hidden;
}

.upload-area:hover {
  border-color: var(--brand-600);
  background: var(--brand-100);
}

.upload-area.is-dragover {
  border-color: var(--brand-600);
  background: var(--brand-100);
}

.upload-area.has-file {
  border-color: var(--success-500);
  background: var(--success-bg);
  border-style: solid;
}

.upload-area.has-file .upload-area-img,
.upload-area.has-file .upload-text {
  display: none;
}

.upload-icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-full);
  background: var(--brand-100);
  color: var(--brand-700);
}

.upload-icon .icon {
  width: 28px;
  height: 28px;
}

.upload-area-img {
  max-width: 100%;
    /* max-height: 200px; */
    object-fit: contain;
    margin-bottom: var(--space-3);
    border-radius: var(--radius-md);
    opacity: 0.85;
    display: block;
    margin: 0 auto;
}

.upload-text {
  font-size: var(--text-sm);
  color: var(--brand-800);
  font-weight: 500;
}

.upload-buttons {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.upload-buttons .btn {
  flex: 1;
}

.upload-preview {
  width: 100%;
  border-radius: var(--radius-md);
  display: none;
  border: 2px solid var(--success-500);
  max-height: 220px;
  object-fit: contain;
}

.upload-preview.show {
  display: block;
}

.upload-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--error-500);
  color: white;
  border: 2px solid white;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.upload-area.has-file .upload-remove {
  display: flex;
}

/* ---- QR Toggle & Modal ---- */
.qr-toggle {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: pointer;
  color: var(--brand-600);
  box-shadow: var(--shadow-xs);
  transition: background var(--dur-fast) var(--ease);
  z-index: 10;
}

.qr-toggle:hover {
  background: var(--brand-50);
}

.verify-header {
  position: relative;
}

.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-5);
}

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

.qr-modal-content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 340px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.qr-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.qr-modal-content h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}

.qr-modal-content p {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.qr-modal-content img {
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-md);
}

.qr-url {
  font-size: var(--text-xs) !important;
  color: var(--color-text-muted) !important;
  word-break: break-all;
  margin-top: var(--space-3) !important;
}

/* ---- Stepper ---- */
.stepper {
  padding: var(--space-4) var(--space-5) 0;
  margin-bottom: var(--space-2);
}

.stepper-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2);
}

.stepper-count {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--brand-700);
}

.stepper-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.stepper-track {
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.stepper-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-600), var(--brand-700));
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease);
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-5);
  color: var(--color-text-secondary);
}

.empty-state .icon {
  width: 48px;
  height: 48px;
  color: var(--color-text-muted);
  margin: 0 auto var(--space-4);
}

.empty-state p {
  margin: 0;
  font-size: var(--text-sm);
}

/* ---- Modales / Overlays ---- */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-overlay);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  animation: fadeIn var(--dur-base) var(--ease);
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp var(--dur-slow) var(--ease);
  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: var(--text-xl);
}

.modal-close {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease);
}

.modal-close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* Bottom sheet */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-overlay);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-overlay);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  background: var(--color-surface);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow-y: auto;
  padding: var(--space-6);
  animation: slideUp var(--dur-slow) var(--ease);
  box-shadow: var(--shadow-xl);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.sheet-header h2 {
  margin: 0;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: var(--color-on-primary);
  padding: 12px var(--space-6);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  animation: toastIn var(--dur-fast) var(--ease), toastOut var(--dur-fast) var(--ease) 2.7s forwards;
}

.toast-success {
  background: var(--success-700);
}

.toast-error {
  background: var(--error-700);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ---- Spinner ---- */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   DETAIL OVERLAY + PANEL + TABS
   ============================================ */
.detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-overlay) !important;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.detail-panel {
  background: var(--color-surface);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  border-radius: 16px;
  overflow-y: auto;
  padding: 28px;
  animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.detail-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-header-left h2 {
  margin: 0;
  font-size: 1.25rem;
}

.detail-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: var(--transition);
}

.detail-close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

/* ---- Detail Tabs ---- */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
}

.detail-tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.detail-tab:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

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

.detail-tab-content {
  display: none;
}

.detail-tab-content.active {
  display: block;
}

/* ---- Detail rows ---- */
.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border);
}

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

.detail-label {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

.detail-value {
  font-weight: 500;
  font-size: 0.8rem;
  text-align: right;
}

.detail-code {
  font-family: monospace;
  font-size: 0.75rem;
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: 4px;
  word-break: break-all;
}

.detail-link {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ---- Detail Media Preview ---- */
.detail-media {
  margin-bottom: 12px;
}

.detail-media-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.detail-media-preview {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg);
}

.detail-media-preview img,
.detail-media-preview video {
  width: 100%;
  display: block;
  object-fit: contain;
  max-height: 200px;
  background: var(--color-bg);
}

.detail-media-placeholder {
  padding: 30px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

/* ---- Action Buttons ---- */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.action-row {
  display: flex;
  gap: 8px;
}

.action-row .btn {
  flex: 1;
}

/* ---- Image Preview (rotate/zoom) ---- */
.image-preview-wrapper {
  position: relative;
  width: 100%;
}

.image-preview-wrapper img {
  width: 100%;
  display: block;
  object-fit: contain;
  max-height: 300px;
  transition: transform 0.2s ease;
}

.image-preview-wrapper .media-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.media-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.media-action-btn:hover {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.media-action-btn.media-download {
  text-decoration: none;
}

/* ---- Danger Section ---- */
.danger-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #FECACA;
}

/* ---- Image Modal ---- */
.image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  display: block;
}

.image-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
}

.image-modal-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 24px;
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.image-modal-download:hover {
  background: var(--color-primary);
  color: var(--color-surface);
}

/* ---- Confirm Modal ---- */
.confirm-modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: modalSlideIn 0.2s ease;
}

.confirm-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #FEF3C7;
  color: #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirm-modal-icon.danger {
  background: #FEE2E2;
  color: #DC2626;
}

.confirm-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-text);
}

.confirm-modal-text {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0 0 20px;
  line-height: 1.5;
}

.confirm-modal-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  text-align: left;
}

.confirm-modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  letter-spacing: 2px;
  font-weight: 600;
  transition: var(--transition);
  box-sizing: border-box;
}

.confirm-modal-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.confirm-modal-input.error {
  border-color: var(--color-rejected);
}

.confirm-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.confirm-modal-actions .btn {
  flex: 1;
}

/* ---- Analysis Section ---- */
.analysis-score-container {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
  justify-content: center;
}

.analysis-score-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 6px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.analysis-score-ring.high { border-color: var(--color-approved); }
.analysis-score-ring.medium { border-color: var(--color-pending); }
.analysis-score-ring.low { border-color: var(--color-rejected); }

.score-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
}

.score-label {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rec-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rec-low { background: #D1FAE5; color: #065F46; }
.rec-medium { background: #FEF3C7; color: #92400E; }
.rec-high { background: #FEE2E2; color: #991B1B; }
.rec-review { background: #E0E7FF; color: #3730A3; }

/* ---- Fraud signals severity ---- */
.fraud-signals-list { list-style: none; padding: 0; margin: 0; }
.fraud-signal { padding: 8px 10px; margin-bottom: 6px; border-radius: 6px; border-left: 3px solid transparent; background: var(--color-surface); }
.fraud-signal.severity-high { border-left-color: var(--error-500); background: #FEF2F2; }
.fraud-signal.severity-medium { border-left-color: var(--warning-500); background: #FFFBEB; }
.fraud-signal.severity-low { border-left-color: var(--success-500); background: #ECFDF5; }
.signal-severity { font-weight: 600; font-size: 0.7rem; text-transform: uppercase; }
.severity-high .signal-severity { color: var(--error-600); }
.severity-medium .signal-severity { color: #D97706; }
.severity-low .signal-severity { color: var(--success-600); }
.signal-confidence { font-size: 0.75rem; color: var(--text-secondary); margin-left: 6px; }
.signal-location { font-size: 0.75rem; color: var(--text-secondary); font-style: italic; }
.signal-desc { margin-top: 4px; font-size: 0.85rem; color: var(--text-primary); }

.analysis-scores {
  margin: 16px 0;
}

.analysis-score-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.analysis-score-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  min-width: 100px;
}

.score-bar-bg {
  flex: 1;
  background: var(--color-border);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.score-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  background: var(--color-approved);
}

.score-bar.medium { background: var(--color-pending); }
.score-bar.low { background: var(--color-rejected); }

.analysis-score-pct {
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 35px;
  text-align: right;
}

.analysis-data-match,
.analysis-fraud-signals {
  margin-top: 16px;
  padding: 12px 14px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
}

.analysis-fraud-signals h4 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #991B1B;
  margin: 0 0 8px 0;
}

.analysis-data-match h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.match-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.match-label {
  font-size: 0.85rem;
  color: var(--color-text);
}

.match-status {
  font-size: 0.8rem;
  font-weight: 600;
}

.match-ok { color: var(--color-approved); }
.match-warn { color: var(--color-pending); }
.match-error { color: var(--color-rejected); }

.fraud-signal {
  background: #FEF2F2;
  border-left: 3px solid var(--color-rejected);
  padding: 10px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 8px;
}

.fraud-signal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.fraud-signal-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-rejected);
}

.fraud-signal-confidence {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.fraud-signal-desc {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

#analyzeBtn {
  width: 100%;
  margin-bottom: 16px;
}

/* ---- Summary ---- */
.analysis-summary {
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.analysis-summary h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.summary-list li {
  position: relative;
  padding: 6px 0 6px 18px;
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.5;
}

.summary-list li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: bold;
}

.match-yes {
  color: var(--color-approved) !important;
}
.match-yes::before {
  content: '\2713' !important;
  color: var(--color-approved) !important;
}
.match-no {
  color: var(--color-rejected) !important;
}
.match-no::before {
  content: '\2717' !important;
  color: var(--color-rejected) !important;
}

/* ---- Findings ---- */
.analysis-findings {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.analysis-findings h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.findings-group {
  margin-bottom: 10px;
}

.findings-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.findings-group ul {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
}

.findings-group li {
  position: relative;
  padding: 4px 0 4px 16px;
  font-size: 0.8rem;
  color: var(--color-text);
  line-height: 1.4;
}

.findings-group li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: var(--color-text-secondary);
}

/* ---- Consistency ---- */
.analysis-consistency {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.analysis-consistency h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

/* ---- Link generated ---- */
.generated-link {
  background: var(--color-bg);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-xs);
  margin: var(--space-3) 0;
  display: block;
  text-align: center;
  border: 1px solid var(--color-border);
}

.generated-link-text {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  word-break: break-all;
}

.share-buttons {
  display: flex;
  gap: var(--space-2);
}

.share-buttons .btn {
  flex: 1;
  font-size: var(--text-sm);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* ---- QR ---- */
.qr-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-overlay);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-frame {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: inline-block;
  box-shadow: var(--shadow-md);
}

.qr-frame img {
  border-radius: var(--radius-sm);
}

/* ---- Action buttons ---- */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.action-row {
  display: flex;
  gap: var(--space-2);
}

.action-row .btn {
  flex: 1;
}

/* ---- Video recording ---- */
.video-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.video-container video {
  width: 100%;
  display: block;
}

#cameraPreview {
  width: 100%;
  border-radius: var(--radius-md);
  background: #000;
  display: none;
}

#cameraPreview.active {
  display: block;
}

.video-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  justify-content: center;
}

.camera-controls {
  display: flex;
  justify-content: center;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.camera-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-on-primary);
}

.camera-btn:hover {
  transform: scale(1.05);
}

.camera-btn-record {
  background: var(--color-primary);
  border: 4px solid var(--color-surface);
}

.camera-btn-record .icon {
  width: 26px;
  height: 26px;
}

.camera-btn-record.recording {
  animation: pulse 1.5s ease infinite;
  background: var(--brand-800);
}

.camera-btn-stop {
  background: var(--gray-600);
  border: 4px solid var(--color-surface);
  display: none;
}

.camera-btn-stop .icon {
  width: 26px;
  height: 26px;
}

.camera-btn-stop.show {
  display: flex;
}

.recording-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  color: var(--color-primary);
  font-weight: 600;
  font-size: var(--text-sm);
}

.recording-indicator.show {
  display: flex;
}

.recording-dot {
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 50%;
  animation: blink 1s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ---- Success / status screens ---- */
.success-screen {
  text-align: center;
  padding: var(--space-10) var(--space-5);
}

.status-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
}

.status-icon .icon {
  width: 48px;
  height: 48px;
}

.status-icon-success {
  background: var(--success-bg);
  color: var(--success-600);
}

.status-icon-error {
  background: var(--error-bg);
  color: var(--error-600);
}

.status-icon-info {
  background: var(--info-bg);
  color: var(--info-600);
}

/* ---- Mobile required ---- */
.mobile-required {
  text-align: center;
  padding: var(--space-10) var(--space-5);
}

.mobile-required-icon {
  display: inline-flex;
  width: 72px;
  height: 72px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--brand-100);
  color: var(--brand-700);
  margin-bottom: var(--space-5);
}

.mobile-required-icon .icon {
  width: 36px;
  height: 36px;
}

/* ---- Video instructions ---- */
.video-instructions {
  text-align: center;
  padding: var(--space-5);
}

.video-instructions p {
  font-size: var(--text-base);
  line-height: 1.6;
}

.video-instructions-icon {
  display: inline-flex;
  width: 72px;
  height: 72px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--brand-100);
  color: var(--brand-700);
  margin-bottom: var(--space-5);
}

.video-instructions-icon .icon {
  width: 36px;
  height: 36px;
}

/* ---- Browser mock (step permisos) ---- */
.browser-mock {
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  margin: var(--space-2) 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-sm);
  color: var(--brand-800);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  word-break: break-all;
}

.toggle-mock {
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  margin: var(--space-2) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.toggle-mock .icon {
  color: var(--color-text-muted);
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--brand-600);
  border-radius: var(--radius-pill);
  position: relative;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  right: 2px;
}

/* ---- Step transitions ---- */
.step-container {
  display: none;
  padding: var(--space-6) var(--space-5) var(--space-5);
}

.step-container.active {
  display: block;
  animation: fadeIn var(--dur-base) var(--ease);
}

/* ---- Progress dots (legacy, kept for compatibility) ---- */
.progress-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.progress-dot {
  width: 40px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  transition: background var(--dur-fast) var(--ease);
}

.progress-dot.active {
  background: var(--color-primary);
}

/* ---- Countdown ---- */
.countdown {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: 500;
}

/* ============================================
   7. PÁGINA: LOGIN
   ============================================ */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(1000px 500px at 50% -150px, var(--brand-100), transparent),
    var(--color-bg);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: var(--space-5);
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-header h1 {
  margin-top: var(--space-4);
  margin-bottom: 0;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}

.login-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
}

.login-card h2 {
  font-size: var(--text-xl);
  text-align: center;
  margin-bottom: var(--space-2);
}

.login-card .subtitle {
  text-align: center;
  margin-bottom: var(--space-6);
}

.error-message {
  display: none;
}

.error-message.show {
  display: flex;
}

.login-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.trust-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.trust-line .icon {
  color: var(--brand-600);
}

/* ============================================
   8. PÁGINA: ADMIN
   ============================================ */
.admin-header {
  background: var(--color-surface);
  padding: var(--space-4) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-xs);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-brand-text {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-user-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-bg);
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-pill);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-600);
  color: var(--color-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  flex-shrink: 0;
}

.admin-user-email {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: var(--space-2);
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.btn-logout:hover {
  color: var(--color-primary);
  background: var(--brand-50);
}

.admin-content {
  padding: var(--space-5);
  max-width: 800px;
  margin: 0 auto;
}

/* Stats */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-chip {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-chip .icon {
  width: 18px;
  height: 18px;
}

.stat-card.pending   .stat-chip { background: var(--warning-bg); color: var(--warning-600); }
.stat-card.review    .stat-chip { background: var(--info-bg); color: var(--info-600); }
.stat-card.approved  .stat-chip { background: var(--success-bg); color: var(--success-600); }
.stat-card.rejected  .stat-chip { background: var(--error-bg); color: var(--error-600); }

.stat-number {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
}

.stat-card.pending   .stat-number { color: var(--warning-700); }
.stat-card.review    .stat-number { color: var(--info-700); }
.stat-card.approved  .stat-number { color: var(--success-700); }
.stat-card.rejected  .stat-number { color: var(--error-700); }

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 600;
}

/* Toolbar / filter tabs */
.admin-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: var(--space-5);
  gap: var(--space-3);
}

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--color-surface);
  padding: 4px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
  flex-wrap: wrap;
  width: 100%;
}

.filter-tab {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  color: var(--color-text-secondary);
  min-height: 40px;
  text-align: center;
}

.filter-tab.active {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.filter-tab:hover:not(.active) {
  background: var(--color-bg);
}

/* List */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  border-left: 4px solid transparent;
  cursor: pointer;
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.admin-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--brand-200);
}

.admin-card.status-pending  { border-left-color: var(--state-pending); }
.admin-card.status-in_review { border-left-color: var(--state-review); }
.admin-card.status-approved { border-left-color: var(--state-approved); }
.admin-card.status-rejected { border-left-color: var(--state-rejected); }

.admin-card-body {
  flex: 1;
  min-width: 0;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-1);
}

.admin-card-name {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-text);
}

.admin-card-code {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: var(--space-1);
}

.admin-card-meta {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
}

.admin-card-chevron {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ============================================
   9. PÁGINA: FLUJO CLIENTE
   ============================================ */
body.verify-page {
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-800) 100%);
  min-height: 100vh;
}

.verify-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.verify-header {
  padding: var(--space-8) var(--space-5) var(--space-5);
  text-align: center;
}

.verify-header .brand-mark {
  margin: 0 auto;
}

.verify-content {
  flex: 1;
  background: var(--color-bg);
  border-radius: 30px 30px 0 0;
  padding: 0 0 var(--space-5);
}

/* ---- Success (step 10) ---- */
.success-container {
  text-align: center;
  padding: var(--space-10) var(--space-5);
}

/* ============================================
   10. RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-card {
    align-items: flex-start;
  }

  /* Detail panel - mobile */
  .detail-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .detail-panel {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 95vh;
    padding: 20px;
  }

  .detail-tab {
    font-size: 0.7rem;
    padding: 10px 8px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-3);
  }

  .card {
    padding: var(--space-5);
  }

  h1 {
    font-size: var(--text-xl);
  }

  .login-card {
    padding: var(--space-6);
  }

  .step-container {
    padding: var(--space-5) var(--space-4) var(--space-4);
  }
}

@media (min-width: 641px) {
  .admin-content {
    padding: var(--space-8) var(--space-5);
  }
}

/* ============================================
   11. ACCESIBILIDAD / 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;
  }
}
