/* 3mjp — sistema visual base. Tokens tomados del manual de identidad oficial. */

:root {
  --bright: #00A2FF;
  --primary: #0077D9;
  --deep: #0B3D91;
  --navy: #0B1E32;
  --graphite: #1A1A1A;
  --steel: #8EA2B8;
  --light: #F4F7FA;
  --white: #FFFFFF;
  --line: #DCE5EE;

  --font: 'Montserrat', 'Arial', 'Helvetica Neue', sans-serif;

  --gradient-brand: linear-gradient(135deg, var(--bright), var(--deep));

  --max-width: 1200px;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(11, 30, 50, 0.06), 0 1px 1px rgba(11, 30, 50, 0.04);
  --shadow-md: 0 12px 28px rgba(11, 30, 50, 0.10);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/assets/fonts/montserrat-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/montserrat-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/montserrat-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/montserrat-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/montserrat-var-latin.woff2') format('woff2');
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@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; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--graphite);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 { font-weight: 700; color: var(--navy); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 var(--space-2); }
h1 { font-size: clamp(2.4rem, 1.6rem + 3.2vw, 4.4rem); letter-spacing: -0.03em; line-height: 1.02; }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.6rem); }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }

.section-tag {
  display: inline-block; color: var(--primary); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 700; margin-bottom: var(--space-1);
}
.section-tag--invert { color: var(--bright); }
p { margin: 0 0 var(--space-2); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; height: auto; }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-3); }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--navy); color: var(--white);
  padding: 0.75rem 1rem; z-index: 1000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-top: var(--space-2); padding-bottom: var(--space-2); gap: var(--space-3); }
.brand img { width: 140px; height: auto; }
.primary-nav { display: flex; align-items: center; gap: var(--space-4); }
.primary-nav ul { list-style: none; display: flex; gap: var(--space-3); margin: 0; padding: 0; }
.primary-nav a { color: var(--navy); font-weight: 500; font-size: 0.95rem; }
.primary-nav a:hover { color: var(--primary); text-decoration: none; }
.primary-nav a[aria-current="page"] { color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--navy); margin: 5px 0; transition: transform 0.2s ease, opacity 0.2s ease; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--white);
    flex-direction: column; align-items: stretch; padding: var(--space-3); border-bottom: 1px solid var(--line);
    display: none;
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav ul { flex-direction: column; gap: var(--space-2); }
  .btn-nav-cta { margin-top: var(--space-2); text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: none; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--gradient-brand); color: var(--white); background-clip: padding-box; }
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-outline { padding: calc(0.85rem - 1px) calc(1.5rem - 1px); border: 1px solid var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-outline-invert { padding: calc(0.85rem - 1px) calc(1.5rem - 1px); border: 1px solid var(--white); color: var(--white); background: transparent; }
.btn-outline-invert:hover { background: var(--white); color: var(--navy); }
.btn[disabled] { opacity: 0.65; cursor: not-allowed; }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

/* ---------- Hero ---------- */
.hero { background: var(--light); padding: var(--space-6) 0; overflow: hidden; position: relative; }
.hero::after {
  content: ""; position: absolute; right: -220px; top: -320px; width: 780px; height: 780px;
  border: 1px solid rgba(0,119,217,.12); border-radius: 50%;
  box-shadow: 0 0 0 100px rgba(0,119,217,.03), 0 0 0 220px rgba(0,119,217,.02);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--space-5); align-items: center; }
