/* Ecosistema Autónomo de RH — estilos compartidos (login, restablecer, landing).
   Marca FONGTEK: azul marino #041E42, turquesa #00C1D5, oscuro #131E29, Arial.
   Acento del portal: naranja #ff751f (indicación de Abel). */

:root {
  --navy: #041E42;
  --teal: #00C1D5;
  --ink: #131E29;
  --accent: #ff751f;
  --on-accent: #041E42;          /* texto sobre naranja (contraste alto) */
  /* Variables oficiales de la skill de marca FONGTEK */
  --fongtek-navy: #041E42; --fongtek-teal: #00C1D5; --fongtek-dark: #131E29;
  --fongtek-red: #E4002B; --fongtek-green: #3CDBC0; --fongtek-white: #FFFFFF; --fongtek-light: #F5F5F5; --fongtek-gray: #8A9BA8;
  --radius: 14px;
  --font: Arial, Helvetica, sans-serif;
}

/* Tema oscuro (por defecto) */
:root, :root[data-theme="dark"] {
  --bg: #131E29;
  --bg-alt: #0f1822;
  --surface: #1a2836;
  --surface-2: #213244;
  --line: rgba(255, 255, 255, .10);
  --text: #f4f7fa;
  --muted: #a7b6c6;
  --heading: #ffffff;
  --accent-text: #ff751f;
  --hero-glow: radial-gradient(60% 60% at 50% 0%, rgba(255, 117, 31, .16), transparent 70%), radial-gradient(50% 50% at 90% 10%, rgba(0, 193, 213, .10), transparent 70%);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --field: #101a24;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f7fa;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --line: rgba(4, 30, 66, .12);
  --text: #131E29;
  --muted: #55657a;
  --heading: #041E42;
  --accent-text: #b84500;        /* naranja más oscuro solo para texto pequeño */
  --hero-glow: radial-gradient(60% 60% at 50% 0%, rgba(255, 117, 31, .14), transparent 70%), radial-gradient(50% 50% at 90% 10%, rgba(0, 193, 213, .12), transparent 70%);
  --shadow: 0 18px 50px rgba(4, 30, 66, .14);
  --field: #ffffff;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
html.auth-pending body { visibility: hidden; }   /* evita ver la página antes de validar la sesión */
img { max-width: 100%; display: block; }
a { color: var(--accent-text); }
h1, h2, h3 { color: var(--heading); line-height: 1.15; margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.hidden { display: none !important; }

/* Logos: uno para fondo oscuro y otro para fondo claro (proporción original) */
.logo { height: 34px; width: auto; max-width: none; align-self: flex-start; object-fit: contain; }
:root[data-theme="light"] .logo-on-dark, :root:not([data-theme="light"]) .logo-on-light { display: none; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font: inherit; font-weight: 700; padding: 12px 22px; border-radius: 10px; border: 2px solid transparent;
  text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; min-height: 46px;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255, 117, 31, .35); }
.btn-ghost { background: transparent; color: var(--heading); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-text); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; text-decoration: underline; }

