/* SofSalud 360 — sistema de diseño base (ver Artifact "Sistema de Diseño — SofSalud 360" para la referencia visual completa) */

@font-face {
  font-family: "Montserrat SS";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/montserrat-600.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat SS";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/montserrat-700.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat SS";
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/montserrat-800.woff2") format("woff2");
}

:root {
  --bg: #F5FAFB;
  --surface: #FFFFFF;
  --surface-2: #EEF6F8;
  --line: #DAE6EA;
  --ink: #10222D;
  --ink-soft: #4E6873;
  --ink-faint: #5C7078;
  --accent: #04D9E6;
  --accent-deep: #0B6690;
  --accent-gradient: linear-gradient(135deg, #04D9E6 0%, #0E76A8 100%);
  --accent-wash: rgba(4, 217, 230, 0.10);
  --alert: #D6453A;
  --alert-wash: rgba(214, 69, 58, 0.10);
  --shadow: 0 1px 2px rgba(16, 34, 45, 0.04), 0 8px 24px rgba(16, 34, 45, 0.06);
  --radius: 14px;
  --max-width: 1120px;

  /* Fijos: el footer siempre es oscuro, independiente del tema claro/oscuro
     del sitio — es un "bookend" de marca, no una superficie que cambia. */
  --footer-bg: #0B1B22;
  --footer-bg-2: #0F2530;
  --footer-line: #1E3945;
  --footer-text: #EAF5F7;
  --footer-text-soft: #9FB8C2;
  --footer-accent: #2BE4EF;
  --warn: #B8790F;
  --warn-wash: rgba(217, 143, 24, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A161C;
    --surface: #10222D;
    --surface-2: #16303B;
    --line: #1E3945;
    --ink: #EAF5F7;
    --ink-soft: #A9C1C9;
    --ink-faint: #78919A;
    --accent: #2BE4EF;
    --accent-deep: #4FB3DE;
    --accent-gradient: linear-gradient(135deg, #2BE4EF 0%, #4FB3DE 100%);
    --accent-wash: rgba(43, 228, 239, 0.12);
    --alert: #FF7A6E;
    --alert-wash: rgba(255, 122, 110, 0.14);
    --warn: #E9A93F;
    --warn-wash: rgba(233, 169, 63, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 28px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .display {
  font-family: "Montserrat SS", -apple-system, sans-serif;
  text-wrap: balance;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

a { color: var(--accent-deep); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

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

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

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

p { color: var(--ink-soft); }

.btn {
  font-family: "Montserrat SS", sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, background-position 0.45s ease;
}
.btn-primary {
  background: var(--accent-gradient);
  background-size: 180% 180%;
  background-position: 0% 50%;
  color: #fff;
  text-shadow: 0 1px 3px rgba(6, 34, 42, 0.4);
  box-shadow: 0 8px 22px -8px rgba(14, 118, 168, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px rgba(14, 118, 168, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background-position: 100% 50%;
}
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--accent-deep); color: var(--accent-deep); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--accent-deep); padding-left: 4px; padding-right: 4px; border-radius: 6px; }
.btn-ghost:hover { gap: 12px; }
.btn-outline-light { background: rgba(255, 255, 255, 0.15); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.25); border-color: rgba(255, 255, 255, 0.7); transform: translateY(-2px); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Montserrat SS", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-deep);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.card:hover, .card.hoverable:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(16,34,45,0.05), 0 20px 40px -12px rgba(14,118,168,0.22);
  border-color: color-mix(in srgb, var(--accent-deep) 35%, var(--line));
}

.brand-logo {
  filter: grayscale(1);
  opacity: 0.7;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}
.brand-logo:hover, a:hover > .brand-logo {
  filter: grayscale(0);
  opacity: 1;
  transform: translateY(-3px) scale(1.05);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero con motivo de circuito — reinterpreta las trazas del logo sin repetirlo literal */
.hero-mock {
  position: relative;
  overflow: hidden;
}
.hero-mock::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%230E76A8' stroke-width='1.4' stroke-opacity='0.28'%3E%3Cpath d='M20 0v40h30v30'/%3E%3Cpath d='M140 20h-30v35'/%3E%3Cpath d='M0 100h35v40'/%3E%3Cpath d='M160 130h-40v-30h-30'/%3E%3Cpath d='M90 0v25h40'/%3E%3C/g%3E%3Cg fill='%2304D9E6' fill-opacity='0.38'%3E%3Ccircle cx='50' cy='40' r='3'/%3E%3Ccircle cx='110' cy='55' r='3'/%3E%3Ccircle cx='35' cy='140' r='3'/%3E%3Ccircle cx='90' cy='100' r='3'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 220px;
  -webkit-mask-image: radial-gradient(65% 65% at 20% 30%, black, transparent);
  mask-image: radial-gradient(65% 65% at 20% 30%, black, transparent);
}
.hero-mock > * { position: relative; z-index: 1; }

/* Hero con gradiente + corte diagonal — para la pieza "hero" de una página que
   necesita destacar más que el hero-mock estándar (fondo claro). */
.hero-cut {
  position: relative;
  background: var(--accent-gradient);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 64px), 0 100%);
  padding-bottom: 100px;
}
.hero-cut::before {
  content: "";
  position: absolute;
  top: -35%;
  right: -8%;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 70%);
  pointer-events: none;
}
.hero-cut::after {
  content: "";
  position: absolute;
  bottom: -20%;
  left: -6%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 70%);
  pointer-events: none;
}
.hero-cut > * { position: relative; z-index: 1; }
@media (max-width: 640px) {
  .hero-cut { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 32px), 0 100%); padding-bottom: 64px; }
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  font-family: "Montserrat SS", sans-serif;
  box-shadow: 0 10px 24px -8px rgba(6, 34, 42, 0.35);
}
.hero-chip svg { color: var(--accent-deep); flex-shrink: 0; }

