/* ============================================================
   IncluMatch v0.1 — UI
   Identidad: navy profundo + teal/violeta (gradiente de marca),
   superficie clara, tarjetas blancas redondeadas.
   Accesibilidad: contraste AA, focus visible, reduced-motion.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700;12..96,800&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --navy-950: #081231;
  --navy-900: #0B1B3F;
  --navy-800: #14275C;
  --navy-700: #1E3575;
  --ink: #1A2440;
  --ink-soft: #45506E;
  --ink-mute: #5E6883;
  --teal-600: #0E9384;
  --teal-500: #12A597;
  --teal-400: #2DD4BF;
  --violet-600: #5B5BD6;
  --violet-500: #6E6EE8;
  --blue-600: #2563EB;
  --surface: #F4F6FB;
  --card: #FFFFFF;
  --line: #E3E8F2;
  --line-strong: #CBD4E6;
  --ok: #0E9384;
  --warn: #B45309;
  --bad: #B42318;
  --grad-brand: linear-gradient(120deg, #2DD4BF 0%, #2563EB 55%, #6E6EE8 100%);
  --grad-soft: linear-gradient(120deg, rgba(45,212,191,.12), rgba(37,99,235,.10) 55%, rgba(110,110,232,.12));
  --shadow-card: 0 1px 2px rgba(11,27,63,.06), 0 8px 24px -12px rgba(11,27,63,.14);
  --shadow-pop: 0 2px 6px rgba(11,27,63,.08), 0 24px 48px -16px rgba(11,27,63,.22);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Bricolage Grotesque', 'Trebuchet MS', sans-serif;
  --font-body: 'Instrument Sans', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

/* Fondo con atmósfera sutil */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(45,212,191,.10), transparent 60%),
    radial-gradient(800px 420px at -10% 30%, rgba(110,110,232,.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3 { font-family: var(--font-display); color: var(--navy-900); letter-spacing: -0.015em; }
h1 { font-size: 1.7rem; font-weight: 800; margin: 0 0 .25rem; }
h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 .75rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .4rem; }
p { margin: 0 0 .8rem; }
a { color: var(--blue-600); }

/* ---------- Accesibilidad ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy-900); color: #fff;
  padding: .7rem 1.2rem; border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 0; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Layout ---------- */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  position: relative; z-index: 1;
}

.sidebar {
  background: var(--navy-950);
  color: #E7ECF7;
  padding: 1.4rem 1rem;
  display: flex; flex-direction: column; gap: 1.6rem;
  position: sticky; top: 0; height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 0 .4rem;
  text-decoration: none;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad-brand);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
  color: var(--navy-950);
  flex: none;
}
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  color: #fff; line-height: 1.1;
}
.brand-name small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .68rem; color: #93A4CC; letter-spacing: .12em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: .25rem; }
.nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .62rem .8rem; border-radius: var(--radius-sm);
  color: #B9C5E4; text-decoration: none; font-weight: 500;
  border: 1px solid transparent;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current="page"] {
  background: rgba(45,212,191,.13);
  border-color: rgba(45,212,191,.35);
  color: #7FF0E1;
  font-weight: 600;
}
.nav .icon { width: 20px; height: 20px; flex: none; }

