/* ============================================
   ESTILOS GLOBALES BASE
   Estilos generales que se aplican a todo
   ============================================ */

/* Elemento raíz */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  /* Ocultar barra de scroll pero mantener funcionalidad */
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE y Edge */
  overflow-y: scroll !important;
}

/* Chrome, Safari y Edge */
html::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

html::-webkit-scrollbar-track {
  display: none !important;
}

html::-webkit-scrollbar-thumb {
  display: none !important;
}

/* Body */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-primary);
  transition: background-color var(--transition-base), color var(--transition-base);
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE y Edge */
}

/* Chrome, Safari y Edge - Body */
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Contenedores principales */
main {
  flex: 1 0 auto;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Contenedor fluido Bootstrap compatible */
.container,
.container-fluid {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

.container {
  max-width: 1200px;
}

/* Espaciado de secciones */
section {
  padding: var(--spacing-2xl) 0;
}

.section {
  position: relative;
  background-color: transparent;
}

.section-intro {
  padding: 100px 0;
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
}

.section-floating-container {
  position: relative;
}

/* Utilidades de visibilidad */
.hidden,
.visually-hidden {
  display: none !important;
}

.invisible {
  visibility: hidden !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Utilidades de display */
.d-none { display: none; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Utilidades de flex */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; align-items: center; }

/* Utilidades de text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-accent { color: var(--color-primary); }

.font-bold { font-weight: var(--font-weight-bold); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-normal { font-weight: var(--font-weight-regular); }
.font-light { font-weight: var(--font-weight-light); }

/* Utilidades de márgenes */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Utilidades de padding */
.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

.pt-3 { padding-top: var(--spacing-md); }
.pb-3 { padding-bottom: var(--spacing-md); }
.px-3 { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.py-3 { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }

/* Utilidades de gap (para flexbox/grid) */
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* Utilidades de posición */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

.z-hide { z-index: var(--z-hide); }
.z-auto { z-index: var(--z-auto); }
.z-base { z-index: var(--z-base); }
.z-dropdown { z-index: var(--z-dropdown); }

/* Utilidades de tamaño */
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.h-auto { height: auto; }
.max-w-100 { max-width: 100%; }

/* Overlay y fondos */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.overlay-light {
  background: rgba(255, 255, 255, 0.1);
}

/* Efectos de sombra */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* Efectos de borde */
.border {
  border: 1px solid var(--border);
}

.border-top {
  border-top: 1px solid var(--border);
}

.border-bottom {
  border-bottom: 1px solid var(--border);
}

.border-left {
  border-left: 1px solid var(--border);
}

.border-right {
  border-right: 1px solid var(--border);
}

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Efectos de opacidad */
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Preloader */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.preloader-body {
  text-align: center;
}

.preloader-body p {
  color: var(--text-secondary);
  margin-top: var(--spacing-lg);
}

/* Responsive */
@media (max-width: 768px) {
  section {
    padding: var(--spacing-lg) 0;
  }
  
  .section-intro {
    padding: 60px 0;
    min-height: auto;
  }
  
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* === Text color utilities === */
.text-orange {
  color: var(--color-primary) !important;
}

.highlight-orange {
  color: #fff;
  border-bottom: 2px solid var(--color-primary);
  font-weight: 600;
}

/* === PRELOADER === */
.preloader {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: #ffffff;
  transition: 0.3s all ease;
}

.preloader.loaded {
  opacity: 0;
  visibility: hidden;
}

.preloader-body {
  text-align: center;
}

.preloader-body p {
  position: relative;
  right: -8px;
}

.cssload-container {
  width: 100%;
  height: 36px;
  text-align: center;
}

.cssload-speeding-wheel {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 3px solid #0c98d4;
  border-radius: 50%;
  border-left-color: transparent;
  border-bottom-color: transparent;
  animation: cssload-spin 0.88s infinite linear;
}

@keyframes cssload-spin {
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 576px) {
  section {
    padding: var(--spacing-md) 0;
  }
  
  .section-intro {
    padding: 60px 0;
    min-height: auto;
  }
}

/* SUCCESS CENTERED OVERLAY */
:root {
  --esin-success-accent: #00bcd4; /* cyan accent */
  --esin-success-overlay-dark: rgba(2,6,14,0.45);
  --esin-success-overlay-light: rgba(255,255,255,0.92);
  --esin-success-text-light: #0f172a; /* dark text for light mode */
}

.esin-success-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--esin-success-overlay-dark);
  /* blur the page behind for stronger focus (backdrop-filter supported browsers) */
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 2147483647; /* ensure above everything */
  animation: overlay-fade 240ms ease-out;
  transition: background 240ms ease, backdrop-filter 240ms ease, -webkit-backdrop-filter 240ms ease;
}

/* Light theme: softer, brighter backdrop and dark text */
html[data-theme="light"] .esin-success-overlay {
  background: var(--esin-success-overlay-light);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Fallback for browsers without backdrop-filter: increase opacity slightly */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .esin-success-overlay { background: rgba(2,6,14,0.6); }
  html[data-theme="light"] .esin-success-overlay { background: rgba(255,255,255,0.94); }
}

/* mobile - slightly smaller blur for performance */
@media (max-width: 480px) {
  .esin-success-overlay { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
}

@keyframes overlay-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.esin-success-card {
  background: transparent;
  padding: 10px 18px;
  min-width: 240px;
  max-width: 720px;
  color: #fff;
  text-align: center;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Circle with subtle white/dark background depending on theme; big & professional */
.esin-success-icon {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--esin-success-circle-bg, #ffffff);
  box-shadow: 0 18px 40px rgba(3,63,119,0.18);
  transform-origin: center;
  animation: icon-pop 640ms cubic-bezier(.2,.9,.3,1);
  border: 6px solid rgba(0,0,0,0.04);
}

/* keep the same visual but in dark mode we prefer a subtle dark circle */
html:not([data-theme="light"]) .esin-success-icon {
  background: linear-gradient(135deg, rgba(0,188,212,0.08) 0%, rgba(2,136,209,0.06) 100%);
  border: 6px solid rgba(0,188,212,0.12);
}

@keyframes icon-pop {
  0% { transform: scale(0.3) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

.esin-success-icon svg { width: 78px; height: 78px; }

/* color the check using the accent variable */
.esin-success-icon svg path { fill: var(--esin-success-accent); }

.esin-success-text {
  font-size: 22px;
  font-weight: 800;
  margin-top: 6px;
  text-align: center;
  letter-spacing: 0.2px;
  text-shadow: none;
  color: var(--esin-success-accent);
}

/* In light mode set the title to a darker tone (still aligned with brand cyan) */
html[data-theme="light"] .esin-success-text {
  color: var(--esin-success-text-light);
}

.esin-success-sub {
  font-size: 14px;
  color: rgba(30,40,60,0.9);
  opacity: 0.95;
}

/* hide animation class */
.esin-success-overlay--hide { opacity: 0; transition: opacity 420ms ease; }

/* responsive adjustments */
@media (max-width: 480px) {
  .esin-success-icon { width: 96px; height: 96px; }
  .esin-success-icon svg { width: 60px; height: 60px; }
  .esin-success-text { font-size: 18px; }
  .esin-success-card { gap: 8px; padding: 12px; }
}

/* small screens */
@media (max-width: 480px) {
  .esin-success-card { padding: 20px; min-width: 260px; }
  .esin-success-icon { width: 68px; height: 68px; }
}

/* Ensure hero decorative underline is always centered under the heading */
.legal-hero-line,
.cert-hero-line,
.accent-line-premium,
.accent-line-center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  background: var(--cyan-esin, #1AA8E1) !important;
}