/* Hero con gradiente + borde ondulado — variante de .hero-cut para no repetir
   siempre el mismo corte diagonal; misma familia, forma distinta. */
.hero-wave {
  position: relative;
  background: var(--accent-gradient);
  overflow: hidden;
  padding-bottom: 90px;
}
.hero-wave::before {
  content: "";
  position: absolute;
  top: -30%;
  left: -10%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.2), transparent 70%);
  pointer-events: none;
}
.hero-wave > .wrap { position: relative; z-index: 1; }
.hero-wave-svg { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 72px; display: block; }
@media (max-width: 640px) {
  .hero-wave { padding-bottom: 56px; }
  .hero-wave-svg { height: 44px; }
}

/* Chips/íconos flotantes decorativos sobre un hero con gradiente */
.hero-float-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255,255,255,0.28);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(6, 34, 42, 0.35);
  backdrop-filter: blur(3px);
  animation: floatY 5s ease-in-out infinite;
}
@media (max-width: 860px) {
  .hero-float-icon { display: none; }
}

/* Banda de cierre con arco superior — tercera forma de la familia
   .hero-cut / .hero-wave, esta vez en el borde de ENTRADA (arriba), no de
   salida, para variar y no repetir patrón. */
.band-arc { position: relative; overflow: hidden; }
.band-arc-svg { position: absolute; top: -1px; left: 0; right: 0; width: 100%; height: 90px; display: block; }
@media (max-width: 640px) {
  .band-arc-svg { height: 50px; }
}

.band-visual {
  border-radius: var(--radius);
}

/* Navegación responsive — checkbox-driven, sin JS */
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease;
}
.site-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.site-nav a:not(.btn):hover { color: var(--ink); background: var(--surface-2); }
.site-nav a:not(.btn):hover::after { transform: scaleX(1); }
.site-nav a.nav-active:not(.btn) { color: var(--ink); font-weight: 700; }
.site-nav a.nav-active:not(.btn)::after { transform: scaleX(1); }
/* Visualmente oculto pero enfocable/anunciable — display:none lo saca
   por completo del árbol de accesibilidad y del orden de tabulación. */
.nav-toggle-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.nav-toggle-input:focus-visible ~ .nav-toggle-btn {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}
.nav-toggle-btn { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; cursor: pointer; }
.nav-toggle-btn span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }

@media (max-width: 860px) {
  .nav-toggle-btn { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 24px 20px;
    box-shadow: 0 12px 24px -12px rgba(16,34,45,0.18);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
  }
  .site-nav a:not(.btn) { padding: 10px 0; width: 100%; }
  .site-nav a:not(.btn)::after { display: none; }
  .nav-toggle-input:checked ~ .site-nav { max-height: 480px; visibility: visible; }
  .nav-toggle-input:checked ~ .nav-toggle-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle-input:checked ~ .nav-toggle-btn span:nth-child(2) { opacity: 0; }
  .nav-toggle-input:checked ~ .nav-toggle-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Planes — patron resumen/detalle */
.plan-card summary { list-style: none; }
.plan-card summary::-webkit-details-marker { display: none; }
.plan-card summary::before { content: "+ "; }
.plan-card details[open] summary::before { content: "− "; }
.plan-card-featured { border-color: var(--accent-deep); box-shadow: 0 0 0 3px var(--accent-wash); }

.faq-item summary { list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }

/* Texto sobre --accent-gradient: ningún color plano cumple contraste AA en ambos extremos del gradiente */
.on-gradient, .on-gradient p { color: #fff; text-shadow: 0 1px 4px rgba(6, 34, 42, 0.55); }
.on-gradient-soft, .on-gradient p.on-gradient-soft { color: rgba(255, 255, 255, 0.88); text-shadow: 0 1px 3px rgba(6, 34, 42, 0.45); }

/* Selector de producto — tabs sin JS via radio */
.product-switch input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.switch-labels { display: flex; gap: 8px; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px; }
.switch-labels label { flex: 1; text-align: center; padding: 10px 18px; border-radius: 999px; font-family: "Montserrat SS", sans-serif; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--ink-soft); transition: background 0.2s ease, color 0.2s ease; white-space: nowrap; }
.switch-panel { display: none; }
#ptab-lab:checked ~ .switch-panels #ppanel-lab,
#ptab-vet:checked ~ .switch-panels #ppanel-vet,
#ptab-ocu:checked ~ .switch-panels #ppanel-ocu { display: block; }
#ptab-lab:checked ~ .switch-labels label[for="ptab-lab"],
#ptab-vet:checked ~ .switch-labels label[for="ptab-vet"],
#ptab-ocu:checked ~ .switch-labels label[for="ptab-ocu"] { background: var(--accent-gradient); color: #fff; text-shadow: 0 1px 3px rgba(6, 34, 42, 0.5); }

/* Toggle de dos columnas (Paciente / Equipo) */
.audience-toggle input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tab-icon { display: inline-flex; margin-right: 6px; vertical-align: -3px; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
#atab-paciente:checked ~ .audience-panels #apanel-paciente,
#atab-equipo:checked ~ .audience-panels #apanel-equipo { display: grid !important; animation: panelIn 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.audience-panels .audience-panel { display: none; }
.audience-panel .card { text-align: left; }
#atab-paciente:checked ~ .switch-labels label[for="atab-paciente"],
#atab-equipo:checked ~ .switch-labels label[for="atab-equipo"] { background: var(--accent-gradient); color: #fff; text-shadow: 0 1px 3px rgba(6, 34, 42, 0.5); }

/* Bento grid */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.bento > * { grid-column: span 12; }
@media (min-width: 860px) {
  .bento-7 { grid-column: span 7; }
  .bento-5 { grid-column: span 5; }
  .bento-3 { grid-column: span 3; }
  .bento-6 { grid-column: span 6; }
}

/* Pasos conectados — tarjetas + ícono + numeral degradado + línea de flujo */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 24px; position: relative; }
.step-card { position: relative; z-index: 1; }
.step-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.step-num-big {
  font-family: "Montserrat SS", sans-serif;
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.4;
}
.steps-line {
  display: none;
  position: absolute;
  top: 47px;
  left: calc(16.5% + 8px);
  right: calc(16.5% + 8px);
  height: 2px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
  z-index: 0;
}
html.js-reveal .steps-line.is-visible { transform: scaleX(1); }
@media (min-width: 860px) {
  .steps-line { display: block; }
}

/* Footer — siempre oscuro, colores fijos via --footer-* */
.footer-link { color: var(--footer-text-soft); text-decoration: none; transition: color 0.15s ease; overflow-wrap: anywhere; }
.footer-link:hover { color: var(--footer-accent); }
.footer-social {
  width: 32px; height: 32px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  color: var(--footer-text-soft);
  text-decoration: none; font-size: 12px; font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}
.footer-social:hover { background: var(--footer-accent); color: var(--footer-bg); }
.footer-social svg { width: 16px; height: 16px; flex-shrink: 0; }
.footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr)); } }

