:root {
  /* Paleta cromática institucional */
  --navy-900: #031427;
  --navy-800: #0b2747;
  --navy-700: #123c69;
  --blue-600: #1f5ea9;
  --blue-400: #3f8ce0;
  --blue-200: #cde2ff;
  --aqua-100: #e9f6ff;
  --white: #ffffff;
  --text-primary: #08182c;
  --text-secondary: #5d6d86;
  --shadow-soft: 0 30px 60px -35px rgba(5, 27, 54, 0.45);
  --shadow-card: 0 22px 44px -30px rgba(7, 34, 68, 0.4);
  --transition: 240ms ease;
}

/* Reset básico para consistencia */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* Evita desbordes horizontales por unidades vw en móviles */
}

body {
  margin: 0;
  font-family: "Poppins", "Roboto", "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: linear-gradient(180deg, #f3f8ff 0%, #ffffff 60%);
  line-height: 1.6;
  overflow-x: hidden; /* Evita scroll horizontal global; lo manejamos dentro de cada card */
}

/* Utilidades de animación genéricas */
[data-animate] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--transition), transform var(--transition);
}

.is-visible,
[data-animate].is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

p {
  margin: 0 0 1rem;
}

.container {
  width: min(1180px, 92vw);
  margin: 0 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;
}

/* ------------------------------ */
/* Cabecera y navegación compacta */
/* ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(3, 20, 39, 0.9);
  color: var(--white);
  border-bottom: 1px solid rgba(63, 140, 224, 0.25);
  transition: background var(--transition), transform var(--transition);
}

.site-header--with-nav {
  border-bottom: none;
}

body.is-scrolled .site-header {
  background: rgba(3, 20, 39, 0.96);
  backdrop-filter: blur(12px);
  transform: translateY(0);
}

.header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 0.9rem 0.75rem;
}

.header-menu {
  justify-self: end;
  position: relative;
}

.header-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.45);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background var(--transition), box-shadow var(--transition);
}

.header-menu__chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition);
}

.header-menu__toggle[aria-expanded="true"] .header-menu__chevron {
  transform: rotate(-135deg);
}

.header-menu__panel {
  position: absolute;
  right: 0;
  margin-top: .5rem;
  min-width: 220px;
  padding: .4rem;
  background: rgba(3,20,39,.98);
  border: 1px solid rgba(63,140,224,.24);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  display: grid;
  gap: .2rem;
  z-index: 10000;
}

.header-menu__panel[hidden] { display: none !important; }

.header-menu__item {
  display: block;
  padding: .7rem .9rem;
  border-radius: 10px;
}

.header-menu__item:hover,
.header-menu__item:focus-visible {
  background: rgba(63,140,224,.18);
}

.header-menu__item button {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--white);
  text-align: left;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.header-menu__item button:hover,
.header-menu__item button:focus-visible {
  text-decoration: underline;
}

/* ------------------------------ */
/* Formulario admin crear usuario */
/* ------------------------------ */
.admin-form {
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.admin-form label {
  font-weight: 600;
  color: var(--navy-700);
}

.admin-form input,
.admin-form select {
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid rgba(18, 60, 105, 0.22);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: var(--aqua-100);
  color: var(--text-primary);
  transition: border var(--transition), box-shadow var(--transition), background var(--transition);
}

.admin-form input.is-ok,
.admin-form select.is-ok {
  border-color: #27ae60;
  background: #eafaf1;
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.18);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%2327ae60" viewBox="0 0 16 16"><path d="M13.485 1.929a1 1 0 0 1 .086 1.412l-7.25 8.25a1 1 0 0 1-1.5.04L2.43 10.18a1 1 0 1 1 1.414-1.414l1.488 1.487 6.555-7.456a1 1 0 0 1 1.598.132z"/></svg>');
  background-repeat: no-repeat;
  background-position: right .8rem center;
  background-size: 16px 16px;
}

.admin-form input.is-error,
.admin-form select.is-error {
  border-color: #c0392b;
  background: #fdecea;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18);
}

/* Micro feedback para inputs de stock */
.cantidad-input.ok {
  border: 1px solid #27ae60 !important;
  background: #eafaf1 !important;
  box-shadow: 0 0 0 3px rgba(39,174,96,.18) !important;
}

