/* Paleta corporativa R&A Custodio Automotriz y componentes compartidos */
:root {
  /* Paleta oficial */
  --blue: #003F94;        /* Logotipo, botones y encabezados */
  --blue-deep: #002B63;   /* Fondos oscuros, textos destacados y contraste */
  --steel: #4C555E;       /* Textos secundarios */
  --silver: #AEB7C2;      /* Fondos secundarios, divisores y detalles */
  --soft: #F3F5F7;        /* Fondos de secciones y tarjetas */
  --white: #FFFFFF;       /* Fondos principales y contraste */

  /* Derivados de la paleta */
  --line: rgba(174, 183, 194, .55);
  --blue-tint: rgba(0, 63, 148, .08);
  --blue-tint-strong: rgba(0, 63, 148, .16);
  --shadow: 0 10px 26px rgba(0, 43, 99, .13);

  /* Colores funcionales, fuera de la paleta a propósito */
  --error: #B3261E;
  --error-tint: rgba(179, 38, 30, .09);
  --ok: #1B7A43;
  --ok-tint: rgba(27, 122, 67, .1);
  --wa: #25D366;
  --wa-hover: #1FBE5B;

  --radius: 16px;
  --radius-sm: 11px;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--white); color: var(--blue-deep);
  font: 400 15px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; color: var(--blue); }
p { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.solid-icon { fill: currentColor; stroke: none; fill-rule: evenodd; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Retícula para zonas en azul profundo */
.bg-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-size: 50px 50px;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.045) 1px, transparent 1px);
}

.glass { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s, transform .2s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--blue-deep); box-shadow: var(--shadow); }
.btn-outline { border-color: var(--blue); color: var(--blue); background: var(--white); }
.btn-outline:hover:not(:disabled) { background: var(--blue); color: var(--white); }
.btn-outline:disabled { border-color: var(--silver); background: var(--soft); color: var(--steel); }
.btn-ghost { border-color: var(--silver); color: var(--blue-deep); background: var(--white); }
.btn-ghost:hover:not(:disabled) { border-color: var(--blue); background: var(--soft); }
.btn-whatsapp { background: var(--wa); color: var(--blue-deep); font-weight: 700; }
.btn-whatsapp:hover:not(:disabled) { background: var(--wa-hover); box-shadow: var(--shadow); }
.btn-danger { border-color: var(--error); color: var(--error); background: var(--white); }
.btn-danger:hover:not(:disabled) { background: var(--error); color: var(--white); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--silver); background: var(--white); color: var(--blue-deep); transition: background-color .2s, border-color .2s, color .2s;
}
.icon-button:hover { background: var(--soft); border-color: var(--blue); color: var(--blue); }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-size: 13px; font-weight: 600; color: var(--blue-deep); padding: 0; }
.optional { color: var(--steel); font-weight: 400; }
.field input:not([type=radio]):not([type=checkbox]):not([type=file]), .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--white); border: 1px solid var(--steel); color: var(--blue-deep);
  font-size: 16px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--steel); opacity: .85; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint-strong);
}
.field [aria-invalid=true] { border-color: var(--error) !important; }
.field-error { color: var(--error); font-size: 13px; }
.field-hint { color: var(--steel); font-size: 12.5px; }
.form-error { padding: 10px 12px; color: var(--error); font-size: 13px; background: var(--error-tint); border: 1px solid var(--error); border-radius: 10px; }

.badge {
  position: absolute; top: 10px; left: 10px; z-index: 1; padding: 3px 9px; border-radius: 999px;
  background: var(--blue); color: var(--white); font: 700 10.5px/1.5 var(--mono); letter-spacing: .4px; text-transform: uppercase;
}
.badge-muted { background: var(--steel); }

.toasts { position: fixed; top: 16px; right: 16px; left: 16px; z-index: 2000; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 360px; padding: 12px 16px; border-radius: 10px;
  background: var(--white); color: var(--blue-deep); border: 1px solid var(--line); border-left: 4px solid var(--blue);
  box-shadow: var(--shadow); font-size: 14px; animation: toast-in .25s ease-out;
}
.toast-error { border-left-color: var(--error); }
.toast-ok { border-left-color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