.section-eyebrow {
  font-family: "Montserrat SS", sans-serif;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Motion — Home únicamente. .js-reveal solo lo añade home.js, así que sin JS
   (o con prefers-reduced-motion) el contenido queda siempre visible. */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-fade { opacity: 0; animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.hero-fade-1 { animation-delay: 0.05s; }
.hero-fade-2 { animation-delay: 0.15s; }
.hero-fade-3 { animation-delay: 0.25s; }
.hero-fade-4 { animation-delay: 0.35s; }

html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
html.js-reveal .reveal.is-visible { opacity: 1; transform: translateY(0); }

.bento-glow { position: relative; overflow: hidden; }
.bento-glow::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.35), transparent 60%);
  pointer-events: none;
  opacity: 0.7;
}

/* Titular con rubro rotativo — solo se activa con JS (html.js-rotate), así que
   sin JS el h1 muestra los 3 rubros en texto plano, igual que antes. */
.rotate-words { display: inline; }
.rotate-word { font-weight: 800; }
html.js-rotate .rotate-words { position: relative; display: inline-grid; vertical-align: bottom; }
html.js-rotate .rotate-word {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html.js-rotate .rotate-word.is-active { opacity: 1; transform: translateY(0); }
html.js-rotate .rotate-sep { display: none; }

/* Blob orgánico con el degradado de marca, detrás de la imagen del hero —
   Opción A: le da color/forma al hero sin tocar el fondo de la sección (que
   debe quedar claro para que la palabra rotativa en gradiente-texto siga
   siendo legible). Reversible: quitar la clase "hero-blob-wrap" del wrapper
   y el <div class="hero-blob"> alcanza para volver al estado anterior. */
.hero-blob {
  position: absolute;
  inset: -6% -8% 4% 6%;
  background: var(--accent-gradient);
  border-radius: 42% 58% 65% 35% / 45% 45% 55% 55%;
  z-index: 0;
  opacity: 0.9;
}
@media (max-width: 640px) {
  .hero-blob { inset: -4% 4% 6% 10%; }
}

/* Tarjetas flotantes sobre la imagen del hero */
.hero-visual { position: relative; }
.hero-visual > img { position: relative; z-index: 1; }
.hero-float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: "Montserrat SS", sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink);
  box-shadow: 0 14px 30px -12px rgba(16, 34, 45, 0.3);
  white-space: nowrap;
  animation: floatY 4.5s ease-in-out infinite;
}
.hero-float-1 { top: 6%; left: -12px; animation-delay: 0s; }
.hero-float-2 { bottom: 10%; right: -16px; animation-delay: 1.1s; }
.hero-float-3 { top: 46%; right: -20px; background: var(--accent-gradient); color: #fff; text-shadow: 0 1px 3px rgba(6, 34, 42, 0.5); animation-delay: 2.2s; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (max-width: 860px) {
  .hero-float { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .hero-fade { opacity: 1; }
  html.js-reveal .reveal { opacity: 1; transform: none; }
}

/* Admin — tablas para listas que crecen sin límite (blog, mensajes, reclamos) */
.admin-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.admin-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
}
.admin-badge-ok { background: var(--accent-wash); color: var(--accent-deep); }
.admin-badge-off { background: var(--surface-2); color: var(--ink-faint); }
.admin-badge-alert { background: var(--alert-wash); color: var(--alert); }
.admin-badge-warn { background: var(--warn-wash); color: var(--warn); }
.admin-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 20px; }

.admin-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.admin-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.admin-action-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.admin-action-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-faint); transform: translateY(-1px); }
.admin-action-btn-view:hover { background: var(--surface-2); }
.admin-action-btn-edit:hover { background: var(--accent-wash); color: var(--accent-deep); border-color: var(--accent-deep); }
.admin-action-btn-delete { color: var(--alert); border-color: var(--alert-wash); }
.admin-action-btn-delete:hover { background: var(--alert-wash); border-color: var(--alert); color: var(--alert); }

.admin-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); flex-shrink: 0; }
.admin-thumb-round { border-radius: 999px; }
.admin-row-media { display: flex; align-items: center; gap: 12px; }

.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.admin-toolbar input[type="text"],
.admin-toolbar input[type="search"],
.admin-toolbar select {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.admin-toolbar input[type="search"] { min-width: 220px; flex: 1; max-width: 320px; }
.admin-toolbar .admin-btn { padding: 9px 16px; font-size: 13px; }

/* Reordenamiento por arrastre — ver public/assets/js/admin-sortable.js */
.sortable-item { transition: opacity 0.15s ease; }
.sortable-item.is-dragging { opacity: 0.35; }
.sortable-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--ink-faint);
  cursor: grab;
}
.sortable-handle:active { cursor: grabbing; }
.sortable-handle svg { width: 16px; height: 16px; }