.hero-lead { color: #4A5E70; font-size: 1.1rem; max-width: 52ch; }
.hero-note { font-size: 0.8rem; color: #66798A; margin-top: var(--space-2); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.76rem; font-weight: 700; color: var(--deep); margin-bottom: var(--space-2); }
.hero-visual { display: flex; justify-content: center; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-visual { order: -1; margin: 0 auto var(--space-3); }
}

/* ---------- System map (hero visual) ---------- */
.system-map { position: relative; width: min(100%, 420px); aspect-ratio: 1/1; margin-inline: auto; }
.sm-ring { position: absolute; inset: 9%; border: 1px solid rgba(0,119,217,.2); border-radius: 50%; }
.sm-ring--inner { inset: 25%; border-style: dashed; }
.sm-core {
  position: absolute; inset: 39%; display: grid; place-items: center; border-radius: 50%; color: var(--white);
  background: var(--navy); font-weight: 700; font-size: 0.95rem; letter-spacing: -0.02em;
  box-shadow: 0 18px 40px rgba(11,30,50,.2);
}
.sm-node {
  position: absolute; width: 148px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 0.8rem 1rem; background: var(--white); border: 1px solid var(--line); color: var(--navy);
  font-size: 0.82rem; box-shadow: 0 10px 26px rgba(11,30,50,.08);
}
.sm-node small { color: var(--steel); font-weight: 500; font-size: 0.68rem; }
.sm-node--1 { top: 3%; left: 30%; }
.sm-node--2 { right: -6%; top: 41%; }
.sm-node--3 { bottom: 2%; left: 28%; }
.sm-node--4 { left: -6%; top: 41%; }
.sm-line { position: absolute; background: rgba(0,119,217,.35); height: 1px; transform-origin: left center; }
.sm-line--1 { width: 90px; left: 42%; top: 33%; transform: rotate(83deg); }
.sm-line--2 { width: 82px; left: 58%; top: 50%; transform: rotate(4deg); }
.sm-line--3 { width: 88px; left: 42%; top: 66%; transform: rotate(-80deg); }
.sm-line--4 { width: 84px; left: 26%; top: 50%; transform: rotate(180deg); }

@media (max-width: 560px) {
  .system-map { transform: scale(0.92); }
  .sm-node { width: 120px; font-size: 0.72rem; padding: 0.6rem 0.7rem; }
}

/* ---------- Page intro (non-home pages) ---------- */
.page-intro { padding: var(--space-5) 0 var(--space-4); background: var(--light); }
.page-intro .lead, .section-lead { color: #3b4a5a; font-size: 1.1rem; max-width: 62ch; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { background: var(--light); border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.breadcrumbs .wrap { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.breadcrumbs a { color: var(--graphite); }
.crumb-sep { margin: 0 0.4em; color: var(--steel); }
.breadcrumbs [aria-current="page"] { color: var(--primary); font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: var(--space-5) 0; }
.section-alt { background: var(--light); }
.section-band { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-inner { max-width: 72ch; }
.band-inner h2 { margin-bottom: var(--space-2); }

/* ---------- Icons (line style, no emoji) ---------- */
.icon-shape { display: inline-flex; color: var(--primary); margin-bottom: var(--space-2); }
.icon-shape svg { width: 30px; height: 30px; }

/* ---------- Service grid (secondary services / index) ---------- */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin-top: var(--space-4); }
.service-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.service-card {
  display: block; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); color: var(--graphite); transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--bright); text-decoration: none; }
.service-card--secondary { background: var(--light); }
.service-tag { display: block; color: var(--primary); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; margin-bottom: var(--space-2); }
.service-card h3 { margin-top: 0; }
.service-link { color: var(--primary); font-weight: 600; font-size: 0.9rem; }

@media (max-width: 900px) {
  .service-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .service-grid { grid-template-columns: 1fr; }
}

/* ---------- Service showcase (homepage lead services, asymmetric) ---------- */
.service-showcase { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 1px; margin-top: var(--space-4); background: var(--line); border: 1px solid var(--line); align-items: stretch; }
.service-block {
  display: flex; flex-direction: column; justify-content: flex-start; gap: var(--space-2);
  padding: var(--space-4); background: var(--white); color: var(--graphite); min-height: 220px;
}
.service-block:hover { text-decoration: none; background: var(--light); }
.service-block--lead {
  background: var(--navy); color: var(--white); position: relative;
  justify-content: flex-start;
}
.service-block--lead:hover { background: #0e2540; }
.service-block--lead h3, .service-block--lead p { color: var(--white); }
.service-block--lead .service-tag { color: var(--bright); }
.service-block--lead .service-link { color: var(--bright); }
.service-block--lead .service-block-sticky {
  position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--space-3);
}
/* The icon's own clipping mask, kept separate from the card so the card
   itself never uses overflow:hidden — that would break position:sticky
   on .service-block-copy below. */
.service-block--lead-icon-mask {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; border-radius: inherit;
}
.service-block--lead-icon {
  position: absolute; right: -20px; bottom: -20px; width: 220px; height: 220px; color: rgba(0,162,255,0.16);
}
.service-block--lead-icon svg { width: 100%; height: 100%; }
.service-block h3 { margin-bottom: var(--space-1); }
.service-block p { color: #647688; max-width: 46ch; margin-bottom: 0; }
.service-block--lead h3 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); }
.service-block--lead p { font-size: 1.05rem; max-width: 40ch; }

