/* =========================================================
   FORGENEX · páginas de la IA (/ia, /precios, /app, /conectar)
   Se carga después de sitio.css (diseño de Jacnex Studio) y solo
   agrega los componentes propios de Forgenex.
   ========================================================= */

:root {
  --texto-suave: #66708A;
  --exito: #15803D;
  --error: #D92D20;
  --borde: var(--line);
}

.fx-main { padding-top: clamp(24px, 3vw, 40px); }
.fx-centro { text-align: center; }
.fx h1 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 850; letter-spacing: -.03em; line-height: 1.05; margin-bottom: 18px; }
.fx h3 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.fx h3 .ico { color: var(--violet); }
.fx .sh p { color: var(--mu); margin-top: 8px; }
.fx .legal-hero h1 { margin: 16px 0 10px; font-size: clamp(36px, 5vw, 60px); }
.fx .legal-hero.fx-centro p { margin: 0 auto; }
.fx-intro { color: var(--ink2); margin-bottom: 20px; max-width: 52em; }
.cats .fx-cats-apps { color: var(--blue); }

/* ---------- Botones de la app ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--blue); color: #fff; font: 700 15px/1 var(--f); white-space: nowrap; text-decoration: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 18px -10px rgba(20,104,255,.8);
  transition: background-color .2s, color .2s, box-shadow .2s, transform .2s var(--eo);
}
.boton:hover { background: var(--blue-d); }
.boton:active { transform: translateY(1px); }
.boton:disabled { background: var(--line); color: var(--mu); box-shadow: none; cursor: not-allowed; transform: none; }
.boton.secundario { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.boton.secundario:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.boton.peligro { background: #fff; color: var(--error); box-shadow: inset 0 0 0 1.5px #F5C6C2; }
.boton.peligro:hover { background: #FEF1F0; }
.boton.grande { height: 54px; font-size: 16px; }
.boton.ancho { width: 100%; }
.boton .ico { width: 18px; height: 18px; }
.fx-separador { display: flex; align-items: center; gap: 12px; margin: 16px 0 14px; color: var(--mu); font-size: 13px; }
.fx-separador::before, .fx-separador::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Formularios ---------- */
.fx label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.fx label input[type="checkbox"] { width: 18px; height: 18px; margin: 0 8px 0 0; vertical-align: -3px; accent-color: var(--blue); }
.fx input[type="text"], .fx input[type="email"], .fx input[type="password"], .fx input[type="number"], .fx select, .fx textarea {
  width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font: 500 15px/1.4 var(--f); transition: border-color .2s, box-shadow .2s;
}
.fx textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; }
.fx select { appearance: none; padding-right: 40px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%230A1633' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; }
.fx input:focus, .fx select:focus, .fx textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(20,104,255,.14); }
.campo { margin-bottom: 18px; }
.ayuda { color: var(--mu); font-size: 13.5px; }
.ayuda a, .fx-intro a, .tarjeta p a { color: var(--blue); font-weight: 600; }
.mensaje { padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; }
.mensaje.error { background: #FEF1F0; color: #B42318; }
.mensaje.exito { background: #E3F7EC; color: #0E6B33; }
.fx-fila { display: flex; gap: 10px; margin-bottom: 14px; }
.fx-fila input { flex: 1; min-width: 0; }
@media (max-width: 560px) { .fx-fila { flex-direction: column; } }

/* ---------- Tarjetas, chips y selectores ---------- */
.tarjeta { background: #fff; border-radius: var(--r); padding: clamp(18px, 2.4vw, 26px); }
.fx .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.chip {
  height: 38px; padding: 0 14px; border-radius: 999px; background: var(--bg); color: var(--ink2);
  font-weight: 600; font-size: 14px; box-shadow: inset 0 0 0 1.5px transparent; transition: background-color .2s, color .2s, box-shadow .2s;
}
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--line); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tipos { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); margin-bottom: 18px; }
.tipos button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 11px; font-weight: 700; font-size: 14.5px; color: var(--mu); transition: background-color .2s, color .2s, box-shadow .2s; }
.tipos button .ico { width: 18px; height: 18px; }
.tipos button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 4px 12px -6px rgba(10,22,51,.3); }
.etiqueta { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: #EFEAFF; color: var(--violet); font-weight: 800; font-size: 12px; }

/* ---------- Cabecera compacta de la app ---------- */
.fx-hd .hd__in { height: auto; min-height: 72px; flex-wrap: wrap; gap: 8px 20px; padding-top: 10px; padding-bottom: 10px; }
.fx-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.fx-nav::-webkit-scrollbar { display: none; }
.fx-nav a, .fx-salir { display: flex; align-items: center; gap: 7px; flex: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--ink2); white-space: nowrap; transition: background-color .2s, color .2s; }
.fx-nav a .ico { width: 17px; height: 17px; }
.fx-nav a:hover, .fx-salir:hover { background: var(--bg); }
.fx-nav a.activo { background: var(--sky); color: var(--blue); }
.fx-nav .saldo { margin-left: 6px; background: #EFEAFF; color: var(--violet); font-weight: 800; }
.fx-nav .saldo:hover { background: #E4DCFF; }
.fx-salir { color: var(--mu); }
@media (max-width: 760px) { .fx-nav { order: 2; width: 100%; margin-left: 0; } }
.fx-pie { margin-top: clamp(48px, 6vw, 72px); padding: 22px 0 28px; border-top: 1px solid var(--line); color: var(--mu); font-size: 13.5px; }
.fx-pie a { color: var(--ink2); font-weight: 600; }
.fx-pie a:hover { color: var(--blue); }

/* ---------- /ia ---------- */
.fx-hero { display: flex; align-items: center; justify-content: space-between; gap: clamp(24px, 4vw, 56px); padding: clamp(32px, 5vw, 64px); border-radius: 28px; color: #fff; background: linear-gradient(120deg, #3B22B8, #6D4AFF 55%, #8A4DFF); }
.fx-hero > img { width: clamp(110px, 16vw, 220px); height: auto; flex: none; filter: drop-shadow(0 24px 36px rgba(20,0,80,.45)); }
.fx .fx-hero h1 { margin: 16px 0 14px; font-size: clamp(36px, 5vw, 64px); letter-spacing: -.04em; line-height: 1; max-width: 13em; }
.fx-hero p { opacity: .88; max-width: 38em; font-size: 17px; }
.fx-hero__btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 14px; }
.fx-hero .btn--white { color: #3B22B8; }
.fx-hero .fx-hero__nota { font-size: 14px; opacity: .75; }
@media (max-width: 760px) { .fx-hero { flex-direction: column-reverse; align-items: flex-start; } .fx-hero > img { width: 84px; } }
.fx-funciones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fx-funcion { padding: 24px; border-radius: var(--r); background: #fff; }
.fx-funcion i { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: #EFEAFF; color: var(--violet); margin-bottom: 16px; }
.fx-funcion h3 { margin-bottom: 6px; }
.fx-funcion p { color: var(--mu); font-size: 14.5px; }
@media (max-width: 1080px) { .fx-funciones { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .fx-funciones { grid-template-columns: 1fr; } }
.fx-modelos { display: flex; flex-wrap: wrap; gap: 10px; }
.fx-modelos span { padding: 10px 16px; border-radius: 999px; background: #fff; color: var(--mu); font-size: 14px; }
.fx-modelos b { color: var(--ink); }

/* ---------- /precios ---------- */
.ciclo { display: flex; justify-content: center; margin-bottom: 24px; }
.ciclo .tipos { width: min(380px, 100%); margin: 0; background: #fff; }
.ciclo { flex-wrap: wrap; gap: 10px; }
.ciclo .tipos--moneda { width: min(280px, 100%); }
.ciclo .tipos button[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.fx-planes { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; align-items: start; }
.plan { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 28px; box-shadow: inset 0 0 0 1.5px transparent; }
.plan.destacado { box-shadow: inset 0 0 0 2px var(--violet), 0 24px 48px -28px rgba(109,74,255,.6); }
.plan .etiqueta { position: absolute; top: 20px; right: 20px; }
.plan h3 { font-size: 20px; margin-bottom: 4px; }
.plan .precio { font-size: 42px; font-weight: 850; letter-spacing: -.035em; line-height: 1.05; margin: 6px 0 4px; }
.plan .precio small { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--mu); }
.plan ul { display: grid; gap: 10px; margin: 18px 0 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--ink2); }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.fx-check { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  background: #E3F7EC url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4 8-9' fill='none' stroke='%2315803D' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 14px; }
.plan .boton { margin-top: auto; }

/* ---------- Tablas ---------- */
.tabla-envoltura { overflow-x: auto; }
.fx table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.fx th, .fx td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.fx th { color: var(--mu); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.fx tbody tr:last-child td { border-bottom: 0; }
.fx td.num, .fx th.num { text-align: right; white-space: nowrap; }
.fx td .ayuda { margin-top: 2px; }
.fx td:first-child { min-width: 190px; }

/* ---------- /app: entrar ---------- */
.fx-acceso { max-width: 460px; margin: 0 auto; }
.fx-acceso__intro { text-align: center; margin-bottom: 20px; }
.fx-acceso__intro img { margin: 0 auto 14px; }
.fx-acceso__intro h1 { margin-bottom: 8px; }
.fx-acceso > .ayuda { margin-top: 16px; }

/* ---------- /app: crear ---------- */
.estudio { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { position: sticky; top: 96px; max-height: calc(100vh - 112px); overflow-y: auto; }
@media (max-width: 900px) { .estudio { grid-template-columns: 1fr; } .panel { position: static; max-height: none; } }
.zona-imagenes { display: grid; place-items: center; min-height: 92px; padding: 16px; border: 2px dashed var(--line); border-radius: 14px; background: var(--bg); color: var(--mu); font-size: 14px; text-align: center; cursor: pointer; transition: border-color .2s, background-color .2s, color .2s; }
.zona-imagenes:hover, .zona-imagenes.encima { border-color: var(--blue); background: var(--sky); color: var(--blue); }
.miniaturas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.miniaturas:empty { display: none; }
.miniatura { position: relative; width: 68px; height: 68px; border-radius: 12px; overflow: hidden; background: var(--bg); }
.miniatura img { width: 100%; height: 100%; object-fit: cover; }
.miniatura button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(10,22,51,.75); color: #fff; font-size: 13px; line-height: 22px; text-align: center; }
.galeria-ia { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.resultado { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; background: #fff; }
.resultado .medio { display: grid; place-items: center; min-height: 220px; background: #E9ECF3; }
.resultado .medio img, .resultado .medio video { width: 100%; height: auto; display: block; }
.resultado .info { padding: 14px 16px 16px; display: grid; gap: 12px; }
.resultado .prompt { font-size: 14px; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.resultado .acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.resultado .acciones .boton { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.resultado .error-texto { padding: 24px; text-align: center; color: #B42318; font-size: 14px; }
.girando { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(109,74,255,.2); border-top-color: var(--violet); animation: fx-girar .9s linear infinite; }
@keyframes fx-girar { to { transform: rotate(360deg); } }
.vacio { display: grid; place-items: center; gap: 12px; min-height: 320px; padding: 32px; border: 2px dashed var(--line); border-radius: var(--r); color: var(--mu); text-align: center; }
.vacio .ico { width: 34px; height: 34px; color: var(--violet); }

/* ---------- /app: cuenta y conectar ---------- */
.cuenta-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cuenta-grid { grid-template-columns: 1fr; } }
#resumen-cuenta h3 { margin-bottom: 2px; }
#resumen-cuenta p + p, #resumen-cuenta .estadistica + p { margin-top: 10px; color: var(--ink2); font-size: 14.5px; }
.estadistica { margin-top: 16px; padding: 18px; border-radius: 14px; background: #EFEAFF; color: var(--violet); font-size: 28px; font-weight: 850; letter-spacing: -.02em; }
.codigo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--bg); font: 600 14px/1.4 ui-monospace, "Cascadia Code", Consolas, monospace; word-break: break-all; }
.codigo .boton { height: 36px; padding: 0 12px; font: 700 13.5px/1 var(--f); flex: none; }

/* ---------- /conectar ---------- */
.fx-conectar { max-width: 520px; }
.fx-conectar h2 { font-size: 24px; font-weight: 850; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 10px; }
.fx-conectar p { color: var(--ink2); }
.codigo-grande { margin: 12px 0 20px; padding: 16px; border-radius: 14px; background: var(--bg); text-align: center; font: 800 32px/1 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .18em; }
.fx-botones { display: grid; gap: 10px; }
.fx-listo { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 14px; border-radius: 50%; background: #E3F7EC; color: var(--exito); }
.fx-listo .ico { width: 30px; height: 30px; }