/* ===================== */
/* Admin - Presupuestos  */
/* ===================== */
.section-header {
  display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;
}

.card {
  background: #fff;
  border: 1px solid rgba(18,60,105,.12);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow-card);
}

.input-search {
  height: 42px;
  padding: 0 .9rem;
  min-width: 280px;
  border: 1px solid rgba(18,60,105,.22);
  border-radius: 14px;
  background: var(--aqua-100);
  color: var(--text-primary);
  transition: border var(--transition), box-shadow var(--transition), background var(--transition);
}
.input-search:focus {
  outline: none;
  border-color: var(--blue-600);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(63,140,224,.24);
}

.dropdown-panel {
  position: absolute;
  margin-top: .35rem;
  min-width: 100%;
  background: #fff;
  border: 1px solid rgba(18,60,105,.18);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  z-index: 1000;
  overflow: hidden;
}
.dropdown-panel[hidden]{ display:none !important; }
.dropdown-panel .dropdown-item {
  padding: .6rem .8rem;
  cursor: pointer;
}
.dropdown-panel .dropdown-item:hover {
  background: var(--aqua-100);
}

.inline-panel {
  position: absolute;
  margin-top: .4rem;
  background: #fff;
  border: 1px solid rgba(18,60,105,.18);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: .8rem;
  width: clamp(260px, 42vw, 520px);
  z-index: 1000;
}
.inline-panel[hidden]{ display:none !important; }
.inline-panel .form-row { display:grid; grid-template-columns: 1fr 1fr; gap:.5rem; }
.inline-panel label { font-size:.9rem; color: var(--navy-700); font-weight:600; }
.inline-panel input, .inline-panel select, .inline-panel textarea {
  font-family: inherit; font-size: .95rem; border:1px solid rgba(18,60,105,.22); border-radius: 10px; padding:.55rem .7rem; background:#fff;
}
.inline-panel .actions { display:flex; gap:.5rem; justify-content:flex-end; margin-top:.6rem; }

.table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

