/* ============================================================
   WORKSET APPLY — PUBLIC HOME (discovery board)
   EP-2a. Ported from prototypes/design_handoff_home_v2 (hi-fi, final).
   Scoped under `body.home` so the home's hero/stats/sections never
   collide with the wizard's same-named classes in style.css.
   Reuses style.css atoms unscoped: .btn, .nav, .mesh-bg, input, .field.
   Tokens only — no hardcoded colors. (Validation modal + radial CSS
   land in EP-2b/2c.)
   ============================================================ */

.home { overflow-x: hidden; }
.home .container { max-width: var(--container); margin: 0 auto; padding: 0 var(--s-6); }

/* ── Hero ── */
.home .hero { text-align: center; padding: var(--s-16) var(--s-6) var(--s-8); }
.home .hero-eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3);
  background: var(--bg-glass-strong); border: 1px solid var(--border-default); border-radius: var(--r-full);
  font-size: var(--t-xs); font-weight: 500; color: var(--text-secondary); letter-spacing: 0.02em; white-space: nowrap;
  margin-bottom: var(--s-6); backdrop-filter: blur(12px);
}
.home .hero-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); animation: homePulse 2s ease-in-out infinite; }
@keyframes homePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.home .hero h1 { font-size: clamp(40px, 6.4vw, 76px); font-weight: 700; line-height: 0.98; letter-spacing: -0.04em; margin: 0 0 var(--s-5); }
.home .hero h1 .grad { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; display: inline-block; white-space: nowrap; padding-bottom: 0.16em; }
.home .hero p { font-size: clamp(16px, 2vw, var(--t-lg)); color: var(--text-secondary); max-width: 620px; margin: 0 auto var(--s-8); line-height: 1.55; letter-spacing: -0.01em; }

@keyframes homeFadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
/* Entrance animations gated on html.anim-run (added via rAF) and force-removed by
   html.anim-done (timer failsafe) — a frozen timeline can never hide content.
   Base state is always visible. */
@media (prefers-reduced-motion: no-preference) {
  html.anim-run:not(.anim-done) .home .hero-eyebrow { animation: homeFadeUp 0.8s var(--ease-out) both; }
  html.anim-run:not(.anim-done) .home .hero h1 { animation: homeFadeUp 0.8s var(--ease-out) 0.1s both; }
  html.anim-run:not(.anim-done) .home .hero p { animation: homeFadeUp 0.8s var(--ease-out) 0.2s both; }
  html.anim-run:not(.anim-done) .home .jobs-toolbar { animation: homeFadeUp 0.8s var(--ease-out) 0.3s both; }
}

