:root { --services-offset: 160px; }

/* RESET --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #08090b;
  color: #f1f1f1;
  line-height: 1.65;
}

/* MATERIAL SYMBOLS (global) ------------------------------------------ */
/* De los <style> inline en index / legal / cookies / privacy / contact */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 56px;
  line-height: 1;
}

/* UTILIDADES FORM / ACCESIBILIDAD (de contact) ----------------------- */
/* Estado accesible del formulario (aria-live) */
.form-status { margin-top: .75rem; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial; }
.form-status.ok { color: #19a974; }
.form-status.err{ color: #e03131; }

/* BOTÓN: estado de carga deshabilita interacción */
.is-loading { opacity: .7; pointer-events: none; }

/* Honeypot oculto */
.hp { display: none !important; }

/* Utility para ocultar visualmente pero accesible a lectores de pantalla */
.sr-only{
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* HEADER -------------------------------------------------------------- */
.main-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: 60px;
  background: rgba(8, 9, 11, 0.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 9999;
}

.header-inner {
  width: 700px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.logo-link {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

.logo-link:focus-visible {
  outline: 2px solid #547993;
  outline-offset: 4px;
}

.logo { height: 30px; width: auto; }

/* TAGLINE ------------------------------------------------------------- */
.tagline {
  max-width: 680px;
  margin: 130px auto 70px;
  padding: 0 20px;
  text-align: center;
  font-size: 2.8rem;
  line-height: 1.2;
  color: #fff;
}

/* IMAGEN SERVICIOS ---------------------------------------------------- */
.services {
  padding: 0;
  position: relative;
  perspective: 4000px;
  perspective-origin: 100% 0;
  transform-style: preserve-3d;
}

.services-img {
  display: block;
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 120px auto;
  border-radius: 10px;
  border: 1px solid #1e1e1e;
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
  backface-visibility: hidden;
  transform-origin: top left;
  transform: translateX(-5%) scale(1.2)
             rotateX(47deg) rotateY(31deg) rotate(324deg);
}

@media (max-width: 1199.98px) {
  .services { overflow-x: hidden; overflow-y: hidden; }
  .services-img {
    transform-origin: top center;
    transform: scale(1.2)
               rotateX(47deg) rotateY(31deg) rotate(324deg)
               translateX(-15%);
  }
}

@media (max-width: 740px) {
  .services { overflow-x: hidden; overflow-y: hidden; }
  .services-img {
    transform-origin: top center;
    transform: scale(1.2)
               rotateX(47deg) rotateY(31deg) rotate(324deg)
               translateX(-19%)
               translateY(5%);
  }
}

/* BLOQUE STICKY ------------------------------------------------------- */
.tagline-wrapper {
  margin: 70px 0;
  height: 200vh;
  padding-top: 50vh;
  position: relative;
}

.tagline-alt {
  position: sticky;
  top: 50%;
  transform: translateY(-50%);
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
  font-size: 2.8rem;
  line-height: 1.2;
  font-weight: 600;
  color: #08090b;
}

.letter { display: inline-block; }

/* ---------- BLOQUE TARJETAS + CTA ----------------------------------- */
.services-block {
  margin-top: 60px;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 50px;
  padding: 0 20px 60px;
}

/* ---------- TARJETAS (rejilla adaptable) ----------------------------- */
.services-cards {
  display: grid;
  justify-content: center;
  gap: 1.5rem;
}

@media (min-width: 1200px)   { .services-cards { grid-template-columns: repeat(4, 280px); } }
@media (min-width: 768px) and (max-width: 1199.98px) { .services-cards { grid-template-columns: repeat(2, 280px); } }
@media (max-width: 767.98px) { .services-cards { grid-template-columns: 280px; } }

/* TARJETA ------------------------------------------------------------- */
.card {
  width: 280px;
  min-height: 360px;
  background: #101214;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: transform .4s;
  outline: none;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #547993;
  text-align: left;
  margin: 4px 0 12px;
}

.icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #08090b;
  background: var(--card-color);
  transition: transform .6s cubic-bezier(.4,0,.2,1);
  margin: 0 auto 14px;
}

.icon svg {
  width: 50px;
  height: 50px;
}

.card:nth-child(1) { --card-color: #74CFFF; }
.card:nth-child(2) { --card-color: #32D6FF; }
.card:nth-child(3) { --card-color: #A8D9F0; }
.card:nth-child(4) { --card-color: #C3DCE8; }

.card-body p {
  font-size: .9rem;
  color: #d0d0d0;
  line-height: 1.55;
}

/* Hover / Focus / Active --------------------------------------------- */
.card:hover,
.card:focus,
.card:active { transform: translateY(-10px); }

.card:hover .icon,
.card:focus .icon,
.card:focus-within .icon,
.card:active .icon { transform: rotate(10deg) scale(1.15); }

/* ---------- EFECTO REVEAL ------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(-40px);
  transition: opacity .8s ease-out var(--delay, 0s),
              transform .8s ease-out var(--delay, 0s);
}

.reveal.in-view { opacity: 1; transform: translateY(0); }

/* BOTÓN CTA ----------------------------------------------------------- */
.cta-section { text-align: center; }

.cta-button {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .9rem;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  color: #08090b;
  background: #c3dce8;
  padding: 12px 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: transform .3s ease, background .3s ease, box-shadow .3s ease;
}

.cta-button:hover,
.cta-button:focus-visible {
  background: #a8d9f0;
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}

.cta-button:active { transform: translateY(0); }

/* RESPONSIVE ESPECÍFICO PARA IMAGEN ---------------------------------- */
@media (max-width: 859px) {
  .services      { padding: 0 20px; }
  .services-img  { width: 100%; }
}

@media (max-width: 768px) {
  .services-img  { width: 100%; margin-top: 0; }
}

@media (max-width: 767px) {
  .header-inner { width: calc(100% - 40px); margin: 0 20px; }
  .tagline      { margin-top: 150px; margin-bottom: 70px; font-size: 2.4rem; }
  .tagline-alt  { font-size: 2.4rem; }
}

/* ========== CONTACT PAGE =========================================== */

/* 0 · Reservar siempre espacio para la barra vertical ---------------- */
html{ scrollbar-gutter: stable; }
body{ overflow-y: scroll; }

/* 0bis · Layout solo para páginas con .contact-layout ---------------- */
body.contact-layout{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
body.contact-layout .page-main{
  flex:1 0 auto;
}

/* 1 · Sin margen extra tras el header (60 px de alto + 20 px aire) --- */
.contact-section{
  margin:80px auto 60px;
  max-width:680px;
  padding:0 20px;
  text-align:center;
}

.contact-title{
  font-size:2.4rem;
  font-weight:600;
  margin-bottom:40px;
  color:#fff;
}

/* ---------- FORM --------------------------------------------------- */
.contact-form{
  display:flex;
  flex-direction:column;
  gap:20px;
}

.contact-form input,
.contact-form textarea{
  width:100%;
  padding:14px 18px;
  border:1px solid #1e1e1e;
  border-radius:8px;
  background:#101214;
  color:#f1f1f1;
  font-family:'Inter',sans-serif;
  font-size:.9rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder{ color:#6b6b6b; }

.contact-form textarea{
  min-height:160px;
  resize:vertical;
}

/* Consentimiento privacidad ------------------------------------------ */
.consent-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
  text-align:left;
  font-size:.85rem;
  color:#d0d0d0;
}

.consent-row a{
  color:#fff;
  text-decoration:underline;
}

.consent-row input[type="checkbox"]{
  width:18px;
  height:18px;
  margin-top:2px;
  accent-color:#c3dce8; /* color del check en navegadores compatibles */
}

/* 2 · Botón a 20 px del último campo -------------------------------- */
.contact-form button{
  align-self:center;
  margin-top:20px;
  padding:12px 32px;
  border:none;
  border-radius:8px;
  background:#c3dce8;
  color:#08090b;
  font-weight:600;
  text-transform:uppercase;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(0,0,0,.25);
  transition:transform .3s,background .3s,box-shadow .3s;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px; /* más espacio entre spinner y texto */
}

/* Spinner + estado de envío en el botón (se usa ::before, no la <span>) */
.btn-loading { pointer-events:none; }
.btn-loading::before{
  content:'';
  position:absolute;
  left:14px;
  top:50%;
  transform: translateY(-50%);
  width:16px;
  height:16px;
  border:2px solid rgba(8,9,11,.3);
  border-top-color:#08090b;
  border-radius:50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Centrado del texto cuando hay spinner (deja espacio a la izquierda) */
.btn-loading{ padding-left:42px; }

.contact-form button:hover,
.contact-form button:focus-visible{
  background:#a8d9f0;
  transform:translateY(-4px);
  box-shadow:0 10px 24px rgba(0,0,0,.35);
}

.contact-form button:active{ transform:translateY(0); }

/* ---------- MODAL -------------------------------------------------- */
.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.75);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:10000;
  opacity:0;
  pointer-events:none;
  transition:opacity .3s;
}

.modal.show{
  opacity:1;
  pointer-events:all;
}

.modal-content{
  background:#101214;
  border-radius:12px;
  padding:40px 28px;
  max-width:380px;
  width:calc(100% - 40px);
  text-align:center;
  box-shadow:0 8px 24px rgba(0,0,0,.45);
}

.modal-content p{ margin-bottom:24px; }

.modal-content button{
  padding:10px 26px;
  border:none;
  border-radius:8px;
  background:#c3dce8;
  color:#08090b;
  font-weight:600;
  cursor:pointer;
  transition:transform .2s,background .2s,box-shadow .2s;
}

.modal-content button:hover,
.modal-content button:focus-visible{
  background:#a8d9f0;
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(0,0,0,.35);
}

.modal-content button:active{ transform:translateY(0); }

.modal-content.ok,
.modal-content.err { border:none; }

.modal-content.ok,
.modal-content.ok .material-symbols-outlined,
.modal-content.err,
.modal-content.err .material-symbols-outlined {
  color: inherit;
}

/* Responsive -------------------------------------------------------- */
@media(max-width:767px){
  .contact-section{ margin-top:160px; }
  .contact-title  { font-size:2rem;   }
}

/* ========== LEGAL PAGE ============================================= */

/* 1) Separación del título respecto al header fijo: */
body.legal-layout .contact-section{
  margin-top:80px;
}

/* 2) Tipografías y composición del cuerpo legal */
.legal-text p{
  margin-bottom: 1rem;
  color:#d0d0d0;
  font-size:.95rem;
  line-height:1.6;
  text-align: justify;
}

/* 3) H2 alineados a la izquierda */
.legal-heading{
  font-size:1.1rem;
  font-weight:600;
  margin: 1rem 0 .4rem;
  color:#fff;
  text-align:left;
}

/* 4) Enlaces dentro del texto legal: mismo aspecto que el texto */
.legal-text a{
  color: inherit;
  text-decoration: none;
  pointer-events: none;
  cursor: default;
}

/* ========== FOOTER ================================================== */
.main-footer{
  height:60px;
  border-top:1px solid rgba(255, 255, 255, 0.12);
  display:flex;
  align-items:center;
  background:#08090b;
}

.footer-inner{
  width:700px;
  margin:0 auto;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  text-align:center;
  padding:0 20px;
}

.footer-copy{
  font-size:.8rem;
  color:#d0d0d0;
  line-height:1.1;
}

.footer-links{
  display:flex;
  align-items:center;
  gap:16px;
  font-size:.8rem;
  line-height:1.1;
}

.footer-links a.footer-legal{
  color:#d0d0d0;
  text-decoration:none;
}

.footer-links a.footer-legal:hover{
  text-decoration:underline;
}

.footer-links a.footer-legal:focus-visible{
  outline:2px solid #547993;
  outline-offset:2px;
  border-radius:2px;
}

/* Responsive footer ancho pequeño — 2 LÍNEAS ------------------------- */
@media (max-width: 767px){
  .main-footer{
    height:auto;
    padding:10px 0;
  }

  .footer-inner{
    width:calc(100% - 20px);
    padding:0 10px;
    gap:4px;
  }

  .footer-copy{
    font-size: clamp(0.5rem, 2.7vw, 0.75rem);
    line-height: 1.15;
    white-space: nowrap;
    letter-spacing: -0.01em;
  }

  .footer-links{
    gap:10px;
    font-size: clamp(0.5rem, 2.7vw, 0.75rem);
    line-height: 1.15;
    flex-wrap: nowrap;
    justify-content:center;
    white-space: nowrap;
  }

  .footer-links a.footer-legal{
    white-space: nowrap;
  }
}
