/* =============================================================
   PERLAS 2026 — base styles
   =============================================================
   Sistema de diseño compartido (no se acopla a ningún color de
   marca — los acentos los define cada vista en su CSS).
   ============================================================= */

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- utilidades compartidas ---------- */
.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: background 120ms ease, transform 80ms ease, border-color 120ms ease;
  white-space: nowrap;
}
.btn:hover  { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn--danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff;
}
.btn--danger:hover { background: #fef2f2; }

.input, .select, .textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 16px;            /* evita zoom automático en iOS */
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:hover, .select:hover, .textarea:hover { border-color: #c4c8d0; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  outline: none;
}
.textarea { min-height: 70px; resize: vertical; }

.label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field { display: flex; flex-direction: column; gap: 0; }
.field--row { flex-direction: row; align-items: center; gap: 8px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ============================================================
   RESPONSIVE — móvil
   ============================================================ */
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .input, .select, .textarea { font-size: 16px; min-height: 44px; padding: 12px 14px; }
  .btn { min-height: 42px; padding: 11px 16px; font-size: 14px; }
  .label { font-size: 11px; }
}

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

.muted   { color: var(--muted); }
.mono    { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tnum    { font-variant-numeric: tabular-nums; }
.right   { text-align: right; }
.center  { text-align: center; }
.nowrap  { white-space: nowrap; }

/* animaciones suaves */
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop     { 0% { transform: scale(0.96); } 100% { transform: scale(1); } }
.fade-in { animation: fade-in 200ms ease both; }
.pop     { animation: pop 200ms ease both; }