/* Barra superior */
.nav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 2px solid var(--teal); }
.nav-in { display: flex; align-items: center; gap: 22px; height: 68px; }
.nav-links { display: flex; gap: 22px; margin-left: 12px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 700; }
.nav-links a:hover { color: var(--accent-text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.chip-user { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.chip-user small { display: block; color: var(--muted); font-size: 11px; line-height: 1.1; }
.chip-user strong { font-size: 13px; color: var(--heading); line-height: 1.2; }
.icon-btn { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--heading); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
:root[data-theme="light"] .i-sun, :root:not([data-theme="light"]) .i-moon { display: none; }

/* ------------------------------ Landing ------------------------------ */
.hero { position: relative; text-align: center; padding: 72px 0 0; overflow: hidden; background: radial-gradient(60% 55% at 50% 0%, rgba(255, 117, 31, .20), transparent 70%), #142539; border-bottom: 2px solid var(--teal);
  --heading: #ffffff; --text: #ffffff; --muted: #b7c8dc; --line: rgba(255, 255, 255, .18); --surface: rgba(255, 255, 255, .07); --accent-text: #ff751f; }
.feat { padding: 52px 0 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.hero h1 { font-size: clamp(38px, 7vw, 76px); letter-spacing: -.02em; margin: 22px auto 0; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { max-width: 720px; margin: 20px auto 0; color: var(--muted); font-size: clamp(16px, 2.2vw, 20px); }
.hero .btn-ghost:hover { color: #fff; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }

/* Banner de personas (imagen curva de referencia): ocupa todo el ancho, se funde con los lados */
.banner { margin-top: 46px; background: linear-gradient(180deg, #142539 0%, #132a4a 100%); }
.banner img { display: block; width: 100%; max-width: 1560px; height: auto; margin-inline: auto; aspect-ratio: 1376 / 625;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); }
@media (max-width: 700px) { .banner img { height: 260px; aspect-ratio: auto; object-fit: cover; object-position: 50% 50%; } }

/* Iconos de capacidades bajo el carrusel */
.icon-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 auto; max-width: 980px; }
.icon-item { text-align: center; padding: 0 8px; }
.icon-item .ic { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; }
.icon-item svg { width: 26px; height: 26px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-item strong { display: block; color: var(--heading); font-size: 15px; }
.icon-item span { color: var(--muted); font-size: 13px; }

section { padding: 76px 0; }
.sec-head { text-align: center; max-width: 700px; margin: 0 auto 40px; }
.sec-head .kicker { color: var(--accent-text); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.sec-head h2 { font-size: clamp(28px, 4vw, 40px); margin-top: 10px; }
.sec-head p { color: var(--muted); margin: 14px 0 0; }

.stats { background: var(--bg-alt); border-block: 2px solid var(--teal); padding: 34px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stats b { display: block; font-size: 38px; color: var(--accent); }
.stats span { color: var(--muted); font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; position: relative; display: flex; flex-direction: column; gap: 12px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--accent); transform: translateY(-3px); }
.card .ic { width: 46px; height: 46px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent); display: grid; place-items: center; }
.card .ic svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card ul { margin: 0; padding-left: 18px; color: var(--text); font-size: 14px; }
.card li { margin: 4px 0; }
.badge { align-self: flex-start; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase; }
.badge.soon { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.badge.locked { background: var(--surface-2); color: var(--muted); }
.card.locked { opacity: .55; }
.card.locked:hover { transform: none; border-color: var(--line); }

.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: paso; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative; }
.step::before { counter-increment: paso; content: counter(paso); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; margin-bottom: 14px; }
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.cta { background: linear-gradient(135deg, var(--navy), #0a3160); color: #fff; border-radius: 22px; padding: 48px 28px; text-align: center; border: 1px solid rgba(255, 255, 255, .1); }
.cta h2 { color: #fff; font-size: clamp(26px, 4vw, 36px); }
.cta p { color: #b7c8dc; max-width: 620px; margin: 14px auto 26px; }
.footer { border-top: 2px solid var(--teal); padding: 30px 0; color: var(--muted); font-size: 13px; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }

/* --------------------------- Login / restablecer --------------------------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { gap: 26px; position: relative; overflow: hidden; background: linear-gradient(155deg, #041E42 0%, #0a3160 70%, #0d4a7a 100%); color: #fff; padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--teal); z-index: 2; }
.auth-side::after { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 117, 31, .35), transparent 65%); }
.auth-side > * { position: relative; z-index: 1; }
.auth-side h1 { color: #fff; font-size: clamp(30px, 3.6vw, 46px); max-width: 16ch; letter-spacing: -.01em; }
.auth-side h1 em { font-style: normal; color: var(--accent); }
.auth-side p { color: #c3d3e6; max-width: 46ch; }
.auth-side ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; color: #dbe6f3; font-size: 15px; }
.auth-side li { display: flex; gap: 10px; align-items: center; }
.auth-side li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.auth-side .photo { margin-top: 28px; border-radius: 18px; overflow: hidden; max-width: 380px; border: 1px solid rgba(255, 255, 255, .16); aspect-ratio: 16 / 10; }
.auth-side .photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.auth-main { display: flex; flex-direction: column; padding: 22px 28px 34px; background: var(--bg); }
.auth-top { display: flex; justify-content: flex-end; }
.auth-box { margin: auto; width: min(430px, 100%); }
.auth-box h2 { font-size: 28px; }
.auth-box .sub { color: var(--muted); margin: 8px 0 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--heading); }
.field input[type=email], .field input[type=password], .field input[type=text] {
  width: 100%; padding: 13px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--field); color: var(--text); font: inherit; font-size: 16px;
}
.field input:focus { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 76px !important; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--accent-text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 8px; }
.code-input { text-align: center; letter-spacing: .5em; font-size: 26px !important; font-weight: 700; font-variant-numeric: tabular-nums; padding-left: .5em !important; }
.msg { border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.msg.err { background: color-mix(in srgb, #e5484d 14%, transparent); border-color: color-mix(in srgb, #e5484d 45%, transparent); color: var(--text); }
.msg.ok { background: color-mix(in srgb, #2fb573 14%, transparent); border-color: color-mix(in srgb, #2fb573 45%, transparent); color: var(--text); }
.msg.info { background: color-mix(in srgb, var(--teal) 12%, transparent); border-color: color-mix(in srgb, var(--teal) 40%, transparent); color: var(--text); }
.row-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; }
.steps-mini { display: flex; gap: 6px; margin-bottom: 22px; }
.steps-mini i { flex: 1; height: 4px; border-radius: 3px; background: var(--line); }
.steps-mini i.on { background: var(--accent); }
.qr-box { display: grid; place-items: center; background: #fff; border-radius: 14px; padding: 14px; width: 220px; margin: 0 auto 14px; border: 1px solid var(--line); }
.qr-box svg, .qr-box img { width: 190px; height: 190px; display: block; }
.secret { text-align: center; font-family: "Courier New", monospace; font-size: 15px; letter-spacing: .08em; background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 10px; word-break: break-all; user-select: all; }
.how { color: var(--muted); font-size: 14px; padding-left: 20px; margin: 0 0 18px; }
.how li { margin: 4px 0; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.codes code { display: block; text-align: center; padding: 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-family: "Courier New", monospace; font-weight: 700; font-size: 15px; letter-spacing: .06em; color: var(--heading); }
.rules { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; display: grid; gap: 4px; color: var(--muted); }
.rules li::before { content: "○"; margin-right: 8px; color: var(--muted); }
.rules li.ok { color: var(--text); }
.rules li.ok::before { content: "●"; color: #2fb573; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 14px 0; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 26px; }

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { padding: 26px 22px 30px; min-height: 0; }
  .auth-side .photo, .auth-side ul { display: none; }
  .nav-links { display: none; }
  .icon-row, .stats-grid, .flow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  section { padding: 54px 0; }
  .hero { padding-top: 48px; }
  .icon-row, .stats-grid, .flow { grid-template-columns: 1fr; }
  .chip-user div { display: none; }
  .chip-user { padding: 5px; }
  .nav-in { gap: 10px; }
  .btn-logout span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; }
}
