/* ═══════════════════════════════════════════════════════════════
   styles.css — alarcos.es
   Arquitectura: variables → reset → utiles → componentes → secciones
═══════════════════════════════════════════════════════════════ */

/* ─── Custom properties ──────────────────────────────────── */
:root {
  /* Paleta dark */
  --bg:          #07070f;
  --bg-2:        #0d0d1c;
  --surface:     rgba(255, 255, 255, 0.035);
  --border:      rgba(255, 255, 255, 0.08);
  --border-hover:rgba(255, 255, 255, 0.18);

  /* Texto */
  --text:        #f0f0f8;
  --text-muted:  #8888a8;

  /* Acento principal: púrpura/violeta */
  --accent:      #7c6af7;
  --accent-glow: rgba(124, 106, 247, 0.35);
  --accent-dim:  rgba(124, 106, 247, 0.12);

  /* Semánticos */
  --success:     #34d399;
  --error:       #f87171;

  /* Tipografía */
  --font:        'Inter', system-ui, -apple-system, sans-serif;

  /* Espaciado */
  --sp-xs: 0.5rem;
  --sp-sm: 1rem;
  --sp-md: 2rem;
  --sp-lg: 4.5rem;
  --sp-xl: 9rem;

  /* Forma */
  --radius:    12px;
  --radius-lg: 20px;
  --ease:      cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t:         0.22s;

  /* Layout */
  --max-w:      1100px;
  --max-w-form: 600px;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* El atributo `hidden` tiene baja especificidad en la UA stylesheet;
   esta regla evita que display:flex/grid de componentes lo sobreescriba. */
[hidden] { display: none !important; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── Scroll animations ──────────────────────────────────── */
[data-animate] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.72s var(--ease),
    transform 0.72s var(--ease);
}
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-animate-delay="1"] { transition-delay: 0.10s; }
[data-animate-delay="2"] { transition-delay: 0.20s; }
[data-animate-delay="3"] { transition-delay: 0.32s; }
[data-animate-delay="4"] { transition-delay: 0.44s; }

/* ─── Utiles ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}
.container--narrow { max-width: var(--max-w-form); }

.section-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ─── Botones ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition:
    background var(--t) var(--ease),
    color var(--t) var(--ease),
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    transform var(--t) var(--ease);
}
.btn:active { transform: scale(0.97) !important; }

/* Tamaños */
.btn--sm  { padding: 0.42rem 1rem;  font-size: 0.82rem; }
.btn--lg  { padding: 0.9rem 2.2rem; font-size: 1rem;    }
.btn--full { width: 100%; }

/* Primary */
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: #9080ff;
  box-shadow: 0 0 28px var(--accent-glow);
  transform: translateY(-2px);
}

/* Outline */
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn--outline:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.05);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  padding-inline: 0.75rem;
}
.btn--ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* Arrow decorativo en botones con clase .btn-arrow */
.btn-arrow {
  display: inline-block;
  transition: transform 0.2s var(--ease);
}
.btn--primary:hover .btn-arrow { transform: translateX(4px); }

/* Spinner de carga */
.btn__spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Navegación ─────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 5vw, 2.5rem);
  transition:
    background var(--t) var(--ease),
    backdrop-filter var(--t) var(--ease),
    border-color var(--t) var(--ease);
}
.nav.is-scrolled {
  background: rgba(7, 7, 15, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.025em;
  transition: color var(--t);
}
.nav__logo:hover { color: var(--accent); }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem clamp(1.25rem, 5vw, 2.5rem) 5rem;
  overflow: hidden;
}

/* Fondo con degradado animado */
.hero__bg {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 0;
}

/* Primer conjunto de orbes de color */
.hero__bg::before {
  content: '';
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(ellipse 70% 55% at 15% 42%, rgba(90, 50, 230, 0.24) 0%, transparent 62%),
    radial-gradient(ellipse 55% 65% at 85% 22%, rgba(40, 110, 240, 0.16) 0%, transparent 62%),
    radial-gradient(ellipse 45% 45% at 55% 82%, rgba(200, 150, 60, 0.10) 0%, transparent 58%);
  animation: orbA 16s ease-in-out infinite alternate;
  will-change: transform;
}

/* Segundo conjunto, movimiento opuesto */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(ellipse 55% 45% at 72% 58%, rgba(124, 106, 247, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 40% 55% at 28% 72%, rgba(20, 120, 240, 0.08) 0%, transparent 55%);
  animation: orbB 11s ease-in-out infinite alternate-reverse;
  will-change: transform;
}

@keyframes orbA {
  0%   { transform: translate(0,    0)    scale(1);    }
  33%  { transform: translate(2%,   1.2%) scale(1.03); }
  66%  { transform: translate(-1.2%, 2%)  scale(0.98); }
  100% { transform: translate(1.5%, -1.2%)scale(1.02); }
}
@keyframes orbB {
  0%   { transform: translate(0,    0)     scale(1);    }
  50%  { transform: translate(-1.5%, 1.5%) scale(1.04); }
  100% { transform: translate(1%,   -1%)   scale(0.97); }
}

/* Ruido sutil sobre el degradado (solo en pantallas de alta densidad) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  .hero__bg::before { opacity: 0.85; }
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}

/* Badge "Dominio premium en venta" */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 1.05rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(124, 106, 247, 0.32);
  background: var(--accent-dim);
}
.hero__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: dotPulse 2.2s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1);   }
  50%       { opacity: 0.3; transform: scale(0.75); }
}

