/*
 * Vaultix · estilos comunes
 *
 * Identidad visual:
 *  · Color de marca:   #14376f (azul Vaultix)
 *  · Tema:             oscuro por defecto, igual que la app móvil
 *  · Tipografía:       Inter (system fallback)
 *
 * Objetivos:
 *  · Carga instantánea (sin frameworks pesados)
 *  · Mobile-first (la mayoría llega aquí desde un móvil)
 *  · Accesibilidad básica: contraste WCAG AA, foco visible, ARIA
 */

:root {
  --brand: #14376f;
  --brand-soft: rgba(120, 145, 220, 0.18);
  --brand-text: #a7c0ff;
  --bg: #0e1116;
  --surface: #161a22;
  --surface-2: #1c2230;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e6edf3;
  --text-muted: #9aa4b3;
  --text-faint: #5b6779;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono",
    Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(
      120% 80% at 50% -10%,
      rgba(80, 110, 200, 0.18),
      transparent 60%
    ),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ── Layout ───────────────────────────────────────────────────────────── */

.shell {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(20px, 6vw, 56px) clamp(16px, 5vw, 48px);
}

.card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 36px);
}

/* ── Branding header ─────────────────────────────────────────────────── */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  font-size: 22px;
  letter-spacing: -0.02em;
  box-shadow: 0 6px 18px rgba(20, 55, 111, 0.55);
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-tag {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-faint);
}

/* ── Tipografía interna ──────────────────────────────────────────────── */

h1 {
  font-size: clamp(22px, 4.5vw, 28px);
  font-weight: 700;
  margin: 8px 0 6px;
  letter-spacing: -0.015em;
}

h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-text);
  margin: 24px 0 10px;
  font-weight: 700;
}

p.lead {
  color: var(--text-muted);
  margin: 0 0 18px;
}

/* ── Bloques de contenido ────────────────────────────────────────────── */

.payload {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow-y: auto;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-weight: 600;
  font-size: 12px;
}

.chip.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

/* ── Botones ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease,
    border-color 0.15s ease;
}

.btn:hover { background: #1a4690; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 3px solid rgba(120, 150, 255, 0.6);
  outline-offset: 2px;
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.04); }

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn-row .btn {
  flex: 1 1 0;
  min-width: 140px;
}

/* ── Estados ─────────────────────────────────────────────────────────── */

.status {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 8px;
  gap: 12px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--brand-text);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-text);
}

.icon-circle svg {
  width: 32px;
  height: 32px;
}

.icon-circle.danger {
  background: rgba(239, 68, 68, 0.18);
  color: var(--danger);
}

.icon-circle.success {
  background: rgba(34, 197, 94, 0.18);
  color: var(--success);
}

.status h1 { margin-top: 6px; }
.status p { color: var(--text-muted); margin: 0; max-width: 36ch; }

/* ── Aviso de privacidad ─────────────────────────────────────────────── */

.notice {
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ── Footer ──────────────────────────────────────────────────────────── */

footer {
  padding: 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
}
footer a:hover { color: var(--text); text-decoration: underline; }

/* Utilidad: ocultar visualmente pero accesible al lector de pantalla */
.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;
}

/* Soporte para tema claro del sistema (raro: la web es deliberadamente
   dark, pero algunos OS fuerzan light contrast). */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --border: rgba(15, 23, 42, 0.08);
    --text: #0f172a;
    --text-muted: #475569;
    --text-faint: #94a3b8;
    --brand-soft: rgba(20, 55, 111, 0.1);
    --brand-text: #14376f;
  }
}