/* Wrapper opcional para tablas extensas */
.table-scroll { overflow-x: auto; width: 100%; max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-scroll { cursor: grab; scrollbar-width: thin; scrollbar-color: #b9cef3 transparent; }
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb { background: #b9cef3; border-radius: 10px; }
.table-scroll.dragging, .scroll-x.dragging { cursor: grabbing; user-select: none; }
.table-scroll { overflow-x: auto; width: 100%; max-width: 100%; -webkit-overflow-scrolling: touch; touch-action: pan-x; overscroll-behavior-x: contain; }
@media (max-width: 768px) {
  .table-scroll table { min-width: 960px; }
  .table-scroll table th,
  .table-scroll table td { white-space: nowrap; }
  .table-scroll { position: relative; }
  .table-scroll::after {
    content: "";
    position: sticky;
    right: 0;
    top: 0;
    width: 24px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to left, rgba(8,24,44,.08), rgba(8,24,44,0));
  }
}
.table thead th {
  text-align: left;
  font-weight: 600;
  font-size: .95rem;
  color: var(--navy-700);
  padding: .6rem .5rem;
  border-bottom: 1px solid rgba(18,60,105,.18);
  background: #f7fbff;
}
.table tbody td {
  padding: .5rem .5rem;
  border-bottom: 1px solid rgba(18,60,105,.12);
}
.table tbody tr:hover { background: #f9fcff; }

.pill {
  display:inline-flex;align-items:center;gap:.35rem;
  padding: .2rem .55rem; border-radius: 999px; background: var(--aqua-100); color: var(--navy-700); font-size: .8rem; border:1px solid rgba(18,60,105,.18);
}

.muted { color: var(--text-secondary); }

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

.summary-grid { display:grid; grid-template-columns: repeat(6, 1fr); gap: .6rem; }
.summary-card { padding:.8rem 1rem; border-radius:12px; border:1px solid rgba(18,60,105,.12); background:#fbfdff; }
.summary-card .label { font-size:.85rem; color: var(--text-secondary); }
.summary-card .value { font-weight:700; font-size:1.05rem; }

.pagination { display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; }
.pagination button { border:1px solid rgba(18,60,105,.22); background:#fff; border-radius:10px; padding:.35rem .6rem; cursor:pointer; }
.pagination button[disabled] { opacity:.6; cursor: not-allowed; }
.cantidad-input.error {
  border: 1px solid #c0392b !important;
  background: #fdecea !important;
  box-shadow: 0 0 0 3px rgba(192,57,43,.18) !important;
}

.admin-form input:focus,
.admin-form select:focus {
  outline: none;
  border-color: var(--blue-600);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(63, 140, 224, 0.24);
}

.admin-form .actions {
  grid-column: 1 / -1;
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.brand__logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: var(--white);
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* ========================= */
/* Responsive (móviles)      */
/* ========================= */
@media (max-width: 768px) {
  /* Usar 100% en lugar de 100vw para evitar overflow en móviles con barra de scroll */
  .container { width: 100%; padding-left: 12px; padding-right: 12px; }
  /* Hacer que los recuadros con contenido ancho (tablas/listas) se desplacen horizontalmente */
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  /* Permitir que los hijos de cards se encojan y no fuercen el ancho */
  .card, .card * { min-width: 0; }
  /* Asegurar un ancho mínimo de tablas internas para forzar scroll dentro del recuadro */
  .card > table,
  .card .table,
  .card .list-table,
  .card .clientes-table,
  .card .presupuestos-table,
  .card .detalle-table,
  table.table,
  table.list-table,
  table.clientes-table,
  table.presupuestos-table,
  table.detalle-table { min-width: 720px; }

  /* Encabezados compactos en móviles */
  .page-header { flex-direction: column; align-items: flex-start; gap: .6rem; }
}

/* Utilidad de scroll horizontal para recuadros/tablas anchas */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll-x { touch-action: pan-x; overscroll-behavior-x: contain; }
@media (max-width: 768px) { .scroll-x { max-width: 100%; display: block; } }
@media (max-width: 768px) {
  .scroll-x::after {
    content: "";
    position: sticky;
    right: 0;
    top: 0;
    width: 24px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to left, rgba(8,24,44,.08), rgba(8,24,44,0));
  }
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand__name {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand__tagline {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.72);
}

.primary-nav-wrapper {
  position: relative;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.65rem clamp(1rem, 6vw, 3rem);
  background: rgba(3, 20, 39, 0.88);
  border-top: 1px solid rgba(63, 140, 224, 0.24);
  border-bottom: 1px solid rgba(63, 140, 224, 0.16);
  backdrop-filter: blur(12px);
}

.site-header--with-nav .primary-nav-wrapper {
  border-top: 1px solid rgba(63, 140, 224, 0.18);
}

.nav {
  justify-self: end;
}

.primary-nav-wrapper .nav {
  justify-self: center;
}

.nav ul {
  display: flex;
  gap: 1.25rem;
  font-weight: 500;
}

.nav a {
  position: relative;
  padding: 0.35rem 0;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  background: var(--blue-400);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav a:hover::after,
.nav a:focus-visible::after,
.nav a.is-active::after {
  transform: scaleX(1);
}

.header__cta {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}

.header__cta:hover,
.header__cta:focus-visible {
  background: var(--blue-400);
  color: var(--navy-900);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  position: relative;
  cursor: pointer;
}

.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--white);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle__bar {
  top: 50%;
  transform: translateY(-50%);
}

.nav-toggle__bar::before {
  top: -10px;
}

.nav-toggle__bar::after {
  top: 10px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before {
  transform: translateY(10px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after {
  transform: translateY(-10px) rotate(-45deg);
}

/* ------------------------------ */
/* Hero con imagen y mensaje clave */
/* ------------------------------ */
.hero {
  position: relative;
  min-height: clamp(480px, 68vh, 720px);
  display: grid;
  align-items: center;
  isolation: isolate;
  color: var(--white);
  overflow: hidden;
}

.hero__background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  filter: saturate(112%) contrast(92%);
  transform: scale(1.02);
  z-index: -3;
}

.hero__background--home {
  background-image: url('../assets/rectificacion-de-motores.jpg');
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(3, 20, 39, 0.92), rgba(31, 94, 169, 0.78));
  z-index: -2;
}

.hero__content {
  margin: clamp(3.5rem, 7vw, 5.5rem) auto;
  padding: clamp(2rem, 4vw, 3rem);
  background: linear-gradient(150deg, rgba(3, 20, 39, 0.74), rgba(31, 94, 169, 0.52));
  border-radius: 32px;
  border: 1px solid rgba(205, 226, 255, 0.2);
  box-shadow: var(--shadow-soft);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: rgba(63, 140, 224, 0.18);
  border: 1px solid rgba(205, 226, 255, 0.35);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.hero h1 {
  margin: 1.2rem 0 0.9rem;
  font-size: clamp(2.5rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
}

.hero p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 2rem 0 1.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.95rem 2rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-3px);
}

.btn--primary {
  background: var(--white);
  color: var(--navy-800);
  box-shadow: 0 28px 54px -30px rgba(205, 226, 255, 0.75);
}

.btn--ghost {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.7);
  color: var(--white);
}

.btn--secondary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: var(--white);
  box-shadow: var(--shadow-card);
}

.btn--full {
  width: 100%;
}

.btn[disabled],
.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ------------------------------ */
/* Historia y presentación visual */
/* ------------------------------ */
.section--history {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(205, 226, 255, 0.42));
}

/* ------------------------------ */
/* Secciones principales */
/* ------------------------------ */
main {
  display: grid;
  gap: clamp(3rem, 7vw, 4.2rem);
  padding: clamp(3.5rem, 7vw, 5rem) 0 4rem;
}

.section {
  background: var(--white);
  border-radius: 32px;
  padding: clamp(2.4rem, 5vw, 3.4rem) clamp(2.1rem, 4vw, 3rem);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(63, 140, 224, 0.24);
}

.section--about {
  background: linear-gradient(155deg, rgba(3, 20, 39, 0.05), rgba(63, 140, 224, 0.18));
}

.section__layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.8rem, 4vw, 2.8rem);
  align-items: start;
}

.section__eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue-600);
  margin-bottom: 0.6rem;
}

