:root {
  --bg: #0b1220;
  --card: #111827;
  --card2: #0f172a;
  --border: #1f2937;
  --text: #e5e7eb;
  --sub: #9ca3af;
  --acc: #3b82f6;
  --acc2: #7c3aed;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --cyan: #06b6d4;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; }

/* ─── Header ─────────────────────────────────────────── */
header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: rgba(11,18,32,.95); position: sticky; top: 0; z-index: 100; }
header img { height: 38px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: #94a3b8; padding: 6px 10px; border-radius: 8px; text-decoration: none; font-size: 14px; transition: background .15s, color .15s; }
nav a:hover { background: #1f2937; color: var(--text); }
.right { margin-left: auto; }
.banner { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--card2); border: 1px solid var(--border); font-size: 12px; }

/* ─── Layout ──────────────────────────────────────────── */
.wrap { max-width: 1000px; margin: 24px auto; padding: 0 16px; }
footer { text-align: center; padding: 24px; color: var(--sub); font-size: 13px; border-top: 1px solid var(--border); margin-top: 40px; }

/* ─── Cards ───────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin: 16px 0; box-shadow: 0 8px 32px rgba(0,0,0,.3); }
h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; margin-bottom: 10px; }
h2 { font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; margin-bottom: 8px; }
h3 { font-size: 16px; font-weight: 600; margin: 16px 0 8px; }
p { color: #cbd5e1; margin-bottom: 10px; }

/* ─── Buttons ─────────────────────────────────────────── */
button, .btn {
  display: inline-block; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none; border: none; transition: opacity .15s, transform .1s;
  background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff;
}
button:hover, .btn:hover { opacity: .88; transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); }
button:disabled, .btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-green { background: linear-gradient(135deg, #16a34a, #15803d); }
.btn-outline { background: transparent; border: 2px solid #7c3aed; color: #e5e7eb; }
.btn-outline:hover { background: rgba(124,58,237,.15); }
.btn-ghost { background: rgba(255,255,255,.07); border: 1px solid var(--border); color: #e5e7eb; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-red { background: linear-gradient(135deg, #dc2626, #991b1b); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ─── Inputs ──────────────────────────────────────────── */
input, textarea, select {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid #374151; background: var(--card2); color: var(--text);
  font-size: 14px; font-family: inherit; transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--acc); }
input[type="file"] { padding: 8px; }
input[type="checkbox"] { width: auto; }
label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 4px; }

/* ─── Grid/Flex helpers ───────────────────────────────── */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 12px; }
.mt2 { margin-top: 20px; }
.small { font-size: 12px; color: var(--sub); }
.muted { color: var(--sub); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-cyan { color: var(--cyan); }
.field { margin-bottom: 10px; }
.gap-sm { gap: 6px; }

/* ─── Badges / Pills ──────────────────────────────────── */
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: var(--card2); border: 1px solid var(--border); color: #cbd5e1; }
.pill.green { background: rgba(34,197,94,.15); border-color: rgba(34,197,94,.3); color: var(--green); }
.pill.red { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.3); color: var(--red); }
.pill.yellow { background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.3); color: var(--yellow); }
.pill.blue { background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.3); color: #93c5fd; }
.pill.purple { background: rgba(124,58,237,.15); border-color: rgba(124,58,237,.3); color: #c4b5fd; }
.percent { font-weight: 700; }

/* ─── Score widget ────────────────────────────────────── */
.scorewrap { display: flex; align-items: center; gap: 18px; background: linear-gradient(180deg,rgba(96,165,250,.1),rgba(124,58,237,.08)); border: 1px solid #27324a; border-radius: 16px; padding: 14px 18px; margin: 14px 0; }
.scorewrap img { width: 110px; height: auto; border-radius: 12px; opacity: .9; }
.score { font-size: 46px; font-weight: 800; line-height: 1; }
.score .of { font-size: 20px; color: #93c5fd; font-weight: 600; margin-left: 4px; }
.scorelabel { color: #93c5fd; font-size: 14px; margin-top: 4px; }

/* ─── Progress / Status ───────────────────────────────── */
.progress { height: 6px; background: #111; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg,#3b82f6,#7c3aed); transition: width .35s; }
.status { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--sub); margin-top: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #374151; }
.dot.on { background: #60a5fa; animation: pulse 1s infinite alternate; }
@keyframes pulse { from{opacity:.4} to{opacity:1} }

/* ─── Job match rows ──────────────────────────────────── */
.job-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.job-item:last-child { border-bottom: 0; }

/* ─── CV list (empresa candidatos) ───────────────────────*/
.match-list { padding: 8px; }
.cv-item { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.cv-item:last-child { border-bottom: 0; }
.cv-row { display: flex; gap: 10px; align-items: flex-start; }
.cv-info { flex: 1; }
.cv-check { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: none; margin: 2px 6px 0 0; cursor: pointer; }
.cv-check input.pick { position: absolute; opacity: 0; inset: 0; }
.cv-check .box { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.5); border-radius: 3px; }
.cv-check input.pick:checked + .box { background: #7c3aed; border-color: #7c3aed; box-shadow: inset 0 0 0 2px #fff; }
.cv-line { line-height: 1.3; margin-bottom: 6px; }
.cv-title { font-weight: 600; margin-right: 4px; }
.sep { margin: 0 5px; color: var(--sub); }
.cv-loc { opacity: .85; }
.cv-score { font-weight: 700; color: #93c5fd; }
.cv-summary { color: var(--sub); font-size: 13px; }
.cv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ─── Plan cards ──────────────────────────────────────── */
.plan-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 16px 0; }
.plan-card { border-radius: 16px; border: 1px solid var(--border); padding: 20px; background: var(--card2); }
.plan-card.featured { border-color: #7c3aed; }
.plan-price { font-size: 32px; font-weight: 800; margin: 8px 0 4px; }
.plan-price .per { font-size: 15px; font-weight: 400; color: var(--sub); }
.plan-list { list-style: none; margin: 12px 0; }
.plan-list li { display: flex; gap: 8px; margin: 6px 0; font-size: 14px; color: #cbd5e1; }
.plan-list li::before { content: "✓"; color: var(--green); flex-shrink: 0; }

/* ─── Alert boxes ─────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin: 10px 0; }
.alert-red { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-green { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.alert-yellow { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #fde68a; }
.alert-blue { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }

/* ─── Suscripción info bar ────────────────────────────── */
.subs-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; background: rgba(124,58,237,.12); border: 1px solid rgba(124,58,237,.3); font-size: 13px; margin-bottom: 14px; }

/* ─── Modal ───────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 9999; display: none; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.modal-box { background: var(--card); border: 1px solid var(--border); border-radius: 16px; max-width: 900px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0,0,0,.8); animation: slideUp .25s ease; }
@keyframes slideUp { from { transform: translateY(20px); opacity:0; } to { transform: translateY(0); opacity:1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--border); }
.modal-body { flex: 1; overflow: auto; padding: 16px; }
.modal-frame { flex: 1; }
.modal-frame iframe { width: 100%; height: 100%; border: 0; border-radius: 0 0 14px 14px; }

/* ─── Tabs ────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { padding: 8px 16px; font-size: 14px; font-weight: 500; color: var(--sub); cursor: pointer; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; transition: color .15s; background: none; border-left:none; border-right:none; border-top:none; }
.tab.active { color: var(--text); border-bottom-color: var(--acc); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Section boxes ───────────────────────────────────── */
.section-box { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--card2); margin-bottom: 14px; }

/* ─── Two-column layout ───────────────────────────────── */
.two-col { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }

/* ─── Consent block ───────────────────────────────────── */
.consent-block { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: rgba(17,24,39,.5); }
.consent-block label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; color: #cbd5e1; font-size: 13px; line-height: 1.5; }
.consent-block input[type=checkbox] { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }

/* ─── Hidden by default – score gated ────────────────────*/
#saveSection { display: none; }
#saveSection.show { display: block; }
#lowScoreSection { display: none; }
#lowScoreSection.show { display: block; }

/* ─── Print ───────────────────────────────────────────── */
@media print {
  header, footer, .progress, .status, #saveSection, #cvForm, nav, .right, #lowScoreSection { display: none !important; }
  .wrap { max-width: 900px; margin: 0 auto; }
  .card { box-shadow: none; border: 1px solid #ccc; background: white; color: black; }
  .score { color: black; }
}

/* ─── Link styles ─────────────────────────────────────── */
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
.link-orange { color: #f59e0b !important; font-weight: 600; text-decoration: underline; }

/* ─── Toolbar ─────────────────────────────────────────── */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Human verify ────────────────────────────────────── */
.human-block { border: 1px solid var(--border); padding: 12px; border-radius: 10px; background: var(--card2); }
