/* ============================================================
   CONTACTO · panel modal (v2)
   Se abre desde los CTA con [data-contacto]. No cambia el layout
   de la página: el formulario vive en un <dialog> nativo, encima
   de todo, y el fondo queda inerte mientras está abierto.
   Todo lleva prefijo .olc- para no pisar clases existentes.
   ============================================================ */

body.olc-open { overflow: hidden !important; }

dialog.olc {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: clamp(12px, 3vw, 32px);
  border: 0;
  background: transparent;
  color: #fff;
  overflow: hidden;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

dialog.olc[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

dialog.olc::backdrop {
  background: rgba(0, 0, 0, .84);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---------- carcasa ---------- */
.olc-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: min(100%, 1000px);
  max-height: 100%;
  min-height: 0;
  border: 1px solid transparent;
  border-radius: 22px;
  background:
    linear-gradient(180deg, #0b0b0e, #070709) padding-box,
    linear-gradient(140deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, .05) 42%, rgba(120, 160, 255, .30)) border-box;
  box-shadow:
    0 50px 160px rgba(0, 0, 0, .90),
    0 0 90px rgba(70, 110, 255, .08);
  overflow: hidden;
  animation: olcIn .42s cubic-bezier(.16, 1, .3, 1);
}

.olc-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 55% at 100% 0%, rgba(100, 145, 255, .13), transparent 60%),
    radial-gradient(50% 45% at 0% 100%, rgba(255, 255, 255, .04), transparent 60%);
}

@keyframes olcIn {
  from { opacity: 0; transform: translateY(18px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

.olc-grab { display: none; }

.olc-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 #08080a;
}

.olc-body::-webkit-scrollbar { width: 8px; }
.olc-body::-webkit-scrollbar-track { background: #08080a; }
.olc-body::-webkit-scrollbar-thumb { background: #33333a; border-radius: 99px; }
.olc-body::-webkit-scrollbar-thumb:hover { background: #4a4a53; }

/* ---------- columna editorial ---------- */
.olc-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 48px 38px 36px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .028), transparent 58%);
  border-right: 1px solid rgba(255, 255, 255, .08);
}

/* Anillo orbital de fondo, muy tenue: guiño a la marca sin robar lectura. */
.olc-aside::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -210px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 50%;
  transform: rotate(-20deg) scaleY(.52);
  pointer-events: none;
}

.olc-aside::after {
  content: '';
  position: absolute;
  left: -180px;
  bottom: -180px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 150, 255, .18), transparent 66%);
  filter: blur(22px);
  pointer-events: none;
}

.olc-aside > * {
  position: relative;
  z-index: 1;
}

.olc-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #8b8b93;
}

.olc-kicker::before {
  content: '';
  width: 20px;
  height: 1px;
  flex: none;
  background: currentColor;
  opacity: .65;
}

.olc-title {
  margin: 24px 0 0;
  max-width: 330px;
  font-family: 'Inter Tight', Inter, ui-sans-serif, sans-serif;
  font-size: clamp(40px, 4.2vw, 60px);
  line-height: .92;
  letter-spacing: -.045em;
  font-weight: 800;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 58%, #a8a8b3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.olc-intro {
  margin: 20px 0 0;
  max-width: 310px;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 300;
  color: #a1a1aa;
}

/* Si el navegador no recorta el fondo al texto, el titular debe seguir siendo legible. */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .olc-title { color: #fff; background: none; }
}

@media (forced-colors: active) {
  .olc-title {
    color: #fff;
    background: none;
    -webkit-text-fill-color: currentColor;
  }
}

.olc-direct {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: auto;
  padding-top: 44px;
}

.olc-direct span {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #52525b;
}

.olc-direct a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .28);
  padding-bottom: 3px;
  transition: border-color .25s;
}

.olc-direct a::after {
  content: '↗';
  font-size: 11px;
  color: #71717a;
  transition: color .25s, transform .25s;
}

.olc-direct a:hover { border-color: #fff; }
.olc-direct a:hover::after { color: #fff; transform: translate(2px, -2px); }

.olc-reply {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #71717a;
}

.olc-reply i {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: #9dc0ff;
  box-shadow: 0 0 12px rgba(157, 192, 255, .9);
  animation: olcDot 2.6s ease-in-out infinite;
}

@keyframes olcDot {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

/* ---------- formulario ---------- */
.olc-main {
  padding: 48px 42px 40px;
  min-width: 0;
}

.olc-form { margin: 0; }

.olc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 18px;
}

.olc-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.olc-field.full { grid-column: 1 / -1; }

.olc-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #a1a1aa;
}

.olc-label em {
  font-style: normal;
  color: #52525b;
}

.olc-num {
  font-size: 8.5px;
  letter-spacing: .06em;
  color: #3f3f46;
}

.olc-input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  color: #fff;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  font-weight: 300;
  outline: none;
  transition: border-color .25s, background .25s, box-shadow .25s;
}

.olc-input::placeholder { color: #5b5b64; opacity: 1; }

.olc-input:hover {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .05);
}

