/* DQcero Servicios Industriales
   Paleta (5 colores, regla 80/20 del Taller 1):
   --navy  #0E2841  principal: encabezado, títulos y texto     (blanco sobre navy 15.6:1)
   --blue  #2F5DB0  secundario: enlaces y detalles (azul del catálogo, ajustado a 6.4:1 sobre blanco)
   --amber #F5B000  acento: SOLO botones principales            (navy sobre ámbar 8.2:1)
   --bg    #FFFFFF  fondo 80 %
   --alt   #F2F5FA  fondo alterno de secciones
   Tipografía: Montserrat (títulos) + Open Sans (texto). Sin serif, sin gradientes. */

:root {
  --navy: #0E2841;
  --blue: #2F5DB0;
  --amber: #F5B000;
  --amber-hover: #E0A100;
  --bg: #FFFFFF;
  --alt: #F2F5FA;
  --muted: #44566B;           /* texto de apoyo: 7.4:1 sobre blanco */
  --line: #D9E0EA;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(14, 40, 65, 0.10);
  --font: "Open Sans", Arial, sans-serif;
  --display: "Montserrat", Arial, sans-serif;
  --header-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }

body {
  background: var(--bg);
  color: var(--navy);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
button { font: inherit; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }

h1, h2, h3 { font-family: var(--display); line-height: 1.2; color: var(--navy); }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }

.eyebrow {
  font-family: var(--display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.muted { color: var(--muted); }
.lead { font-size: 1.125rem; }

/* ---------- Botones (Nielsen: consistencia, siempre iguales) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn-primary { background: var(--amber); color: var(--navy); }
.btn-primary:hover { background: var(--amber-hover); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--alt); }
.btn-light { background: transparent; color: #fff; border-color: #fff; }
.btn-light:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: #fff;
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--header-h); }

.logo { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; }
.logo svg { height: 40px; width: auto; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text small { font-size: 0.875rem; font-family: var(--font); }

.nav { display: none; align-items: center; gap: 1.5rem; }
.nav a:not(.btn) { color: #fff; text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
.nav .btn { min-height: 44px; padding: 0 1rem; }

.account { display: flex; align-items: center; gap: 0.75rem; }
.link-btn {
  background: none; border: 0; color: #fff; font-weight: 600; cursor: pointer;
  min-height: 44px; padding: 0 0.25rem; text-decoration: underline; text-underline-offset: 4px;
}

.menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 1px solid rgba(255,255,255,0.4); border-radius: var(--radius);
  background: none; color: #fff; cursor: pointer;
}
.menu-btn svg { width: 24px; height: 24px; }

.mobile-nav { display: none; border-top: 1px solid rgba(255,255,255,0.2); padding: 0.75rem 1.25rem 1.25rem; }
.mobile-nav.open { display: grid; gap: 0.25rem; }
.mobile-nav a:not(.btn), .mobile-nav .link-btn {
  color: #fff; text-decoration: none; font-weight: 600; padding: 0.75rem 0.25rem; text-align: left;
}
.mobile-nav .btn { margin-top: 0.5rem; }

.welcome-bar { background: var(--alt); color: var(--navy); font-size: 0.9375rem; text-align: center; padding: 0.5rem 1rem; }
.welcome-bar[hidden] { display: none; }

/* ---------- Portada ---------- */
.hero {
  position: relative;
  color: #fff;
  background: var(--navy) url("../img/hero.jpg") center / cover no-repeat;
}
.hero::before { content: ""; position: absolute; inset: 0; background: rgba(14, 40, 65, 0.78); } /* capa sólida, sin gradiente */
.hero .container { position: relative; padding-top: 4.5rem; padding-bottom: 4.5rem; }
.hero h1 { color: #fff; max-width: 44rem; }
.hero .eyebrow { color: var(--amber); }
.hero p.lead { margin-top: 1.25rem; max-width: 40rem; color: #fff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero-note { margin-top: 1rem; font-size: 0.9375rem; color: #fff; }
.hero-note a { color: #fff; font-weight: 700; }

/* ---------- Secciones ---------- */
.section { padding: 4rem 0; }
.section.alt { background: var(--alt); }
.section-head { max-width: 44rem; margin-bottom: 2.5rem; }
.section-head p { margin-top: 0.75rem; }

.grid { display: grid; gap: 1.25rem; }

/* Beneficios */
.benefit { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.benefit .icon {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--alt); color: var(--blue); margin-bottom: 1rem;
}
.benefit .icon svg { width: 28px; height: 28px; }
.benefit h3 { margin-bottom: 0.5rem; }

/* Tarjetas de servicio */
.card {
  display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--alt); }
.card-body { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.25rem; flex: 1; }
.card-body p { color: var(--muted); }
.card details { border-top: 1px solid var(--line); padding-top: 0.75rem; }
.card summary {
  cursor: pointer; font-weight: 700; color: var(--blue); min-height: 44px; display: flex; align-items: center;
  list-style: none;
}
.card summary::-webkit-details-marker { display: none; }
.card summary::before { content: "+"; display: inline-block; width: 1.25rem; font-weight: 700; }
.card details[open] summary::before { content: "−"; }
.card ul { margin: 0.25rem 0 0 1.25rem; color: var(--navy); font-size: 0.9375rem; }
.card li { margin: 0.35rem 0; }
.card .btn { margin-top: auto; align-self: flex-start; }

/* Cifras de confianza */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-top: 2rem; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; background: var(--bg); }
.stat strong { display: block; font-family: var(--display); font-size: 1.75rem; color: var(--navy); }
.stat span { color: var(--muted); font-size: 0.9375rem; }

/* Nosotros */
.about { display: grid; gap: 2rem; align-items: center; }
.about p + p { margin-top: 1rem; }
.about img { border-radius: var(--radius); border: 1px solid var(--line); }

/* Capacitación */
.training { display: grid; gap: 2rem; align-items: start; }
.training img { border-radius: var(--radius); border: 1px solid var(--line); }
.checklist { list-style: none; display: grid; gap: 0.6rem; margin: 1.25rem 0 1.75rem; }
.checklist li { display: flex; gap: 0.6rem; align-items: flex-start; }
.checklist svg { width: 22px; height: 22px; flex: none; color: var(--blue); margin-top: 2px; }

/* Proyectos */
.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.gallery figure { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery figcaption { padding: 0.75rem 1rem; font-size: 0.9375rem; font-weight: 600; }

/* Contacto */
.contact { display: grid; gap: 2rem; }
.contact-list { list-style: none; display: grid; gap: 1rem; margin-top: 1.5rem; }
.contact-list li { display: flex; gap: 0.75rem; align-items: flex-start; }
.contact-list svg { width: 24px; height: 24px; flex: none; color: var(--blue); margin-top: 2px; }
.contact-list a { font-weight: 600; }
.contact-box { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 2rem; }
.contact-box h3 { color: #fff; }
.contact-box p { margin: 0.75rem 0 1.5rem; }
.contact-box .btn { width: 100%; }
.contact-box .btn + .btn { margin-top: 0.75rem; }

/* Pie */
.site-footer { background: var(--navy); color: #fff; padding: 2.5rem 0; font-size: 0.875rem; }
.site-footer .container { display: grid; gap: 1.25rem; }
.site-footer a { color: #fff; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }

/* ---------- Modal de cuenta (Taller 2) ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(14, 40, 65, 0.6); }
.modal.open { display: flex; }
.modal-card { position: relative; width: 100%; max-width: 26rem; max-height: calc(100dvh - 2rem); overflow: auto; background: var(--bg); border-radius: var(--radius); padding: 1.75rem; }
.modal-close { position: absolute; top: 0.5rem; right: 0.5rem; width: 44px; height: 44px; border: 0; background: none; font-size: 1.75rem; color: var(--navy); cursor: pointer; }
.tabs { display: flex; gap: 0.5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.tab { flex: 1; min-height: 48px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font-weight: 700; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--blue); }
.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: 0.9375rem; }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 0.6rem 0.75rem; border: 1px solid #8A9AAE; border-radius: 8px;
  font: inherit; font-size: 1rem; color: var(--navy); background: var(--bg);
}
.field input[readonly] { background: var(--alt); }
.field small { color: var(--muted); font-size: 0.875rem; }
.form-msg { margin-top: 0.75rem; font-size: 0.9375rem; min-height: 1.5em; }
.form-msg.error { color: #B3261E; }  /* 6.2:1 sobre blanco */
.form-msg.ok { color: #1E6B35; }     /* 6.6:1 sobre blanco */
.modal .btn-primary, .profile .btn-primary { width: 100%; }
.modal .text-link { display: inline-block; margin-top: 0.75rem; background: none; border: 0; color: var(--blue); font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 44px; }

/* ---------- Perfil ---------- */
.profile { max-width: 32rem; margin: 3rem auto; padding: 0 1.25rem; }
.profile-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }
.avatar { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-family: var(--display); font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
.profile-actions { display: grid; gap: 0.75rem; margin-top: 0.5rem; }

/* ---------- Responsive (mobile-first) ---------- */
@media (min-width: 40rem) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-services { grid-template-columns: repeat(2, 1fr); }
}
/* Menú completo solo cuando cabe en una línea; antes, menú hamburguesa */
@media (min-width: 75rem) {
  .nav { display: flex; }
  .menu-btn, .mobile-nav, .mobile-nav.open { display: none; }
}
.nav a, .nav .link-btn, .btn { white-space: nowrap; }

@media (min-width: 64rem) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-services { grid-template-columns: repeat(3, 1fr); }
  .about { grid-template-columns: 1.2fr 1fr; }
  .training { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1.3fr 1fr; align-items: start; }
  .site-footer .container { grid-template-columns: 1fr auto; align-items: center; }
  .hero .container { padding-top: 6rem; padding-bottom: 6rem; }
  .section { padding: 5rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