/* ── Trust stats ── */
.home .stats {
  max-width: 1000px; margin: 0 auto; padding: var(--s-6);
  background: var(--bg-glass); border: 1px solid var(--border-subtle); border-radius: var(--r-lg);
  backdrop-filter: blur(20px); display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s-6);
}
.home .stats > .stat { border-right: 1px solid var(--border-subtle); text-align: center; }
.home .stats > .stat:last-child { border-right: none; }
.home .stat-value { font-size: var(--t-2xl); font-weight: 700; line-height: 1; background: linear-gradient(180deg, var(--text-primary), var(--text-secondary)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.home .stat-label { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin-top: 6px; }

/* ── Section shells ── */
.home .section { padding: var(--s-16) 0; }
.home .section-head { text-align: center; max-width: 560px; margin: 0 auto var(--s-10); }
.home .section-kicker { font-size: var(--t-xs); font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; display: block; margin-bottom: var(--s-3); }
.home .section-head h2 { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.03em; margin: 0 0 var(--s-3); }
.home .section-head p { color: var(--text-secondary); line-height: 1.6; margin: 0; }

/* ── Jobs ── */
.home .jobs-toolbar { display: flex; justify-content: center; margin: 0 auto var(--s-4); max-width: 560px; }
/* search + date inputs: style.css only themes text/email/tel, so search/date
   fall back to a white browser default (and inherit light text → invisible).
   Theme them explicitly here; focus state still comes from style.css input:focus. */
.home .jobs-toolbar input,
.home input[type="date"] {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-default);
  border-radius: var(--r-md); padding: 14px 18px; color: var(--text-primary);
  font-family: var(--font); font-size: var(--t-base);
}
.home .jobs-toolbar input { text-align: center; }
.home input[type="date"] { border-radius: var(--r-sm); padding: 12px 14px; }
[data-theme="dark"] .home input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }
.home .jobs-note { text-align: center; font-size: var(--t-sm); color: var(--text-tertiary); max-width: 600px; margin: 0 auto var(--s-8); line-height: 1.6; }
.home .jobs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); max-width: 1100px; margin: 0 auto; }
.home .job-card {
  background: var(--bg-glass); border: 1px solid var(--border-default); border-radius: var(--r-md);
  padding: var(--s-5); backdrop-filter: blur(16px); cursor: pointer; display: flex; flex-direction: column; gap: var(--s-3);
  transition: transform var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out), box-shadow var(--d-base) var(--ease-out);
}
.home .job-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.home .job-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.home .job-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.home .job-spec { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-full); padding: 3px 10px; }
.home .job-spec svg { width: 14px; height: 14px; }
.home .job-share { font-size: var(--t-xs); font-weight: 500; color: var(--text-secondary); font-family: inherit; background: none; border: 1px solid var(--border-default); border-radius: var(--r-full); padding: 3px 12px; cursor: pointer; transition: all var(--d-fast) var(--ease-out); }
.home .job-share:hover { border-color: var(--border-strong); color: var(--text-primary); }
.home .job-share--ok { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.home .job-headline { font-size: var(--t-md); font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.home .job-meta { font-size: var(--t-sm); color: var(--text-secondary); display: flex; gap: var(--s-2); white-space: nowrap; flex-wrap: wrap; }
.home .job-dot { color: var(--text-tertiary); }
.home .job-langs { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.home .job-lang { font-size: 11px; font-weight: 500; color: var(--text-tertiary); border: 1px solid var(--border-subtle); background: var(--bg-input); border-radius: var(--r-xs); padding: 2px 8px; white-space: nowrap; }
.home .job-lang--pri { color: var(--text-primary); border-color: var(--border-strong); font-weight: 600; }
.home .job-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: var(--s-2); border-top: 1px solid var(--border-subtle); }
.home .job-deadline { font-size: var(--t-xs); font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.home .job-deadline--urgent { color: var(--warning); }
.home .job-apply { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-xs); font-weight: 600; color: var(--accent); white-space: nowrap; }
.home .job-apply svg { width: 14px; height: 14px; }
.home .jobs-empty { text-align: center; color: var(--text-tertiary); padding: var(--s-10) 0; grid-column: 1 / -1; line-height: 1.6; }
.home .jobs-empty-actions { margin-top: var(--s-4); display: flex; justify-content: center; }
/* EP-5 full-board search: a banner + dashed cards say "not the board above, but open". */
.home .fullboard-note { grid-column: 1 / -1; text-align: center; color: var(--text-secondary); font-size: var(--t-sm); line-height: 1.6; margin-bottom: var(--s-2); }
.home .jobs-grid.is-fullboard .job-card { border-style: dashed; border-color: var(--border-strong); background: var(--bg-glass); }
/* EP-6 double opt-in landing toast (transient; fades in/out) */
.home .home-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); max-width: 92vw; background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--accent); border-radius: var(--r-md); padding: var(--s-3) var(--s-5); box-shadow: 0 8px 30px rgba(0,0,0,0.35); font-size: var(--t-sm); line-height: 1.5; opacity: 0; pointer-events: none; transition: opacity var(--d-base) var(--ease-out), transform var(--d-base) var(--ease-out); z-index: 1000; }
.home .home-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ── How it works ── */
.home .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); max-width: 1000px; margin: 0 auto; }
.home .step-card { background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--r-md); padding: var(--s-6); }
.home .step-num { font-size: var(--t-xs); font-weight: 700; color: var(--accent); font-family: var(--font-mono); display: block; margin-bottom: var(--s-3); }
.home .step-card h3 { font-size: var(--t-base); font-weight: 600; margin: 0 0 var(--s-2); letter-spacing: -0.01em; }
.home .step-card p { font-size: var(--t-sm); color: var(--text-secondary); line-height: 1.6; margin: 0; }

/* ── No-smoke strip ── */
.home .promises { display: flex; justify-content: center; gap: var(--s-6); flex-wrap: wrap; max-width: 900px; margin: 0 auto; padding: var(--s-5) var(--s-6); background: var(--bg-glass); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); backdrop-filter: blur(16px); }
.home .promise { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-sm); color: var(--text-secondary); }
.home .promise::before { content: '✓'; color: var(--accent); font-weight: 700; }