/* On desktop, let the lead card's text+link ease down the block as you
   scroll past it, instead of sitting fixed at the top with empty space
   beneath. Text and link stick together as one group so they can never
   overlap each other. */
@media (min-width: 901px) {
  .service-block--lead .service-block-sticky { position: sticky; top: 110px; }
}
.service-block .icon-shape { margin-bottom: 0; color: var(--primary); }
.service-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 1px; background: var(--line); }

@media (max-width: 900px) {
  .service-showcase { grid-template-columns: 1fr; }
  .service-block--lead { min-height: 0; }
}

/* ---------- Band / principles ---------- */
.band { background: var(--navy); color: var(--white); }
.band h2 { color: var(--white); }
.band-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: var(--space-5); align-items: start; }
.section-lead--invert { color: #B9C8D5; }
.principles { border-top: 1px solid rgba(255,255,255,.15); }
.principle { display: grid; grid-template-columns: 44px 1fr; gap: var(--space-2); padding: var(--space-3) 0; border-bottom: 1px solid rgba(255,255,255,.15); }
.principle span { color: var(--bright); font-weight: 700; }
.principle strong { display: block; margin-bottom: 0.4rem; color: var(--white); }
.principle p { margin: 0; color: #B9C8D5; font-size: 0.9rem; }

@media (max-width: 900px) {
  .band-grid { grid-template-columns: 1fr; }
}

/* ---------- Process steps ---------- */
.process-steps { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); counter-reset: step; }
.process-steps li { padding: var(--space-3); background: var(--white); border-radius: var(--radius); border: 1px solid var(--line); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-brand); color: var(--white); font-weight: 700; margin-bottom: var(--space-2);
}
@media (max-width: 900px) { .process-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .process-steps { grid-template-columns: 1fr; } }

/* ---------- Cards (colaboradores) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.info-card { padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--light); }
@media (max-width: 900px) { .card-grid { grid-template-columns: 1fr; } }

/* ---------- Checklist ---------- */
.checklist { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.checklist li { position: relative; padding-left: 1.75rem; }
.checklist li::before {
  content: ''; position: absolute; left: 0; top: 0.35em; width: 10px; height: 10px; border-radius: 3px;
  background: var(--gradient-brand);
}

/* ---------- Content blocks (service detail pages) ---------- */
.content-blocks { max-width: 860px; }
.content-block { padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.content-block:first-child { border-top: none; padding-top: 0; }
.content-block p { color: #3b4a5a; max-width: 68ch; }
.feature-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-4); }
.feature-list li { display: flex; align-items: flex-start; gap: 0.65rem; color: var(--graphite); }
.check-mark {
  flex: none; width: 20px; height: 20px; margin-top: 0.15em; border-radius: 50%;
  background: var(--light); border: 1px solid var(--line); position: relative;
}
.check-mark::after {
  content: ""; position: absolute; left: 5px; top: 3px; width: 5px; height: 9px;
  border: solid var(--primary); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

@media (max-width: 700px) {
  .feature-list { grid-template-columns: 1fr; }
}

/* ---------- Text rows (Nosotros) ---------- */
.text-rows { border-top: 1px solid var(--line); margin-top: var(--space-4); }
.text-row { display: grid; grid-template-columns: 0.6fr 1.4fr; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.text-row h3 { margin: 0; color: var(--navy); }
.text-row p { margin: 0; color: #526677; max-width: 62ch; }

@media (max-width: 700px) {
  .text-row { grid-template-columns: 1fr; gap: var(--space-1); }
}

/* ---------- Related links ---------- */
.related-links ul { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: grid; gap: var(--space-1); }
.related-links a { font-weight: 600; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--navy); color: var(--white); padding: var(--space-5) 0; text-align: center; }
.cta-band h2 { color: var(--white); }
.cta-band p { color: var(--steel); max-width: 56ch; margin-left: auto; margin-right: auto; }
.cta-band .cta-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--steel); }
.footer-main {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
  gap: var(--space-4); padding: var(--space-5) 0 var(--space-4);
}
.footer-brand { max-width: 34ch; }
.footer-word { display: block; font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--white); }
.footer-tagline { font-size: 0.72rem; letter-spacing: 0.12em; color: var(--bright); margin: 0.35rem 0 var(--space-2); }
.footer-desc { margin: 0; font-size: 0.9rem; color: var(--steel); }
.footer-col { display: flex; flex-direction: column; gap: 0.55rem; }
.footer-heading { color: var(--white); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 0.3rem; }
.site-footer a { color: var(--steel); font-size: 0.9rem; }
.site-footer a:hover { color: var(--white); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2);
  border-top: 1px solid rgba(255,255,255,0.1); padding: var(--space-2) 0 var(--space-3); font-size: 0.82rem;
}
.footer-bottom p { margin: 0; }
.footer-legal-inline { display: flex; gap: var(--space-3); }
.footer-legal-inline a { font-size: 0.82rem; }