.section h2 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 4vw, 2.8rem);
  color: var(--navy-800);
}

.section__content p {
  color: var(--text-secondary);
}

.pillars {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

.pillars li {
  padding: 1.4rem 1.2rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(63, 140, 224, 0.2);
  transition: transform var(--transition), box-shadow var(--transition);
}

.pillars li:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.pillars h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  color: var(--navy-700);
}

.about__media,
.history__media {
  display: grid;
  gap: 1.2rem;
}

.about__media figure,
.history__media figure {
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(63, 140, 224, 0.2);
  box-shadow: var(--shadow-card);
}

.about__media figcaption,
.history__media figcaption {
  padding: 0.85rem 1.1rem;
  background: rgba(3, 20, 39, 0.9);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
}

.timeline {
  margin-top: clamp(2rem, 5vw, 3rem);
  display: grid;
  gap: clamp(1.2rem, 3vw, 1.8rem);
  position: relative;
}

.timeline__item {
  position: relative;
  padding: 1.6rem 1.4rem 1.6rem 2.9rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(63, 140, 224, 0.22);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

.timeline__item::before {
  content: "";
  position: absolute;
  top: 1.6rem;
  left: 1.2rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue-400);
  box-shadow: 0 0 0 8px rgba(63, 140, 224, 0.18);
}

.timeline__item:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 52px -28px rgba(7, 34, 68, 0.42);
}

.timeline__year {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
  color: var(--navy-700);
  letter-spacing: 0.08em;
}

.timeline__item p {
  margin: 0;
  color: var(--text-secondary);
}

@media (min-width: 900px) {
  .timeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.mission__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.8rem, 4vw, 2.8rem);
  align-items: stretch;
}