.admin-page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }

/* Botones propios del panel — deliberadamente distintos de .btn (marca/marketing,
   pill+gradiente) para no arrastrar ese estilo a una UI densa de administración. */
.admin-btn {
  font-family: "Montserrat SS", sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.admin-btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px -5px rgba(14, 118, 168, 0.55);
}
.admin-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(14, 118, 168, 0.6); }
.admin-btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.admin-btn-secondary:hover { border-color: var(--ink-faint); background: var(--surface-2); }
.admin-btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.admin-btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.admin-btn-danger { background: var(--surface); border-color: var(--alert-wash); color: var(--alert); }
.admin-btn-danger:hover { background: var(--alert-wash); border-color: var(--alert); }
.admin-form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Layout de 2 columnas (formulario + preview en vivo) — colapsa a 1 columna en mobile */
.admin-form-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(240px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 760px) {
  .admin-form-layout { grid-template-columns: 1fr; }
}

/* Pestañas — mismo patrón radio+CSS sin JS que el drawer móvil y el menú de usuario */
.admin-tab-input { position: absolute; opacity: 0; pointer-events: none; }
.admin-tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
}
.admin-tab-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-faint);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.admin-tab-label svg { width: 15px; height: 15px; flex-shrink: 0; }
.admin-tab-label:hover { color: var(--ink); }
.admin-tab-panel { display: none; }
.admin-tab-section + .admin-tab-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.admin-tab-section-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); margin-bottom: 12px; }

#admin-tab-empresa:checked ~ .admin-tab-nav label[for="admin-tab-empresa"],
#admin-tab-smtp:checked ~ .admin-tab-nav label[for="admin-tab-smtp"],
#admin-tab-notificaciones:checked ~ .admin-tab-nav label[for="admin-tab-notificaciones"] {
  color: var(--accent-deep);
  border-bottom-color: var(--accent-deep);
}
#admin-tab-empresa:checked ~ #admin-tab-panel-empresa,
#admin-tab-smtp:checked ~ #admin-tab-panel-smtp,
#admin-tab-notificaciones:checked ~ #admin-tab-panel-notificaciones {
  display: block;
}

/* ============ Panel admin — shell moderno ============ */
body.admin-body { height: 100vh; overflow: hidden; }
.admin-shell { display: flex; height: 100vh; position: relative; background: var(--surface-2); }
.admin-nav-toggle-input { position: absolute; opacity: 0; pointer-events: none; }

.admin-brand-dot {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  background: var(--accent-gradient);
  box-shadow: 0 2px 8px -2px rgba(4, 217, 230, 0.6);
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.admin-topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.admin-topbar-title { display: flex; align-items: center; gap: 10px; font-family: "Montserrat SS", sans-serif; font-weight: 800; font-size: 14.5px; }
.admin-topbar-title-mobile { display: none; }
.admin-topbar-title-desktop { font-family: inherit; font-weight: 700; font-size: 14.5px; color: var(--ink-soft); gap: 8px; }
.admin-topbar-title-desktop svg { opacity: 0.7; }
.admin-nav-toggle-btn { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 32px; height: 32px; cursor: pointer; flex-shrink: 0; }
.admin-nav-toggle-btn span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.admin-overlay { display: none; }

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
}
.admin-sidebar-header { margin-bottom: 22px; }
.admin-brand { display: flex; align-items: center; gap: 10px; font-family: "Montserrat SS", sans-serif; font-weight: 800; font-size: 15px; padding: 0 8px; }

.admin-content { flex: 1; min-width: 0; height: 100vh; display: flex; flex-direction: column; }

.admin-user-menu { position: relative; flex-shrink: 0; }
.admin-user-toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.admin-user-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.admin-user-trigger:hover { background: var(--surface-2); }
.admin-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-user-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-chevron { flex-shrink: 0; color: var(--ink-faint); transition: transform 0.15s ease; }
.admin-user-overlay { display: none; }
.admin-user-toggle-input:checked ~ .admin-user-overlay { display: block; position: fixed; inset: 0; z-index: 65; }
.admin-user-toggle-input:checked ~ .admin-user-trigger .admin-user-chevron { transform: rotate(180deg); }
.admin-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  min-width: 200px;
  z-index: 70;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 32px -10px rgba(6, 34, 42, 0.28);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.admin-user-toggle-input:checked ~ .admin-user-dropdown { opacity: 1; pointer-events: auto; transform: translateY(0); }
