/* css/base.css */
/* Variables globales, reset y tipografía.
   Todo el sistema de diseño de BG Owner arranca aquí. */

/* ─── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
  /* Colores — alineados con la identidad BG */
  --bg:           #0a0a0a;
  --surface:      #111111;
  --surface2:     #181818;
  --surface3:     #1e1e1e;
  --border:       #242424;
  --border2:      #2e2e2e;

  /* Brand */
  --green:        #0F6E56;
  --green-light:  #12876a;
  --green-dim:    rgba(15, 110, 86, 0.12);
  --green-glow:   rgba(15, 110, 86, 0.20);

  /* Semánticos */
  --success:      #10b981;
  --success-dim:  rgba(16, 185, 129, 0.12);
  --warning:      #f59e0b;
  --warning-dim:  rgba(245, 158, 11, 0.12);
  --danger:       #ef4444;
  --danger-dim:   rgba(239, 68, 68, 0.12);
  --info:         #3b82f6;
  --info-dim:     rgba(59, 130, 246, 0.12);

  /* Texto */
  --text:         #e8e8e8;
  --text-muted:   #888888;
  --text-subtle:  #555555;

  /* Tipografía */
  --font-heading: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Espaciado — escala de 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;

  /* Radios */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);

  /* Transiciones */
  --transition-fast:   0.15s ease;
  --transition-base:   0.25s ease;
  --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --max-width:    430px;
  --nav-height:   64px;
  --header-height: 80px;

  /* iOS / PWA — notch y barra de inicio (requiere viewport-fit=cover en meta) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden;
  /* Prevenir selección accidental en móvil */
  -webkit-user-select: none;
  user-select: none;
}

/* Permitir selección en inputs y áreas de texto */
input, textarea, [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}

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

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  background: none;
  color: inherit;
}

a {
  color: var(--green-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ─── Tipografía ────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  letter-spacing: -0.3px;
  color: var(--text);
}

h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
h4 { font-size: 15px; font-weight: 600; }

p {
  color: #ccc;
  line-height: 1.65;
}

small {
  font-size: 12px;
  color: var(--text-muted);
}

code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar         { width: 4px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: var(--border2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ─── Accesibilidad ─────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--green-light);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ─── Utilidades de texto ───────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-subtle  { color: var(--text-subtle); }
.text-green   { color: var(--green-light); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-mono    { font-family: var(--font-mono); }
.text-heading { font-family: var(--font-heading); }
.text-sm      { font-size: 13px; }
.text-xs      { font-size: 11px; }
.text-center  { text-align: center; }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }

/* ─── Utilidades de layout ──────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ─── Utilidades de espaciado ───────────────────────────────────────────────── */
.mt-auto { margin-top: auto; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
