/* ==========================================================================
   Dokuflex — Global stylesheet
   Shared by ES (/) and EN (/en/) sites. All common visual tokens and
   component styles live here. Pages can still use inline Tailwind utilities
   for layout; this file owns brand tokens, reusable components and the
   custom non-Tailwind widgets (dropdowns, range inputs, legal content).
   ========================================================================== */

/* -------- Base & brand tokens -------------------------------------------- */
:root {
  --brand-800: #1E3A8A;
  --brand-500: #3B82F6;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #0F172A;
}

/* -------- Brand utility aliases (used across markup) --------------------- */
.bg-brand-primary     { background-color: var(--brand-800); }
.text-brand-primary   { color: var(--brand-800); }
.border-brand-primary { border-color: var(--brand-800); }
.hover\:bg-brand-primary:hover { background-color: var(--brand-800); }
.ring-brand-primary   { --tw-ring-color: var(--brand-800); }

/* -------- Header nav underline animation --------------------------------- */
.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: -2px;
  height: 2px;
  background: var(--brand-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-link:hover::after { transform: scaleX(1); }

/* -------- Dropdown menus in header --------------------------------------- */
.dropdown {
  visibility: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: all .18s ease;
}
.dropdown-parent:hover .dropdown,
.dropdown-parent:focus-within .dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.dd-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .65rem .75rem;
  border-radius: .5rem;
  transition: background .15s;
}
.dd-item:hover { background: #F1F5F9; }

.dd-icon {
  width: 2rem; height: 2rem;
  border-radius: .4rem;
  background: #EFF6FF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dd-title { font-weight: 600; color: #0F172A; font-size: .85rem; }
.dd-sub   { font-size: .72rem; color: #64748B; margin-top: 1px; }

.dd-item-simple {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  border-radius: .4rem;
  font-size: .85rem;
  color: #334155;
}
.dd-item-simple:hover { background: #F1F5F9; color: var(--brand-800); }
.dd-item-simple .dd-ico {
  width: 1.5rem; height: 1.5rem;
  border-radius: .35rem;
  background: #EFF6FF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

/* -------- Breadcrumbs ---------------------------------------------------- */
.bc-sep { color: #CBD5E1; }

/* -------- Soft prose (body paragraphs) ----------------------------------- */
.prose-soft p { color: #475569; line-height: 1.7; }

/* -------- Legal content (aviso-legal, política-privacidad, cookies) ------ */
.legal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0F172A;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #E2E8F0;
}
.legal-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1E293B;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}
.legal-content p {
  color: #475569;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.legal-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.legal-content ul li {
  color: #475569;
  line-height: 1.75;
  margin-bottom: 0.5rem;
}
.legal-content strong { color: #0F172A; font-weight: 600; }
.legal-content a {
  color: var(--brand-800);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-content a:hover { color: var(--brand-500); }
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .92rem;
}
.legal-content th,
.legal-content td {
  padding: .75rem 1rem;
  border: 1px solid #E2E8F0;
  text-align: left;
  vertical-align: top;
}
.legal-content th {
  background: #F8FAFC;
  font-weight: 600;
  color: #0F172A;
}
.legal-content code {
  background: #F1F5F9;
  color: #0F172A;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.85rem;
}

/* -------- Custom range input (ROI calculator and similar) ---------------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 100%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: #E2E8F0;
  border-radius: 999px;
}
input[type="range"]::-moz-range-track {
  height: 6px;
  background: #E2E8F0;
  border-radius: 999px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand-800);
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(30,58,138,0.35);
  margin-top: -8px;
  cursor: pointer;
  transition: transform .15s;
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand-800);
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(30,58,138,0.35);
  cursor: pointer;
  transition: transform .15s;
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.1); }
input[type="range"]:hover::-moz-range-thumb     { transform: scale(1.1); }
input[type="range"]:focus { outline: none; }

input[type="number"].num-input { -moz-appearance: textfield; }
input[type="number"].num-input::-webkit-outer-spin-button,
input[type="number"].num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* -------- Misc helpers --------------------------------------------------- */
.metric-val { transition: color .2s; }
