/* ============ Design System ============ */
:root{
  --brand: #093067;         /* azul corporativo */
  --accent: #FF7F50;        /* coral */
  --fg: #0b1220;            /* texto base */
  --bg: #f7f8fb;            /* fondo */
  --muted: #64748b;         /* gris texto secundario */
  --card: #ffffff;          /* superficies */
  --border: #e5e7eb;        /* bordes sutiles */
  --shadow: 0 6px 20px rgba(2,6,23,.06);
  --radius: 14px;
  --container-xs: 440px;
  --container-md: 1100px;

  --fs-1: clamp(22px, 2.2vw, 28px);
  --fs-2: clamp(18px, 1.6vw, 22px);
  --fs-b: clamp(14px, 1.2vw, 16px);
  --space-1: clamp(12px, 2vw, 16px);
  --space-2: clamp(18px, 3vw, 26px);
  --space-3: clamp(22px, 4vw, 32px);
}

@media (prefers-color-scheme: dark){
  :root{
    --fg: #e5e7eb;
    --bg: #0b1220;
    --card: #0f1424;
    --border: #1f2937;
    --shadow: 0 8px 20px rgba(0,0,0,.4);
  }
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body{
  margin:0;
  font: 400 var(--fs-b)/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color:var(--fg);
  background:var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img{ max-width:100%; display:block; }

/* Layout helpers */
.container-auth{ max-width: var(--container-xs); margin-inline:auto; padding: var(--space-2); }
.container{ max-width: var(--container-md); margin-inline:auto; padding: var(--space-2); }
.center-v{ min-height: 100svh; display:grid; align-items:center; }

/* ============ Appbar (Dashboard/Nav) ============ */
.appbar{
  position: sticky; top:0; z-index:10;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 10px var(--space-2);
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.appbar .brand{
  display:flex; align-items:center; gap:12px;
  font-weight:700; color:var(--brand);
}
.appbar .brand img{ height:34px; }

/* ============ Card ============ */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2);
  box-shadow: var(--shadow);
}
.card--elev{ padding: var(--space-3); }

/* ============ Typography ============ */
h1,h2,h3{ margin:0 0 .4rem 0; color:var(--brand); letter-spacing:.2px; }
h1{ font-size: var(--fs-1); }
h2{ font-size: var(--fs-2); }
.p-muted{ color: var(--muted); }

/* ============ Forms ============ */
label{ display:block; font-weight:600; margin:.6rem 0 .35rem; }
.input{
  width:100%;
  padding: 12px 14px;
  background:transparent;
  border:1px solid var(--border);
  border-radius: 10px;
  color:inherit; font:inherit;
  transition: border .15s ease, box-shadow .15s ease;
}
.input::placeholder{ color: color-mix(in srgb, var(--muted) 70%, transparent); }
.input:focus{
  outline:0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, white);
}

/* ============ Buttons ============ */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:.55rem 1rem;
  border-radius: 8px;
  font-weight:600;
  font-size:0.95rem;
  line-height:1.2;
  cursor:pointer;
  text-decoration:none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
  border:1px solid transparent;
}
.btn:disabled,
.btn[aria-disabled="true"]{
  opacity:0.6; cursor:not-allowed;
}

.btn--primary{
  background-color: var(--brand);
  color:#fff;
}
.btn--primary:hover{
  background-color: color-mix(in srgb, var(--brand) 90%, black);
}

.btn--accent{
  background-color: var(--accent);
  color:#fff;
}
.btn--accent:hover{
  background-color: color-mix(in srgb, var(--accent) 90%, black);
}

.btn--ghost{
  background-color: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.btn--ghost:hover{
  background-color: color-mix(in srgb, var(--border) 25%, transparent);
}

.btn--block{ width:100%; }

/* ============ Alerts ============ */
.alert{
  padding: 10px 12px;
  border-radius: 10px;
  margin: 10px 0;
  border:1px solid;
  font-size:0.9rem;
}
.alert--error{ border-color:#ffd7cb; background:#fff3f0; color:#7a2e1b; }
.alert--ok{ border-color:#bdf0d1; background:#f0fff7; color:#0b5b37; }

/* ============ Grid utils ============ */
.grid{ display:grid; gap: var(--space-2); }
@media (min-width: 768px){
  .grid--3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* ============ Focus visible ============ */
:where(a, button, .btn, input):focus-visible{
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ============ Accessibility helpers ============ */
.sr-only{
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
