/* =====================================================================
   BINER STUDIO — Sistema de diseño "Blue Technology"
   Tokens + base + componentes compartidos (sitio público, formulario y,
   en próximas etapas, paneles privados).
   ===================================================================== */

:root {
  /* Superficies */
  --bg-0: #02050d;
  --bg-1: #050b1a;
  --bg-2: #081228;
  --bg-3: #0c1a38;
  --glass: rgba(14, 30, 66, 0.42);
  --glass-strong: rgba(12, 26, 58, 0.72);

  /* Azules */
  --blue-50: #e8f1ff;
  --blue-200: #a9cbff;
  --blue-300: #6fb1ff;
  --blue-400: #4a93ff;
  --blue-500: #2f7bff; /* eléctrico principal */
  --blue-600: #1d62f0;
  --blue-700: #1446c8;
  --cyan: #46d6ff;

  /* Texto */
  --text: #f2f6ff;
  --text-2: #b6c5e3;
  --text-3: #7d8fb5;

  /* Bordes */
  --line: rgba(120, 160, 255, 0.14);
  --line-2: rgba(120, 160, 255, 0.26);
  --line-glow: rgba(47, 123, 255, 0.55);

  /* Estados */
  --ok: #3ddc97;
  --warn: #ffc857;
  --err: #ff6b7d;

  /* Tipografía */
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Radios, sombras, ritmo */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --shadow-1: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 1px rgba(47, 123, 255, 0.35), 0 12px 40px -10px rgba(47, 123, 255, 0.45);
  --container: 1200px;
  --gutter: clamp(18px, 4vw, 32px);
  --section: clamp(72px, 10vw, 128px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(47, 123, 255, 0.45); color: #fff; }
:focus-visible { outline: 2px solid var(--blue-400); outline-offset: 3px; border-radius: 6px; }

.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; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--blue-500); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); position: relative; }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { text-align: center; margin-inline: auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--blue-300); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: linear-gradient(90deg, transparent, var(--blue-400)); }
.section-head.center .eyebrow::after { content: ""; width: 22px; height: 1px; background: linear-gradient(90deg, var(--blue-400), transparent); }
.h-section { font-size: clamp(30px, 4.6vw, 52px); }
.lead { color: var(--text-2); font-size: clamp(16px, 1.6vw, 19px); margin-top: 18px; }
.grad-text {
  background: linear-gradient(100deg, #fff 0%, var(--blue-200) 40%, var(--blue-500) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Botones ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s, color .25s;
  white-space: nowrap; user-select: none;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--blue-400), var(--blue-600));
  color: #fff; box-shadow: 0 8px 24px -8px rgba(47, 123, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -10px rgba(47, 123, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn-ghost { background: rgba(255, 255, 255, .03); border-color: var(--line-2); color: var(--text); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--blue-400); background: rgba(47, 123, 255, .08); transform: translateY(-2px); }
.btn-sm { --h: 40px; padding: 0 16px; font-size: 14px; }
.btn-lg { --h: 56px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tarjetas ---------- */
.card {
  position: relative; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(20, 40, 86, .38), rgba(8, 18, 40, .55));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
}
.card-hover:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--shadow-glow); }
.card-glow::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(111, 177, 255, .55), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .4s;
}
.card-glow:hover::before { opacity: 1; }

