/* css/base.css
   ─────────────────────────────────────────────
   Variables globales, reset y utilidades base.
   Importado en index.html.
   ───────────────────────────────────────────── */

/* ── Variables ────────────────────────────────── */
:root {
  --primario:     #25D366;
  --primario-dk:  #128C7E;
  --primario-bg:  #e8faf0;
  --fondo:        #f7f7f7;
  --fondo-card:   #ffffff;
  --texto:        #1a1a1a;
  --texto-mid:    #555555;
  --texto-light:  #888888;
  --borde:        #e5e5e5;
  --error:        #e74c3c;
  --warning:      #e67e22;
  --radio:        10px;
  --radio-lg:     16px;
  --sombra:       0 2px 8px rgba(0, 0, 0, .07);
  --trans:        .18s ease;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  min-height: 100dvh;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a   { color: inherit; }
button { font-family: inherit; }
textarea { font-family: inherit; resize: vertical; }

/* ── Loading ──────────────────────────────────── */
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: #fff;
  z-index: 9999;
  transition: opacity .3s;
}
#loading.oculto { opacity: 0; pointer-events: none; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #eee;
  border-top-color: var(--primario);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loading p {
  font-size: .85rem;
  color: var(--texto-light);
  font-weight: 600;
}

/* ── Toast ────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
  z-index: 9998;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
}
#toast.visible { opacity: 1; }

/* ── Root ─────────────────────────────────────── */
#root { min-height: 100dvh; }