.numbers-grid {
  margin-top: clamp(1.6rem, 4vw, 2.4rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.number-card {
  padding: 1.6rem 1.4rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(63, 140, 224, 0.22);
  box-shadow: var(--shadow-card);
}

.number-card h3 {
  margin: 0 0 0.3rem;
  font-size: 2rem;
  color: var(--blue-600);
}

.number-card span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.mission__image {
  position: relative;
  display: grid;
  align-content: flex-end;
  min-height: 320px;
  border-radius: 30px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  background-size: cover;
  background-position: center;
}

.mission__image--team {
  background-image: url('../assets/327551885_617995110134637_8090522016456208009_n.jpg');
}

.mission__image::before,
.mission__image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mission__image::before {
  background: linear-gradient(170deg, rgba(3, 20, 39, 0.82), rgba(31, 94, 169, 0.55));
}

.mission__image::after {
  background: radial-gradient(circle at 20% 20%, rgba(205, 226, 255, 0.28), transparent 60%);
  mix-blend-mode: screen;
}

.mission__image-content {
  position: relative;
  padding: clamp(2rem, 4vw, 3rem);
  display: grid;
  gap: 0.6rem;
}

.mission__image h3 {
  margin: 0;
  font-size: 1.65rem;
}

.mission__image p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.section--mission {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(205, 226, 255, 0.5));
}

.values-grid {
  margin-top: clamp(1.8rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
}

.value-card {
  padding: 1.8rem 1.6rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(63, 140, 224, 0.22);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

.value-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 52px -28px rgba(7, 34, 68, 0.4);
}

.value-card h3 {
  margin: 0 0 0.5rem;
  color: var(--navy-700);
}

.value-card p {
  margin: 0;
  color: var(--text-secondary);
}

.values-gallery {
  margin-top: clamp(2.2rem, 5vw, 3rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.values-gallery figure {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(63, 140, 224, 0.2);
  box-shadow: var(--shadow-card);
}

.values-gallery img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform var(--transition);
}

.values-gallery figure:hover img {
  transform: scale(1.05);
}

.values-gallery figcaption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  background: linear-gradient(180deg, transparent, rgba(3, 20, 39, 0.88));
  color: rgba(255, 255, 255, 0.86);
}

/* Servicios */
.section--services {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.92), rgba(205, 226, 255, 0.52));
}

.section__intro {
  max-width: 700px;
  color: var(--text-secondary);
}

.services-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.service-card {
  position: relative;
  padding: 1.85rem 1.6rem;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid rgba(63, 140, 224, 0.22);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.service-card::after {
  content: "";
  position: absolute;
  inset-inline: 25%;
  bottom: -65%;
  height: 130%;
  background: radial-gradient(circle, rgba(63, 140, 224, 0.18), transparent 70%);
  z-index: -1;
  transition: transform var(--transition);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 52px -28px rgba(7, 34, 68, 0.48);
}

.service-card:hover::after {
  transform: translateY(-10%);
}

.service-card__icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.service-card h3 {
  margin: 0 0 0.5rem;
  color: var(--navy-700);
}

.service-card p {
  margin: 0;
  color: var(--text-secondary);
}

/* Valores y galería corporativa */
.section--values {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(205, 226, 255, 0.42));
}

/* Contacto */
.section--contact {
  background: linear-gradient(150deg, rgba(205, 226, 255, 0.35), rgba(233, 246, 255, 0.92));
}

.contact__layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.8rem, 4vw, 2.8rem);
  align-items: start;
}

.contact__info p,
.contact__info li {
  color: var(--text-secondary);
}

.contact__list {
  display: grid;
  gap: 0.7rem;
}

.contact__list a {
  font-weight: 600;
  color: var(--blue-600);
}

.contact__actions {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.contact-form {
  background: var(--white);
  border-radius: 28px;
  padding: 2rem;
  border: 1px solid rgba(63, 140, 224, 0.22);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 0.75rem;
}

.contact-form h3 {
  margin: 0 0 0.5rem;
  color: var(--navy-700);
}

.contact-form label {
  font-weight: 600;
  color: var(--navy-700);
}

.contact-form input,
.contact-form textarea {
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid rgba(18, 60, 105, 0.22);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: var(--aqua-100);
  color: var(--text-primary);
  transition: border var(--transition), box-shadow var(--transition), background var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(63, 140, 224, 0.24);
}

.contact-form textarea {
  resize: vertical;
  min-height: 140px;
}

.form-status {
  display: block;
  margin: 0; /* sin espacio extra debajo */
  min-height: 1.2rem; /* reserva altura solo cuando hay texto */
  line-height: 1.2; /* compacidad para una sola línea */
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--blue-600);
}

.form-status--error {
  color: #c0392b;
}

.form-status--success {
  color: #1f5ea9;
}

.map {
  margin-top: 2rem;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(63, 140, 224, 0.24);
  box-shadow: var(--shadow-card);
}

.map iframe {
  width: 100%;
  min-height: 340px;
  border: 0;
}