.icon-tile {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(47, 123, 255, .28), rgba(47, 123, 255, .06));
  border: 1px solid rgba(111, 177, 255, .28); color: var(--blue-300);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 20px -8px rgba(47,123,255,.6);
}
.icon-tile svg { width: 24px; height: 24px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; color: var(--text-2); background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(47,123,255,.14); color: var(--blue-200); border: 1px solid rgba(111,177,255,.3);
}
.badge-warn { background: rgba(255,200,87,.1); color: var(--warn); border-color: rgba(255,200,87,.3); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { background: rgba(3, 7, 18, .72); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-color: var(--line); }
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; letter-spacing: .12em; font-size: 15px; }
.brand img { width: 36px; height: 36px; }
.brand small { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; color: var(--text-3); font-weight: 400; margin-top: 2px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 10px; font-size: 14px; color: var(--text-2); transition: color .2s, background .2s; }
.nav a:hover, .nav a[aria-current="true"] { color: #fff; background: rgba(255,255,255,.04); }
.header-cta { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); place-items: center; }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; position: relative; transition: transform .3s var(--ease), background .2s; }
.menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; }
.menu-toggle span::before { top: -6px; } .menu-toggle span::after { top: 6px; }
.menu-open .menu-toggle span { background: transparent; }
.menu-open .menu-toggle span::before { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1080px) {
  .nav, .header-cta .btn-ghost { display: none; }
  .menu-toggle { display: grid; }
  .mobile-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 99; padding: 24px var(--gutter) 40px;
    background: rgba(3, 7, 18, .96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .3s, transform .3s var(--ease), visibility .3s;
  }
  .menu-open .mobile-nav { opacity: 1; visibility: visible; transform: none; }
  .mobile-nav a:not(.btn) { padding: 16px 4px; font-family: var(--font-display); font-size: 22px; border-bottom: 1px solid var(--line); }
  .mobile-nav .btn { margin-top: 20px; }
}
@media (min-width: 1081px) { .mobile-nav { display: none; } }
@media (max-width: 480px) { .header-cta .btn-primary { display: none; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 64px 0 32px; background: linear-gradient(180deg, transparent, rgba(8,18,40,.6)); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.footer-grid h4 { font-size: 13px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--text-3); margin-bottom: 16px; font-weight: 500; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { color: var(--text-2); font-size: 14px; transition: color .2s; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; background: #25d366; color: #fff;
  box-shadow: 0 10px 30px -6px rgba(37, 211, 102, .55), 0 0 0 0 rgba(37, 211, 102, .5);
  animation: waPulse 2.8s infinite; transition: transform .25s var(--ease);
}
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 30px; height: 30px; }
.wa-float[hidden] { display: none; }
@keyframes waPulse { 0% { box-shadow: 0 10px 30px -6px rgba(37,211,102,.55), 0 0 0 0 rgba(37,211,102,.45); } 70% { box-shadow: 0 10px 30px -6px rgba(37,211,102,.55), 0 0 0 16px rgba(37,211,102,0); } 100% { box-shadow: 0 10px 30px -6px rgba(37,211,102,.55), 0 0 0 0 rgba(37,211,102,0); } }

/* ---------- Formularios (compartido) ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .label { font-size: 14px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 13px; color: var(--text-3); }
.req { color: var(--blue-300); }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px;
  background: rgba(4, 10, 24, .7); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s; font-size: 16px; /* 16px evita zoom en iOS */
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236FB1FF' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 44px; }
.select option { background: var(--bg-2); }
.input::placeholder, .textarea::placeholder { color: #5a6b90; }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(120,160,255,.4); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue-400); box-shadow: 0 0 0 4px rgba(47,123,255,.18); background: rgba(6, 14, 32, .9); }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--err); box-shadow: 0 0 0 4px rgba(255,107,125,.12); }
.field .error { font-size: 13px; color: var(--err); display: none; }
.field.invalid .error { display: block; }

/* ---------- Avisos ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 14px; border: 1px solid var(--line-2); background: rgba(47,123,255,.07); color: var(--text-2); }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--blue-300); }
.notice-warn { background: rgba(255,200,87,.07); border-color: rgba(255,200,87,.3); }
.notice-warn svg { color: var(--warn); }
.notice-err { background: rgba(255,107,125,.07); border-color: rgba(255,107,125,.35); }
.notice-err svg { color: var(--err); }
.notice-ok { background: rgba(61,220,151,.07); border-color: rgba(61,220,151,.35); }
.notice-ok svg { color: var(--ok); }

.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; padding: 14px 18px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--line-2); backdrop-filter: blur(16px); box-shadow: var(--shadow-1); font-size: 14px; animation: toastIn .35s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Animaciones de aparición ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Fondo tecnológico reutilizable ---------- */
.tech-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.tech-bg .grid {
  position: absolute; inset: -2px;
  background-image: linear-gradient(rgba(111,177,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(111,177,255,.07) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
}
.tech-bg .orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.orb-a { width: 620px; height: 620px; left: -160px; top: -200px; background: radial-gradient(circle, rgba(29,98,240,.7), transparent 65%); animation: drift 18s ease-in-out infinite alternate; }
.orb-b { width: 520px; height: 520px; right: -140px; top: 80px; background: radial-gradient(circle, rgba(70,214,255,.35), transparent 65%); animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate3d(60px, 40px, 0) scale(1.08); } }