.sidebar-foot {
  margin-top: auto; font-size: .75rem;
  color: #8593BA; padding: 0 .4rem; line-height: 1.5;
}
.sidebar-foot strong { color: #B9C5E4; }

.main { padding: 1.6rem 2.2rem 3rem; max-width: 1180px; width: 100%; }

.demo-banner {
  background: var(--navy-900);
  color: #DCE5F8;
  font-size: .82rem;
  padding: .45rem 2.2rem;
  display: flex; gap: .5rem; align-items: center;
}
.demo-banner .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--teal-400); flex: none; animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.page-head { margin-bottom: 1.5rem; }
.page-head .crumb { font-size: .8rem; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.page-head p { color: var(--ink-soft); max-width: 64ch; }

/* ---------- Tarjetas y grids ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.3rem 1.4rem;
}

.grid-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.2rem; }
.kpi { position: relative; overflow: hidden; }
.kpi::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 3px;
  background: var(--grad-brand);
}
.kpi .kpi-label { display: block; font-size: .8rem; color: var(--ink-mute); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi .kpi-value { display: block; font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; color: var(--navy-900); line-height: 1.1; margin: .2rem 0; white-space: nowrap; }
.kpi .kpi-note { display: block; font-size: .8rem; color: var(--teal-600); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; align-items: start; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left; font-size: .73rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-mute); font-weight: 700; padding: .55rem .7rem;
  border-bottom: 1px solid var(--line-strong);
}
td { padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #F8FAFE; }
td .sub { display: block; font-size: .78rem; color: var(--ink-mute); }

/* ---------- Chips y badges ---------- */
.chip {
  display: inline-block; padding: .14rem .55rem; border-radius: 99px;
  font-size: .74rem; font-weight: 600; border: 1px solid var(--line-strong);
  color: var(--ink-soft); background: #fff; margin: 0 .25rem .25rem 0;
}
.chip.skill { background: #EFF8F7; border-color: #BCE7E1; color: #0B6E63; }
.chip.lock { background: #F4F1FF; border-color: #D9D2F7; color: #4F46A5; }

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .16rem .6rem; border-radius: 99px; font-size: .76rem; font-weight: 700;
}
.badge.ok   { background: #E8F6F3; color: #07614F; }
.badge.warn { background: #FDF1E2; color: #8A4B07; }
.badge.info { background: #EAF0FE; color: #1D4FBE; }
.badge.violet { background: #F0EFFF; color: #4640A8; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: .92rem;
  border-radius: 12px; padding: .68rem 1.25rem; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s, box-shadow .12s, background .15s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--navy-900); color: #fff;
  box-shadow: 0 8px 18px -8px rgba(11,27,63,.5);
}
.btn-primary:hover { background: var(--navy-800); }
.btn-grad {
  background: var(--grad-brand); color: var(--navy-950);
  box-shadow: 0 10px 22px -10px rgba(37,99,235,.55);
}
.btn-grad:hover { filter: brightness(1.05); }
.btn-ghost {
  background: #fff; color: var(--navy-800); border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--navy-700); }
.btn-sm { padding: .42rem .85rem; font-size: .82rem; border-radius: 9px; }

/* ---------- Formularios ---------- */
form .field { margin-bottom: 1.05rem; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; color: var(--navy-900); }
label .req { color: var(--bad); }
.hint { font-size: .78rem; color: var(--ink-mute); margin-top: .25rem; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; font-family: var(--font-body); font-size: .95rem;
  padding: .62rem .8rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--blue-600); }
textarea { resize: vertical; min-height: 84px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
fieldset {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1rem 1.1rem .6rem; margin: 0 0 1.05rem;
}
legend { font-weight: 700; font-size: .85rem; color: var(--navy-800); padding: 0 .4rem; }

.skill-row { display: grid; grid-template-columns: 1fr 160px 44px; gap: .6rem; margin-bottom: .6rem; align-items: center; }
.skill-row button { border: 1px solid var(--line-strong); background: #fff; border-radius: 8px; height: 38px; cursor: pointer; font-size: 1rem; color: var(--bad); }

/* ---------- Matching results ---------- */
.match-summary {
  display: flex; gap: 1.6rem; flex-wrap: wrap; align-items: center;
  background: var(--grad-soft);
  border: 1px solid #D5E4F5; border-radius: var(--radius);
  padding: 1rem 1.3rem; margin-bottom: 1.2rem;
}
.match-summary .num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; color: var(--navy-900); }
.match-summary .lbl { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }

.match-card {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 1.2rem;
  align-items: start; margin-bottom: 1rem;
  animation: rise .4s ease both;
}
.match-card:nth-child(2) { animation-delay: .06s; }
.match-card:nth-child(3) { animation-delay: .12s; }
.match-card:nth-child(4) { animation-delay: .18s; }
.match-card:nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.fit-ring {
  width: 86px; height: 86px; border-radius: 50%;
  display: grid; place-items: center; position: relative; flex: none;
}
.fit-ring .inner {
  width: 66px; height: 66px; border-radius: 50%; background: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--navy-900);
}
.match-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .2rem; }
.match-head .cod { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--navy-900); }
.match-just { color: var(--ink-soft); font-size: .92rem; max-width: 70ch; margin: .35rem 0 .6rem; }

.dims { display: grid; grid-template-columns: repeat(3, minmax(120px, 200px)); gap: .45rem .9rem; margin-top: .4rem; }
.dim { font-size: .74rem; color: var(--ink-mute); font-weight: 600; }
.dim .bar { height: 6px; border-radius: 99px; background: #E8EDF6; margin-top: .25rem; overflow: hidden; }
.dim .bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad-brand); }

.match-actions { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; min-width: 150px; }

/* ---------- Pool: privacidad ---------- */
.privacy-toggle {
  display: flex; align-items: center; gap: .7rem;
  background: #F4F1FF; border: 1px solid #D9D2F7; border-radius: var(--radius-sm);
  padding: .6rem .9rem; margin-bottom: 1rem; font-size: .86rem; color: #3F3990;
}
.privacy-toggle input { width: 18px; height: 18px; accent-color: var(--violet-600); }
.locked { color: var(--ink-mute); font-style: italic; letter-spacing: .08em; }

.pool-filters { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pool-filters select, .pool-filters input { width: auto; min-width: 170px; }

/* ---------- CV ciego ---------- */
.cv-sheet {
  max-width: 760px; margin: 0 auto; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); overflow: hidden;
}
.cv-head {
  background: var(--navy-950); color: #fff; padding: 1.6rem 2rem;
  position: relative; overflow: hidden;
}
.cv-head::after {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: var(--grad-brand); opacity: .25; filter: blur(8px);
}
.cv-head .cv-cod { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; }
.cv-head .cv-tag { color: #9FB0D8; font-size: .85rem; }
.cv-body { padding: 1.8rem 2rem; }
.cv-sec { margin-bottom: 1.4rem; }
.cv-sec h3 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--teal-600); border-bottom: 2px solid var(--line); padding-bottom: .35rem;
}
.cv-note {
  background: var(--grad-soft); border: 1px solid #D5E4F5;
  border-radius: var(--radius-sm); padding: .8rem 1rem; font-size: .84rem; color: var(--ink-soft);
}
.cv-print-bar { display: flex; gap: .8rem; justify-content: center; margin: 1.2rem 0 0; }