.admin-user-dropdown form { width: 100%; }
.admin-user-dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.admin-user-dropdown-link svg { width: 15px; height: 15px; flex-shrink: 0; }
.admin-user-dropdown-link:hover { background: var(--surface-2); color: var(--ink); }
.admin-user-dropdown-danger { color: var(--alert); }
.admin-user-dropdown-danger:hover { background: var(--alert-wash); color: var(--alert); }

.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.admin-nav-link svg { flex-shrink: 0; opacity: 0.75; }
.admin-nav-link:hover { background: var(--surface-2); color: var(--ink); }
.admin-nav-link:hover svg { opacity: 1; }
.admin-nav-link.admin-nav-active { background: var(--accent-gradient); color: #fff; text-shadow: 0 1px 2px rgba(6, 34, 42, 0.35); box-shadow: 0 6px 16px -6px rgba(14, 118, 168, 0.5); }
.admin-nav-link.admin-nav-active svg { opacity: 1; }

.admin-main { flex: 1; min-width: 0; overflow-y: auto; padding: 36px 40px; }

@media (max-width: 860px) {
  body.admin-body { height: auto; overflow: visible; }
  .admin-shell { display: block; height: auto; }
  .admin-content { display: block; height: auto; }
  .admin-topbar-title-mobile { display: flex; }
  .admin-topbar-title-desktop { display: none; }
  .admin-nav-toggle-btn { display: flex; }
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 60;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 16px 0 40px rgba(6, 34, 42, 0.18);
  }
  .admin-nav-toggle-input:checked ~ .admin-sidebar { transform: translateX(0); }
  .admin-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(6, 34, 42, 0.45);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .admin-nav-toggle-input:checked ~ .admin-overlay { opacity: 1; pointer-events: auto; }
  .admin-nav-toggle-input:checked ~ .admin-content .admin-nav-toggle-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .admin-nav-toggle-input:checked ~ .admin-content .admin-nav-toggle-btn span:nth-child(2) { opacity: 0; }
  .admin-nav-toggle-input:checked ~ .admin-content .admin-nav-toggle-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .admin-main { height: auto; overflow-y: visible; padding: 20px 16px; }
}

@media (max-width: 480px) {
  .admin-user-name, .admin-user-chevron { display: none; }
  .admin-user-trigger { padding: 6px; }
}

/* Admin — formularios */
.admin-form { display: flex; flex-direction: column; gap: 16px; }
.admin-field { display: flex; flex-direction: column; gap: 6px; }
.admin-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 16px; }
.admin-field-checkbox { justify-content: flex-end; }
.admin-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.admin-hint { font-size: 12px; color: var(--ink-faint); margin: 0; }
.admin-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; height: 100%; }
.admin-input,
.admin-textarea,
.admin-select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.admin-input:focus,
.admin-textarea:focus,
.admin-select:focus {
  outline: none;
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.admin-textarea { resize: vertical; }

.admin-file-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: var(--surface-2);
  font-size: 13px;
  cursor: pointer;
}
.admin-file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 4px;
}
.admin-file-preview img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.admin-file-preview span { font-size: 12px; color: var(--ink-faint); }

/* Celda de tabla de una sola línea garantizada — el truncado en PHP (mb_strimwidth)
   reduce el HTML enviado, pero solo esto evita que el texto truncado igual haga
   wrap a varias líneas y estire la fila (ej. un "asunto" largo sin espacios cortos). */
.admin-table-cell-ellipsis { max-width: 320px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Modal de vista rápida — mismo patrón checkbox+label+CSS que el resto del panel,
   el checkbox/label viven dentro de la celda de acciones, el overlay usa position:fixed
   así que cubre la pantalla completa sin importar que estén anidados en un <td>. */
.admin-modal-toggle { position: absolute; opacity: 0; pointer-events: none; }
.admin-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.admin-modal-toggle:checked ~ .admin-modal-overlay { display: flex; }
.admin-modal-backdrop { position: absolute; inset: 0; background: rgba(6, 34, 42, 0.5); cursor: pointer; }
.admin-modal {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px -12px rgba(6, 34, 42, 0.35);
}
.admin-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
}
.admin-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--ink-faint);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
}
.admin-modal-close:hover { background: var(--surface-2); color: var(--ink); }
.admin-modal-body { padding: 20px; }
.admin-modal-footer { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