/* ── Job alerts band ── */
.home .alerts-band {
  max-width: 1000px; margin: 0 auto; padding: var(--s-8);
  background: var(--bg-glass-strong); border: 1px solid var(--border-default); border-radius: var(--r-lg);
  backdrop-filter: blur(20px); display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s-6); align-items: center;
}
.home .alerts-title { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.015em; margin: 0 0 var(--s-2); }
.home .alerts-sub { font-size: var(--t-sm); color: var(--text-secondary); line-height: 1.6; margin: 0; }
.home .alerts-row { display: flex; gap: var(--s-2); }
.home .alerts-row input { flex: 1; }
.home .alerts-row .btn { flex-shrink: 0; }
.home .alerts-ok { color: var(--success); font-weight: 600; font-size: var(--t-sm); margin: 0; }

/* ── Footer ── */
.home .footer { max-width: var(--container); margin: var(--s-10) auto 0; padding: var(--s-8) var(--s-6); border-top: 1px solid var(--border-subtle); color: var(--text-tertiary); font-size: var(--t-xs); text-align: center; }
.home .footer a { color: var(--text-secondary); }
.home .footer a:hover { color: var(--accent); }
.home .footer-links { display: flex; justify-content: center; gap: var(--s-6); flex-wrap: wrap; margin-bottom: var(--s-4); font-size: var(--t-sm); }
.home .footer-legal { max-width: 640px; margin: 0 auto var(--s-3); line-height: 1.6; }
.home .footer-copy { margin: 0; }

/* ── Responsive ── */
@media (max-width: 980px) { .home .jobs-grid { grid-template-columns: repeat(2, 1fr); } .home .steps { grid-template-columns: 1fr; } .home .alerts-band { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .home .jobs-grid { grid-template-columns: 1fr; } }

/* =====================================================================
   EP-2b — Validation modal (mock). Shell + content; reuses .btn/.chip/
   .check-item/.spinner/.progress-* from style.css. Ported from the
   prototype, scoped under .home. (Radial nearby = EP-2c.)
   ===================================================================== */
.home .vmodal { position: fixed; inset: 0; z-index: var(--z-modal); padding: var(--s-6); display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); }
.home .vmodal-card {
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  background: var(--bg-glass-strong); border: 1px solid var(--border-default); border-radius: var(--r-xl);
  padding: var(--s-6); backdrop-filter: blur(24px); box-shadow: var(--shadow-lg);
}
@media (prefers-reduced-motion: no-preference) {
  .home .vmodal-card { animation: vmodalIn var(--d-base) var(--ease-out) both; }
  @keyframes vmodalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
}
.home .vmodal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.home .vmodal-job { font-size: var(--t-xs); font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-full); padding: 4px 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.home .vmodal-close { color: var(--text-tertiary); font-size: var(--t-base); padding: var(--s-1) var(--s-2); border-radius: var(--r-xs); background: none; border: none; cursor: pointer; transition: color var(--d-fast) var(--ease-out); }
.home .vmodal-close:hover { color: var(--text-primary); }
.home .vmodal-h { font-size: var(--t-xl); font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 var(--s-2); }
.home .vmodal-p { color: var(--text-secondary); line-height: 1.6; margin: 0 0 var(--s-5); font-size: var(--t-base); }
.home .vmodal-btns { display: flex; flex-direction: column; gap: var(--s-2); }
.home .vmodal-err { color: var(--danger); font-size: var(--t-sm); font-weight: 500; margin: 0 0 var(--s-3); }
.home .vmodal-gdpr { font-size: var(--t-sm); color: var(--text-secondary); line-height: 1.6; background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--r-md); padding: var(--s-4); }
.home .vmodal-gdpr a { color: var(--accent); font-weight: 500; }
.home .vmodal-fromcity { font-size: var(--t-xs); font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-full); padding: 4px 12px; display: inline-block; margin: 0 0 var(--s-4); }
.home .vmodal-fields { display: flex; flex-direction: column; gap: var(--s-4); margin: var(--s-5) 0; }
.home .btn-block { width: 100%; justify-content: center; }

/* progress (reuses tokens; thin bar + label) */
.home .vmodal-progress { margin: var(--s-4) 0 var(--s-5); }
.home .vmodal-progress-track { height: 4px; background: var(--bg-input); border-radius: var(--r-full); overflow: hidden; }
.home .vmodal-progress-fill { height: 100%; background: var(--accent); border-radius: var(--r-full); transition: width var(--d-base) var(--ease-out); }
.home .vmodal-progress-label { font-size: var(--t-xs); color: var(--text-tertiary); margin-top: var(--s-2); letter-spacing: 0.02em; }