/* Título principal */
.hero__title {
  font-size: clamp(3.2rem, 14vw, 11rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.95;
  background: linear-gradient(
    140deg,
    #ffffff  0%,
    #dcdcf5  28%,
    #aeaedd  55%,
    #7c6af7  100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent; /* fallback */
}

/* Subtítulo */
.hero__subtitle {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--text-muted);
  max-width: 38ch;
  line-height: 1.65;
}

/* Indicador de scroll */
.hero__scroll {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
  transition: opacity var(--t);
  animation: arrowBounce 2.8s ease-in-out infinite;
}
.hero__scroll:hover { opacity: 0.9; }
.hero__scroll-arrow { font-size: 1rem; }

@keyframes arrowBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}

/* ─── Divisor entre secciones ────────────────────────────── */
.section-sep {
  width: 1px;
  height: 72px;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
  margin: 0 auto;
}

/* ─── Sección Valor ──────────────────────────────────────── */
.value {
  padding: var(--sp-xl) 0;
}

.value__intro {
  text-align: center;
  margin-bottom: var(--sp-lg);
}
.value__heading {
  margin-top: 0.8rem;
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.18;
  max-width: 22ch;
  margin-inline: auto;
}

.value__text {
  max-width: 66ch;
  margin-inline: auto;
  margin-bottom: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}
.value__text p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* Cards de características */
.value__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.value__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  transition:
    transform var(--t) var(--ease),
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}
.value__card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 106, 247, 0.32);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(124, 106, 247, 0.12);
}

.value__card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(124, 106, 247, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.3rem;
  color: var(--accent);
}

.value__card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.value__card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── Sección Formulario ─────────────────────────────────── */
.form-section {
  padding: var(--sp-xl) 0;
  /* Fondo ligeramente distinto para separación visual */
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(124, 106, 247, 0.06) 0%, transparent 70%);
}

.form-section__intro {
  text-align: center;
  margin-bottom: var(--sp-md);
}
.form-section__heading {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 0.8rem;
}
.form-section__subtitle {
  font-size: 0.98rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* Formulario */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.form-group label {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.82rem 1.05rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  transition:
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    background var(--t) var(--ease);
  outline: none;
  width: 100%;
  -webkit-appearance: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(136, 136, 168, 0.45);
}
.form-group input:hover,
.form-group textarea:hover {
  border-color: rgba(255, 255, 255, 0.14);
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background: rgba(124, 106, 247, 0.05);
  box-shadow: 0 0 0 3px rgba(124, 106, 247, 0.15);
}
.form-group input.is-invalid,
.form-group textarea.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}
.form-group textarea {
  resize: vertical;
  min-height: 118px;
}

/* Mensaje de error de campo */
.form-error {
  font-size: 0.78rem;
  color: var(--error);
  display: none;
}
.form-error.is-visible { display: block; }

/* Estado general del form (éxito / error) */
.form-status {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.55;
  animation: fadeUp 0.35s var(--ease);
}
.form-status--success {
  background: rgba(52, 211, 153, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.28);
  color: var(--success);
}
.form-status--error {
  background: rgba(248, 113, 113, 0.09);
  border: 1px solid rgba(248, 113, 113, 0.28);
  color: var(--error);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.25rem clamp(1.25rem, 5vw, 2.5rem);
}
.footer__inner {
  max-width: var(--max-w);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer__copy {
  font-size: 0.83rem;
  color: var(--text-muted);
}
.footer__privacy {
  font-size: 0.83rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--t);
}
.footer__privacy:hover { color: var(--text); }

/* ─── Cookie banner (esquina inferior derecha, compacto) ─── */
.cookie-banner {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  background: rgba(13, 13, 28, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem 1.1rem;
  width: min(300px, calc(100vw - 2.5rem));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  animation: cookieIn 0.35s var(--ease);
}
@keyframes cookieIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Fila superior: título + botón X */
.cookie-banner__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.cookie-banner__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.cookie-banner__close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t), color var(--t);
}
.cookie-banner__close:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.cookie-banner__text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.cookie-banner__actions {
  display: flex;
  gap: 0.5rem;
}
/* Botones ocupan el ancho disponible a partes iguales */
.cookie-banner__actions .btn { flex: 1; }

.cookie-banner__policy {
  font-size: 0.73rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: center;
  transition: color var(--t);
}
.cookie-banner__policy:hover { color: var(--text); }

/* ─── Modal ──────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modal__content {
  position: relative;
  background: #0e0e1f;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem 2rem;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.32s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

.modal__content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  padding-right: 2rem;
}
.modal__body {
  margin-bottom: 1.75rem;
}
.modal__body h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.35rem;
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}
.modal__body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.modal__body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.modal__body a:hover { color: #9080ff; }
.modal__body code {
  font-size: 0.82em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.modal__close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), color var(--t);
}
.modal__close:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }

/* ─── Accesibilidad: reducir movimiento ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  [data-animate] { opacity: 1 !important; transform: none !important; }
}

/* ─── Responsive ─────────────────────────────────────────── */

/* Tablet */
@media (max-width: 860px) {
  :root {
    --sp-lg: 3.5rem;
    --sp-xl: 6rem;
  }
  .value__cards { grid-template-columns: 1fr 1fr; }
}

/* Móvil grande */
@media (max-width: 600px) {
  :root {
    --sp-lg: 3rem;
    --sp-xl: 5rem;
  }
  .nav { padding: 1rem 1.1rem; }
  .value__cards { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
}

/* Móvil pequeño */
@media (max-width: 420px) {
  .nav__actions .btn--primary { display: none; } /* Ocultar CTA nav en móvil muy pequeño */
}