/* Pie de página */
.site-footer {
  background: linear-gradient(200deg, rgba(3, 20, 39, 0.94), rgba(10, 41, 74, 0.88));
  color: rgba(255, 255, 255, 0.78);
  padding: 1.35rem 0 1.6rem;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  font-size: 0.92rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  align-items: center;
  justify-content: space-between;
}

.footer__layout {
  row-gap: 0.8rem;
}

.footer__brand,
.footer__note,
.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer__brand strong {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.92);
}

.footer__links {
  flex-direction: row;
  gap: 1.1rem;
  font-size: 0.9rem;
}

.footer__links a {
  color: rgba(255, 255, 255, 0.72);
  transition: color var(--transition);
}

.footer__links a:hover,
.footer__links a:focus-visible {
  color: rgba(255, 255, 255, 0.92);
}

.site-footer a {
  color: inherit;
}

/* ------------------------------ */
/* Animaciones y efectos */
/* ------------------------------ */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms ease, transform 600ms ease;
}

[data-animate="fade-left"] {
  transform: translateX(-32px);
}

[data-animate="fade-right"] {
  transform: translateX(32px);
}

[data-animate="zoom-in"] {
  transform: scale(0.94);
}

.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* ------------------------------ */
/* Pantalla de login               */
/* ------------------------------ */

.login-layout {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 120px);
  padding: clamp(2rem, 4vw, 3rem) 1.75rem 3rem;
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.login-card {
  width: min(420px, 100%);
  padding: 2.5rem;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(63, 140, 224, 0.24);
  display: grid;
  gap: 1.4rem;
}

.login-card__header {
  display: grid;
  gap: 0.45rem;
  text-align: center;
}

.login-card__title {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--navy-700);
}

.login-card__subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.login-card form {
  display: grid;
  gap: 1rem;
}

.login-card label {
  font-weight: 500;
  color: var(--navy-700);
}

.login-card input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(63, 140, 224, 0.3);
  background: rgba(233, 246, 255, 0.45);
  color: var(--text-primary);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.login-card input:focus-visible {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(31, 94, 169, 0.15);
}

.login-card button {
  border: none;
  border-radius: 999px;
  padding: 0.95rem;
  font-weight: 600;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: #ffffff;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.login-card button:hover,
.login-card button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 26px 52px -28px rgba(7, 34, 68, 0.42);
  outline: none;
}

.login-card__links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.login-card__links a {
  color: var(--blue-600);
  font-weight: 500;
}

.login-card__links a:hover,
.login-card__links a:focus-visible {
  text-decoration: underline;
}

/* ------------------------------ */
/* Responsividad */
/* ------------------------------ */
@media (max-width: 1024px) {
  .nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: rgba(3, 20, 39, 0.96);
    transform-origin: top;
    transform: scaleY(0);
    transition: transform var(--transition);
    border-bottom: 1px solid rgba(63, 140, 224, 0.24);
  }

  .nav ul {
    flex-direction: column;
    gap: 0;
  }

  .nav li {
    border-top: 1px solid rgba(63, 140, 224, 0.16);
  }

  .nav a {
    display: block;
    padding: 0.9rem 1.4rem;
  }

  .nav.is-open {
    transform: scaleY(1);
  }

  .nav-toggle {
    display: inline-block;
  }

  .header__cta {
    display: none;
  }

  .header__inner {
    grid-template-columns: auto auto auto;
  }
}

@media (max-width: 768px) {
  .hero__content {
    padding: 1.9rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mission__grid {
    gap: 1.6rem;
  }

  .mission__image-content {
    padding: 2rem;
  }

  .values-gallery {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .section {
    border-radius: 26px;
  }

  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
  }

  .footer__links {
    flex-wrap: wrap;
  }

  .map iframe {
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  .brand__text {
    display: none;
  }

  .services-grid,
  .values-gallery,
  /* Permitir scroll horizontal a nivel sección como fallback */
  .section { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .numbers-grid {
    grid-template-columns: 1fr;
  }

  .contact__actions {
    flex-direction: column;
  }

  .login-layout {
    padding: 1.75rem 1.25rem 2.5rem;
    margin-top: 1.25rem;
  }

  .login-card {
    padding: 2rem 1.75rem;
  }
}

/* Respeto por usuarios con reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  [data-animate] {
    transform: none !important;
    opacity: 1 !important;
  }
}