@media (max-width: 700px) {
  .footer-main { flex-direction: column; gap: var(--space-3); }
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Contact page ---------- */
.contact-tabs { background: var(--light); border-bottom: 1px solid var(--line); position: sticky; top: 73px; z-index: 50; }
.tablist-inner { display: flex; gap: 0.5rem; padding-top: var(--space-2); padding-bottom: var(--space-2); flex-wrap: wrap; }
.contact-tab {
  font: inherit; font-weight: 600; color: var(--navy); font-size: 0.88rem; background: var(--white);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.55rem 1.1rem; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.contact-tab:hover { border-color: var(--bright); }
.contact-tab[aria-selected="true"] { background: var(--gradient-brand); color: var(--white); border-color: transparent; }
.contact-section { padding: var(--space-5) 0; scroll-margin-top: 140px; }
.contact-section[hidden] { display: none; }

.contact-form { max-width: 640px; margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.form-row { display: grid; gap: 0.4rem; }
.form-row label { font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.optional { font-weight: 400; color: var(--steel); font-size: 0.85rem; }
.form-row input, .form-row select, .form-row textarea {
  font-family: var(--font); font-size: 1rem; padding: 0.75rem 0.9rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--white); color: var(--graphite);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--bright); }
.form-row input:invalid[data-touched="true"], .form-row select:invalid[data-touched="true"] { border-color: #C0392B; }
.field-hint { font-size: 0.85rem; color: var(--steel); margin: 0; }
.field-hint[data-error-for] { color: #C0392B; }
.schedule-fieldset { border: 1px solid var(--line); border-radius: 10px; padding: var(--space-2); margin: 0; display: grid; gap: var(--space-2); }
.schedule-fieldset legend { font-weight: 600; color: var(--navy); padding: 0 0.4rem; }
.schedule-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: 0.5rem; }
.chip-label { font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.time-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.time-chip-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.time-chip {
  padding: 0.5rem 1rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; color: var(--navy); background: var(--white);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.time-chip:hover { border-color: var(--bright); }
.time-chip-input:checked + .time-chip { background: var(--gradient-brand); color: var(--white); border-color: transparent; }
.time-chip-input:focus-visible + .time-chip { outline: 3px solid var(--bright); outline-offset: 2px; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.form-status { min-height: 1.5em; font-weight: 600; }
.form-status[data-state="success"] { color: #1E7A34; }
.form-status[data-state="error"] { color: #C0392B; }
.direct-contact { list-style: none; padding: 0; display: grid; gap: 0.6rem; font-size: 1.05rem; }
.pending-value { color: var(--steel); font-style: italic; }

@media (max-width: 560px) {
  .schedule-inputs { grid-template-columns: 1fr; }
  .contact-tabs { top: 65px; }
}

.not-found { text-align: center; padding: var(--space-6) 0; }
