:root {
  /* Marca: crema dominante, verde estructural y rojo para acciones/precios. */
  --brand-red: #d93620;
  --brand-red-dark: #a92518;
  --brand-red-soft: #f4d7d1;
  --brand-green: #28651f;
  --brand-green-deep: #1f4f19;
  --brand-green-medium: #3f7a32;
  --brand-green-soft: #e7f0e3;
  --brand-cream: #f7f1e7;
  --brand-cream-light: #fcf8f1;
  --brand-white: #ffffff;
  --brand-ink: #20231f;
  --brand-muted: #62665e;
  --brand-yellow: #f7bd27;
  --brand-orange: #f47b20;
  --brand-orange-deep: #a34a19;

  --color-primary: var(--brand-red);
  --color-primary-hover: var(--brand-red-dark);
  --color-secondary: var(--brand-green-deep);
  --color-secondary-hover: var(--brand-green);
  --color-surface: var(--brand-white);
  --color-surface-alt: var(--brand-cream-light);
  --color-text: var(--brand-ink);
  --color-text-muted: var(--brand-muted);
  --color-border: #ded8cd;
  --color-input-border: #85887e;
  --color-disabled: #e8e5de;
  --color-on-dark: var(--brand-cream-light);
  --color-focus: var(--brand-green-deep);
  --color-focus-on-dark: var(--brand-yellow);

  /* Estados independientes de la marca; siempre acompañados por texto. */
  --color-success: #22603d;
  --color-success-soft: #e6f2e9;
  --color-success-border: #9dc8aa;
  --color-warning: #805114;
  --color-warning-soft: #fff1d6;
  --color-warning-border: #cfac71;
  --color-danger: #962b40;
  --color-danger-soft: #fbecef;
  --color-danger-border: #dba3af;
  --color-info: #315b73;
  --color-info-soft: #eaf1f5;
  --color-environment: #5b2a86;
  --color-environment-soft: #e9d2ff;
  --shadow-rgb: 42 32 21;

  /* Alias de compatibilidad: no se cambia la estructura de componentes. */
  --brand-red-deep: var(--brand-red-dark);
  --ink: var(--color-text);
  --ink-soft: #4d514a;
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --surface: var(--color-surface);
  --surface-soft: var(--color-surface-alt);
  --surface-tint: var(--brand-cream);
  --shadow-soft: 0 0.75rem 2rem rgb(var(--shadow-rgb) / 8%);
  --shadow-card: 0 0.4rem 1.5rem rgb(var(--shadow-rgb) / 7%);
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface-soft);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--surface-soft);
  line-height: 1.5;
}

body,
button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  color: inherit;
}

a {
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

.container {
  width: min(100% - 2rem, 74rem);
  margin-inline: auto;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: #ffffff;
  background: var(--brand-red-deep);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

@media (min-width: 48rem) {
  .container {
    width: min(100% - 4rem, 74rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.environment-indicator {
  position: fixed;
  z-index: 60;
  right: 0.75rem;
  bottom: 0.75rem;
  max-width: min(24rem, calc(100% - 1.5rem));
  padding: 0.45rem 0.65rem;
  color: #fff;
  background: var(--color-environment);
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 999px;
  box-shadow: 0 0.35rem 1rem rgb(42 32 21 / 18%);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* 404 pública: sin dependencias del catálogo ni de configuración. */
.not-found {
  width: min(100% - 2rem, 38rem);
  margin: clamp(2rem, 10vh, 6rem) auto;
  padding: clamp(1.25rem, 5vw, 3rem);
  border-top: 0.3rem solid var(--brand-red);
  border-radius: var(--radius-lg);
  background: var(--brand-cream);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.not-found-brand { display: inline-block; width: min(12rem, 80%); }
.not-found-brand img { width: 100%; height: auto; }
.not-found-code { margin: 1rem 0 0; color: var(--brand-red-dark); font-size: clamp(4rem, 20vw, 7rem); font-weight: 900; line-height: 1; }
.not-found h1 { color: var(--brand-green-deep); font-size: clamp(1.5rem, 5vw, 2rem); }
.not-found-link { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.65rem 1rem; border-radius: var(--radius-sm); color: var(--brand-white); background: var(--brand-green-deep); font-weight: 800; }
.not-found-link:hover { background: var(--brand-red-dark); }