.olc-input:focus {
  border-color: rgba(157, 192, 255, .55);
  background: rgba(255, 255, 255, .055);
  box-shadow: 0 0 0 3px rgba(100, 145, 255, .10);
}

textarea.olc-input {
  min-height: 102px;
  resize: vertical;
  line-height: 1.6;
}

.olc-select-wrap { position: relative; }

.olc-select-wrap::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1px solid #8b8b93;
  border-bottom: 1px solid #8b8b93;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

select.olc-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  cursor: pointer;
  color-scheme: dark;
}

select.olc-input:invalid { color: #71717a; }
select.olc-input:focus { color: #fff; }
select.olc-input option { background: #111113; color: #fff; }

.olc-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 2px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 300;
  color: #8b8b93;
  cursor: pointer;
  transition: border-color .25s, background .25s;
}

.olc-check:hover {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .035);
}

.olc-check input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  flex: none;
  accent-color: #fff;
  cursor: pointer;
}

.olc-check a {
  color: #d4d4d8;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, .3);
}

.olc-check a:hover { color: #fff; text-decoration-color: #fff; }

.olc-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  margin-top: 22px;
  padding: 12px 12px 12px 20px;
  border: 1px solid #fff;
  border-radius: 12px;
  background: #fff;
  color: #000;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .3s, border-color .3s, opacity .3s, transform .35s cubic-bezier(.16, 1, .3, 1);
}

.olc-submit:hover:not(:disabled) {
  background: #e6e6e9;
  border-color: #e6e6e9;
  transform: translateY(-1px);
}

.olc-submit:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 4px;
}

.olc-submit:disabled { opacity: .55; cursor: wait; transform: none; }

.olc-submit .olc-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  transition: background .3s, transform .35s cubic-bezier(.16, 1, .3, 1);
}

.olc-submit:hover:not(:disabled) .olc-arrow {
  background: #111;
  transform: translateX(2px);
}

.olc-status {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  font-weight: 300;
  color: #d4d4d8;
  background: rgba(255, 255, 255, .03);
}

.olc-status[data-state="error"] {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, .4);
  background: rgba(248, 113, 113, .07);
}

.olc-hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* ---------- cierre ---------- */
.olc-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  background: rgba(10, 10, 12, .62);
  color: #a1a1aa;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: color .25s, border-color .25s, background .25s;
}

.olc-close svg { transition: transform .35s cubic-bezier(.16, 1, .3, 1); }

.olc-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, .5);
  background: #0a0a0c;
}

.olc-close:hover svg { transform: rotate(90deg); }

.olc-close:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

/* ---------- confirmación ---------- */
.olc-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 380px;
  padding: 20px 0;
}

.olc-success-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 22px;
  border: 1px solid rgba(157, 192, 255, .34);
  border-radius: 50%;
  background: rgba(157, 192, 255, .08);
  color: #cfe0ff;
  box-shadow: 0 0 30px rgba(100, 145, 255, .12);
}

.olc-success h3 {
  margin: 16px 0 0;
  font-family: 'Inter Tight', Inter, ui-sans-serif, sans-serif;
  font-size: clamp(38px, 4.4vw, 56px);
  line-height: .95;
  letter-spacing: -.04em;
  font-weight: 800;
  color: #fff;
}

.olc-success p {
  margin: 18px 0 0;
  max-width: 360px;
  font-size: 14.5px;
  line-height: 1.7;
  font-weight: 300;
  color: #a1a1aa;
}

.olc-success .olc-submit { margin-top: 30px; max-width: 240px; }

.olc [hidden] { display: none !important; }

/* ---------- móvil ---------- */
@media (max-width: 820px) {
  dialog.olc { padding: 0; }

  /* La regla base dialog.olc[open] fija align-items:center; esta tiene que
     ganarle para que en móvil el panel sea una hoja pegada abajo. */
  dialog.olc[open] { align-items: flex-end; }

  .olc-panel {
    width: 100%;
    max-height: 94dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }

  .olc-grab {
    display: block;
    width: 38px;
    height: 4px;
    margin: 10px auto 0;
    flex: none;
    border-radius: 99px;
    background: rgba(255, 255, 255, .20);
  }

  .olc-body { grid-template-columns: 1fr; }

  .olc-aside {
    padding: 26px 24px 22px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }

  .olc-title {
    max-width: 100%;
    margin-top: 16px;
    font-size: clamp(32px, 9vw, 44px);
  }

  .olc-intro { margin-top: 14px; max-width: 100%; }

  .olc-direct { margin-top: 24px; padding-top: 22px; }

  .olc-main { padding: 24px 24px calc(28px + env(safe-area-inset-bottom)); }

  .olc-grid { grid-template-columns: 1fr; gap: 18px; }

  .olc-close { top: 14px; right: 14px; }

  .olc-success { min-height: 300px; }
}

@media (max-width: 420px) {
  .olc-title { font-size: 30px; }
  .olc-main { padding: 24px 20px calc(26px + env(safe-area-inset-bottom)); }
  .olc-aside { padding: 24px 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .olc-panel,
  .olc-reply i { animation: none; }

  .olc-close svg,
  .olc-submit,
  .olc-submit .olc-arrow { transition: none; }
}