@media print {
  .sidebar, .demo-banner, .cv-print-bar, .skip-link { display: none !important; }
  .app { display: block; }
  .main { padding: 0; max-width: none; }
  .cv-sheet { box-shadow: none; border: none; }
  body::before { display: none; }
}

/* ---------- Estados vacíos / procesando ---------- */
.empty {
  text-align: center; padding: 3rem 1rem; color: var(--ink-mute);
}
.spinner {
  width: 46px; height: 46px; margin: 0 auto 1rem;
  border-radius: 50%;
  border: 4px solid #E3E8F2; border-top-color: var(--teal-500);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Landing (3 puertas) ---------- */
.main-publico { max-width: 1100px; margin: 0 auto; }
.landing { padding: 2rem 0 3rem; }
.landing-hero { text-align: center; max-width: 720px; margin: 0 auto 2.6rem; }
.landing-brand { display: flex; justify-content: center; align-items: center; gap: .6rem; margin-bottom: 1.8rem; }
.landing-hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  line-height: 1.12; margin-bottom: 1rem;
}
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.landing-hero p { color: var(--ink-soft); font-size: 1.05rem; max-width: 58ch; margin: 0 auto; }

.landing-puertas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.puerta {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 1.7rem 1.5rem;
  display: flex; flex-direction: column; gap: .6rem; align-items: flex-start;
  text-decoration: none; color: var(--ink);
  transition: transform .16s, box-shadow .16s, border-color .16s;
  position: relative; overflow: hidden;
}
.puerta::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--grad-brand); opacity: 0; transition: opacity .16s;
}
.puerta:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); border-color: var(--line-strong); }
.puerta:hover::before { opacity: 1; }
.puerta-icono { font-size: 1.9rem; }
.puerta h2 { margin: 0; }
.puerta p { color: var(--ink-soft); font-size: .92rem; flex: 1; }
.puerta .btn { pointer-events: none; }
.landing-login { text-align: center; margin-top: 2rem; color: var(--ink-soft); }

/* ---------- Acceso (login / registros) ---------- */
.acceso-wrap { display: grid; place-items: start center; padding: 2rem 0; }
.acceso-card { width: 100%; max-width: 440px; }
.form-error { color: var(--bad); font-weight: 600; font-size: .88rem; }

/* ---------- Pasos del registro guiado ---------- */
.pasos {
  display: flex; gap: .4rem; padding: 0; margin: 1.2rem 0 1.6rem;
  list-style: none; counter-reset: paso; flex-wrap: wrap;
}
.pasos li {
  counter-increment: paso;
  font-size: .78rem; font-weight: 600; color: var(--ink-mute);
  display: flex; align-items: center; gap: .45rem;
  padding: .35rem .7rem .35rem .4rem; border-radius: 99px;
  border: 1px solid var(--line);
  background: #fff;
}
.pasos li::before {
  content: counter(paso);
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: #E8EDF6; color: var(--ink-soft); font-weight: 700; font-size: .72rem;
}
.pasos li[aria-current="step"] { border-color: var(--blue-600); color: var(--navy-900); }
.pasos li[aria-current="step"]::before { background: var(--grad-brand); color: var(--navy-950); }
.pasos li.hecho::before { content: '✓'; background: var(--teal-500); color: #fff; }

.pasos-nav { display: flex; gap: .8rem; justify-content: space-between; margin-top: 1.4rem; }
.pasos-nav .btn:last-child { margin-left: auto; }

.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem .9rem; margin-bottom: .6rem; }
.check-item {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 500; font-size: .92rem; color: var(--ink); cursor: pointer;
}
.check-item input { width: 18px; height: 18px; accent-color: var(--teal-600); flex: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: .8rem; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { display: none; }
  .main { padding: 1.2rem; }
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .match-card { grid-template-columns: 72px 1fr; }
  .match-actions { grid-column: 1 / -1; flex-direction: row; }
  .dims { grid-template-columns: repeat(2, 1fr); }
  .landing-puertas { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
}