/* centered states (searching / done / fail) */
.home .vmodal-center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-3); padding: var(--s-4) 0; }
.home .vmodal-result { width: 56px; height: 56px; border-radius: var(--r-full); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; }
.home .vmodal-result--success { background: var(--success-soft); color: var(--success); box-shadow: 0 0 24px var(--success-soft); }
.home .vmodal-result--warning { background: var(--warning-soft); color: var(--warning); }

/* nearby list (EP-2b placeholder; EP-2c swaps for the radial) */
.home .nearby-list { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-4); max-height: 40vh; overflow-y: auto; }
.home .nearby-item { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--r-sm); font-size: var(--t-base); color: var(--text-primary); font-family: inherit; text-align: left; cursor: pointer; transition: all var(--d-fast) var(--ease-out); }
.home .nearby-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.home .nearby-km { font-size: var(--t-xs); font-weight: 600; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

/* fail-state alerts mini-form */
.home .vmodal-alerts { width: 100%; background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--r-md); padding: var(--s-4); text-align: left; }
.home .vmodal-alerts-row { display: flex; gap: var(--s-2); }
.home .vmodal-alerts-row input { flex: 1; }
.home .vmodal-alerts-row .btn { flex-shrink: 0; }
.home .vmodal-langs { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-5); }

/* =====================================================================
   EP-2c — Radial "nearby cities" diagram inside the modal nearby step.
   Ported from the approved Pop-up Ciudades Cercanas, remapped to Apply
   tokens + --font, scoped under .home. The card widens only for this step.
   ===================================================================== */
.home .vmodal-card--wide { max-width: min(820px, 96vw); }
.home .np-stage { position: relative; width: 100%; aspect-ratio: 1100 / 660; margin: var(--s-2) 0 var(--s-3); }
.home .np-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.home .np-compass { position: absolute; top: 6px; right: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-tertiary); font-size: 11px; letter-spacing: 0.08em; }
.home .np-compass .arrow-up { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid var(--text-tertiary); }
.home .np-hint { font-size: var(--t-sm); color: var(--text-secondary); text-align: center; min-height: 1.2em; margin: 0 0 var(--s-3); }
.home .np-hint strong { color: var(--accent); font-weight: 700; }

/* diagram (SVG) */
.home .np-guide { stroke: var(--border-default); stroke-width: 1.5; }
.home .np-arrow { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.home .np-arrowhead { fill: var(--accent); }
.home .np-pill-bg { fill: var(--bg-base); stroke: var(--border-default); }
.home .np-pill-text { fill: var(--accent); font-family: var(--font); font-size: 13.5px; font-weight: 600; }
.home .np-city { cursor: pointer; outline: none; }
.home .np-city-pill { fill: var(--bg-elevated); stroke: var(--border-strong); stroke-width: 1.5; transition: fill var(--d-base) var(--ease-out), stroke var(--d-base) var(--ease-out); }
.home .np-city:hover .np-city-pill, .home .np-city:focus-visible .np-city-pill { fill: var(--accent-soft); stroke: var(--accent); }
.home .np-city-name { fill: var(--text-primary); font-family: var(--font); font-size: 14px; font-weight: 600; pointer-events: none; }
.home .np-city-dir { fill: var(--accent); font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; pointer-events: none; }
.home .np-spoke.is-hot .np-guide { stroke: var(--border-strong); }
.home .np-spoke.is-hot .np-pill-bg { stroke: var(--accent); }
.home .np-center-bg { fill: var(--bg-base); }
.home .np-center-ring { fill: none; stroke: var(--accent); stroke-width: 2; }
.home .np-center-halo { fill: none; stroke: var(--accent-soft); stroke-width: 1; }
.home .np-center-name { fill: var(--text-primary); font-family: var(--font); font-size: 24px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.home .np-center-sub { fill: var(--text-tertiary); font-family: var(--font); font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em; text-anchor: middle; pointer-events: none; }
[data-theme="light"] .home .np-city { filter: drop-shadow(0 6px 16px rgba(15, 23, 42, 0.10)); }
[data-theme="light"] .home .np-center { filter: drop-shadow(0 10px 28px rgba(15, 23, 42, 0.12)); }
