/* ============================================================
   BIGGOW GESTOR DE CONTENIDO — base.css
   Reset, body, tipografía global, scrollbar, elementos nativos.
   ============================================================ */

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

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--tx);
  background-color: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ----------------------------------------------------------
   TIPOGRAFÍA BASE
---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--weight-semi);
  line-height: var(--leading-tight);
  color: var(--tx);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }

p {
  line-height: var(--leading-normal);
  color: var(--tx-mid);
}

a {
  color: var(--yel);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  color: var(--wh);
}

strong, b {
  font-weight: var(--weight-semi);
  color: var(--tx);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
  color: var(--mu);
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

code {
  background: var(--surf);
  border: 1px solid var(--bd);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  color: var(--yel);
}

pre {
  background: var(--bg-deep);
  border: 1px solid var(--bd);
  padding: var(--space-4);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.5;
}

hr {
  border: none;
  border-top: 1px solid var(--bd);
  margin: var(--space-4) 0;
}

ul, ol {
  padding-left: var(--space-5);
}

li {
  color: var(--tx-mid);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-1);
}

/* ----------------------------------------------------------
   LISTAS SIN ESTILO (utility)
---------------------------------------------------------- */
.list-none {
  list-style: none;
  padding-left: 0;
}

/* ----------------------------------------------------------
   IMÁGENES Y MEDIA
---------------------------------------------------------- */
img, video, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* ----------------------------------------------------------
   SCROLLBAR PERSONALIZADA
---------------------------------------------------------- */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bd-strong);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--mu);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--bd-strong) transparent;
}

/* ----------------------------------------------------------
   SELECCIÓN DE TEXTO
---------------------------------------------------------- */
::selection {
  background: var(--yel);
  color: var(--bg);
}

::-moz-selection {
  background: var(--yel);
  color: var(--bg);
}

/* ----------------------------------------------------------
   INPUTS, SELECT, TEXTAREA — BASE NATIVA
---------------------------------------------------------- */
input,
select,
textarea,
button {
  font-family: inherit;
  font-size: inherit;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="url"],
input[type="tel"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  color: var(--tx);
  font-size: var(--text-base);
  line-height: 1.5;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="url"]:hover,
input[type="tel"]:hover,
input[type="search"]:hover,
select:hover,
textarea:hover {
  border-color: var(--bd-strong);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: var(--yel);
  box-shadow: 0 0 0 3px var(--yel-dim);
}

input::placeholder,
textarea::placeholder {
  color: var(--mu-low);
}

input[disabled],
select[disabled],
textarea[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6H0z' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
  cursor: pointer;
}

select option {
  background: var(--bg-mid);
  color: var(--tx);
}

/* Checkbox y Radio */
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--yel);
  cursor: pointer;
  flex-shrink: 0;
}

/* Input date — ícono de calendario */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5);
  cursor: pointer;
}

/* ----------------------------------------------------------
   BUTTON RESET
---------------------------------------------------------- */
button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  line-height: inherit;
}

/* ----------------------------------------------------------
   TABLA BASE
---------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mu);
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--bd);
  white-space: nowrap;
}

td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--tx-mid);
  font-size: var(--text-base);
  vertical-align: middle;
}

tr:hover td {
  background: var(--surf);
}

/* ----------------------------------------------------------
   UTILIDADES TIPOGRÁFICAS
---------------------------------------------------------- */
.text-xs    { font-size: var(--text-xs); }
.text-sm    { font-size: var(--text-sm); }
.text-base  { font-size: var(--text-base); }
.text-md    { font-size: var(--text-md); }
.text-lg    { font-size: var(--text-lg); }
.text-xl    { font-size: var(--text-xl); }
.text-2xl   { font-size: var(--text-2xl); }
.text-3xl   { font-size: var(--text-3xl); }

.text-tx    { color: var(--tx); }
.text-mid   { color: var(--tx-mid); }
.text-mu    { color: var(--mu); }
.text-yel   { color: var(--yel); }
.text-ok    { color: var(--ok); }
.text-err   { color: var(--err); }
.text-warn  { color: var(--warn); }
.text-info  { color: var(--info); }

.weight-normal { font-weight: var(--weight-normal); }
.weight-medium { font-weight: var(--weight-medium); }
.weight-semi   { font-weight: var(--weight-semi); }
.weight-bold   { font-weight: var(--weight-bold); }

.mono { font-family: var(--font-mono); }
.uppercase { text-transform: uppercase; letter-spacing: 0.06em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-wrap { white-space: nowrap; }

/* ----------------------------------------------------------
   UTILIDADES DE LAYOUT
---------------------------------------------------------- */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-1       { flex: 1; }
.flex-shrink-0{ flex-shrink: 0; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.wrap   { flex-wrap: wrap; }

.hidden       { display: none !important; }
.invisible    { visibility: hidden; }
.block        { display: block; }
.inline-flex  { display: inline-flex; }

.w-full { width: 100%; }
.h-full { height: 100%; }

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

.relative { position: relative; }
.absolute { position: absolute; }

/* ----------------------------------------------------------
   UTILIDADES DE ESPACIADO
---------------------------------------------------------- */
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }

/* ----------------------------------------------------------
   UTILIDADES DE BORDE
---------------------------------------------------------- */
.border-t { border-top: 1px solid var(--bd); }
.border-b { border-bottom: 1px solid var(--bd); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded    { border-radius: var(--radius); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

/* ----------------------------------------------------------
   FOCO VISIBLE (accesibilidad)
---------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--yel);
  outline-offset: 2px;
}

/* ----------------------------------------------------------
   ESTADO DE CARGA
---------------------------------------------------------- */
.loading {
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

/* ----------------------------------------------------------
   ANIMACIONES BASE
---------------------------------------------------------- */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--yel-dim); }
  50%       { box-shadow: 0 0 0 6px transparent; }
}
