/* =====================================================================
   BACHECA PUBBLICA OFFERTE (/lavora) — CareersController
   Pagina pubblica, senza il layout del CRM: stesso linguaggio visivo del
   design system nexus (navy + indaco, card bianche, radius 12) ma
   autonomo: non carica site.css né nexus.css.
   ===================================================================== */
:root {
    --cr-primary: #4F46E5;
    --cr-primary-hover: #4338ca;
    --cr-primary-soft: #EEF2FF;
    --cr-primary-border: #C7D2FE;
    --cr-primary-rgb: 79,70,229;
    --cr-primary-fg: #fff;
    --cr-hero-1: #1e293b;
    --cr-hero-2: #334155;
    --cr-hero-3: #0f172a;
    --cr-hero-rgb: 30,41,59;
    --cr-hero-fg: #fff;
    --cr-hero-fg-rgb: 255,255,255;
    --cr-font: 'Inter';
    --cr-navy: #0f172a;
    --cr-text: #111827;
    --cr-gray: #6B7280;
    --cr-border: #E5E7EB;
    --cr-bg: #F3F4F6;
    --cr-radius: 12px;
    --cr-shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03);
}

body.careers { margin: 0; background: var(--cr-bg); color: var(--cr-text); font-family: var(--cr-font), 'Inter', 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
.careers-container { max-width: 1140px; margin: 0 auto; padding: 0 20px; width: 100%; box-sizing: border-box; }
.careers-main { flex: 1; padding: 28px 20px 48px; }

/* ══════ HEADER ══════ */
.careers-header { background: #fff; border-bottom: 1px solid var(--cr-border); position: sticky; top: 0; z-index: 20; }
.careers-header .careers-container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.careers-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--cr-navy); text-decoration: none; letter-spacing: -.01em; }
.careers-brand-icon { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--cr-hero-1), var(--cr-primary)); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.careers-nav { display: flex; align-items: center; gap: 6px; }
.careers-nav-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; color: #374151; font-weight: 600; font-size: .88rem; text-decoration: none; background: none; border: none; cursor: pointer; font-family: inherit; }
.careers-nav-link:hover { background: #F3F4F6; color: var(--cr-primary); }

/* ══════ HERO ══════ */
.careers-hero { background: linear-gradient(135deg, var(--cr-hero-1) 0%, var(--cr-hero-2) 50%, var(--cr-hero-3) 100%); border-radius: 16px; padding: 36px 32px; color: var(--cr-hero-fg); margin-bottom: 28px; box-shadow: 0 10px 30px -5px rgba(var(--cr-hero-rgb),.45); position: relative; overflow: hidden; }
.careers-hero::before { content: ''; position: absolute; top: -50%; right: -10%; width: 320px; height: 320px; background: radial-gradient(circle, rgba(var(--cr-primary-rgb),.25) 0%, transparent 70%); pointer-events: none; }
.careers-hero h1 { font-weight: 800; font-size: 1.7rem; margin: 0 0 6px; letter-spacing: -.02em; }
.careers-hero p { color: rgba(var(--cr-hero-fg-rgb),.72); margin: 0; font-size: .95rem; }
.careers-hero .hero-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: .85rem; color: rgba(var(--cr-hero-fg-rgb),.8); }
.careers-hero .hero-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: .75rem; font-weight: 700; background: rgba(var(--cr-hero-fg-rgb),.12); border: 1px solid rgba(var(--cr-hero-fg-rgb),.2); }
.careers-hero .hero-chip.ok { background: rgba(16,185,129,.2); border-color: rgba(16,185,129,.45); color: #A7F3D0; }
.careers-hero .hero-chip.warn { background: rgba(245,158,11,.2); border-color: rgba(245,158,11,.45); color: #FDE68A; }
.careers-hero .hero-actions { position: relative; z-index: 1; margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ══════ RICERCA ══════ */
.careers-search { background: #fff; border: 1px solid var(--cr-border); border-radius: var(--cr-radius); padding: 12px 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; box-shadow: var(--cr-shadow); }
.careers-search .field { position: relative; flex: 1; min-width: 200px; }
.careers-search .field i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9CA3AF; }
.careers-search input { width: 100%; padding: 9px 14px 9px 36px; border-radius: 20px; border: 1px solid var(--cr-border); font-size: .9rem; font-family: inherit; }
.careers-search input:focus { outline: none; border-color: var(--cr-primary); box-shadow: 0 0 0 3px rgba(var(--cr-primary-rgb),.12); }

/* ══════ BOTTONI ══════ */
.careers-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: .88rem; text-decoration: none; border: 1px solid var(--cr-border); background: #fff; color: #374151; cursor: pointer; transition: all .2s; font-family: inherit; }
.careers-btn:hover { border-color: var(--cr-primary); color: var(--cr-primary); }
.careers-btn.primary { background: var(--cr-primary); border-color: var(--cr-primary); color: var(--cr-primary-fg); box-shadow: 0 4px 6px -1px rgba(var(--cr-primary-rgb),.3); }
.careers-btn.primary:hover { background: var(--cr-primary-hover); color: var(--cr-primary-fg); transform: translateY(-1px); }
.careers-btn.ghost { background: rgba(var(--cr-hero-fg-rgb),.1); border-color: rgba(var(--cr-hero-fg-rgb),.25); color: var(--cr-hero-fg); backdrop-filter: blur(4px); }
.careers-btn.ghost:hover { background: rgba(var(--cr-hero-fg-rgb),.2); color: var(--cr-hero-fg); }
.careers-btn.success { background: #059669; border-color: #059669; color: #fff; }
.careers-btn.success:hover { background: #047857; color: #fff; }
.careers-btn.danger { color: #DC2626; }
.careers-btn.danger:hover { border-color: #DC2626; background: #FEF2F2; }
.careers-btn.sm { padding: 7px 14px; font-size: .8rem; }
.careers-btn.lg { padding: 13px 26px; font-size: 1rem; }
.careers-btn.block { width: 100%; }
.careers-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ══════ CARD OFFERTE ══════ */
.careers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.careers-card { background: #fff; border: 1px solid var(--cr-border); border-radius: var(--cr-radius); box-shadow: var(--cr-shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; position: relative; }
.careers-card:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -8px rgba(15,23,42,.15); }
.careers-card-body { padding: 20px; flex: 1; }
.careers-card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }
.careers-card-title a { color: var(--cr-text); text-decoration: none; }
.careers-card-title a:hover { color: var(--cr-primary); }
.careers-card-company { font-size: .85rem; color: var(--cr-gray); }
.careers-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0; font-size: .82rem; color: #4B5563; }
.careers-meta i { color: #9CA3AF; margin-right: 5px; }
.careers-card-footer { padding: 12px 20px; border-top: 1px solid #F3F4F6; background: #F9FAFB; display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: var(--cr-gray); border-radius: 0 0 var(--cr-radius) var(--cr-radius); }
.careers-tag { display: inline-block; background: #F3F4F6; color: #4B5563; border: 1px solid var(--cr-border); padding: 3px 9px; border-radius: 6px; font-size: .72rem; font-weight: 600; margin: 0 4px 4px 0; }
.careers-tag.primary { background: var(--cr-primary-soft); color: var(--cr-primary); border-color: var(--cr-primary-border); }
.careers-badge { display: inline-block; padding: 4px 11px; border-radius: 20px; font-size: .74rem; font-weight: 700; }
.careers-badge.ok { background: #DCFCE7; color: #166534; }
.careers-badge.info { background: #DBEAFE; color: #1D4ED8; }
.careers-badge.warn { background: #FEF3C7; color: #D97706; }
.careers-badge.bad { background: #FEE2E2; color: #DC2626; }
.careers-badge.muted { background: #F3F4F6; color: #4B5563; }
.careers-card .applied-mark { position: absolute; top: 14px; right: 14px; }

/* ══════ PANNELLI ══════ */
.careers-panel { background: #fff; border: 1px solid var(--cr-border); border-radius: var(--cr-radius); box-shadow: var(--cr-shadow); margin-bottom: 24px; overflow: hidden; }
.careers-panel-head { padding: 14px 22px; background: #F9FAFB; border-bottom: 1px solid var(--cr-border); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--cr-gray); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.careers-panel-body { padding: 22px; }
.careers-desc { white-space: pre-line; line-height: 1.65; color: #374151; font-size: .95rem; }
.careers-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.careers-kv .k { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #9CA3AF; margin-bottom: 3px; }
.careers-kv .v { font-size: .9rem; font-weight: 600; color: var(--cr-text); }
.careers-layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 24px; }
.careers-sticky { position: sticky; top: 84px; }

/* ══════ FORM ══════ */
.careers-form { max-width: 480px; margin: 0 auto; }
.careers-form .careers-panel-body { padding: 28px; }
.careers-form h1 { font-size: 1.4rem; font-weight: 800; margin: 0 0 6px; letter-spacing: -.02em; }
.careers-form .lead { color: var(--cr-gray); font-size: .9rem; margin-bottom: 20px; }
.careers label { font-size: .8rem; font-weight: 600; color: #4B5563; margin-bottom: 4px; display: block; }
.careers .form-control { border-radius: 8px; border: 1px solid var(--cr-border); padding: .6rem .8rem; font-size: .92rem; font-family: inherit; }
.careers .form-control:focus { border-color: var(--cr-primary); box-shadow: 0 0 0 3px rgba(var(--cr-primary-rgb),.12); }
.careers .field-error { color: #DC2626; font-size: .76rem; margin-top: 3px; display: block; }
.careers .form-check-label { font-size: .85rem; color: #374151; font-weight: 500; }
.careers-form .switch-link { text-align: center; font-size: .85rem; color: var(--cr-gray); margin-top: 18px; }
.careers-form .switch-link a { color: var(--cr-primary); font-weight: 600; text-decoration: none; }

/* ══════ AVVISI ══════ */
.careers-alert { border-radius: var(--cr-radius); padding: 13px 18px; margin-bottom: 20px; display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.careers-alert.ok { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.careers-alert.warn { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.careers-alert.bad { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.careers-alert.info { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.careers-empty { text-align: center; padding: 60px 20px; color: var(--cr-gray); }
.careers-empty i { font-size: 2.4rem; color: #D1D5DB; display: block; margin-bottom: 10px; }
.careers-empty strong { display: block; color: var(--cr-text); font-size: 1.05rem; margin-bottom: 4px; }

/* ══════ DROPZONE / CV ══════ */
.careers-dropzone { border: 2px dashed #CBD5E1; border-radius: var(--cr-radius); background: #F9FAFB; padding: 36px 20px; text-align: center; cursor: pointer; transition: all .2s; }
.careers-dropzone:hover, .careers-dropzone.dragover { border-color: var(--cr-primary); background: var(--cr-primary-soft); }
.careers-dropzone .dz-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--cr-primary-soft); color: var(--cr-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 10px; }
.careers-dropzone .dz-title { font-weight: 700; }
.careers-dropzone .dz-sub { font-size: .8rem; color: var(--cr-gray); margin: 4px 0 12px; }
.careers-dropzone .dz-file { display: none; align-items: center; justify-content: center; gap: 10px; font-weight: 600; margin-top: 10px; }
.careers-dropzone .dz-file.show { display: flex; }
.careers-cvbox { display: flex; gap: 14px; align-items: flex-start; }
.careers-cvbox .cv-icon { width: 46px; height: 46px; border-radius: 12px; background: #FEE2E2; color: #DC2626; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.careers-cvbox .cv-icon.doc { background: #DBEAFE; color: #1D4ED8; }
.careers-progress { display: none; margin-top: 16px; }
.careers-progress.show { display: block; }
.careers-progress .bar { height: 6px; border-radius: 3px; background: #E5E7EB; overflow: hidden; }
.careers-progress .bar span { display: block; height: 100%; width: 0; background: var(--cr-primary); transition: width .3s; }
.careers-progress .txt { font-size: .82rem; color: var(--cr-gray); margin-top: 8px; display: flex; align-items: center; gap: 8px; }

/* ══════ LISTE ══════ */
.careers-row { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid #F3F4F6; text-decoration: none; color: inherit; }
.careers-row:last-child { border-bottom: none; }
.careers-row:hover { background: #F9FAFB; }
.careers-row .main { flex: 1; min-width: 0; }
.careers-row .t { font-weight: 600; color: var(--cr-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.careers-row .s { font-size: .78rem; color: var(--cr-gray); }

/* ══════ FOOTER ══════ */
.careers-footer { border-top: 1px solid var(--cr-border); background: #fff; padding: 18px 0; font-size: .78rem; color: var(--cr-gray); }
.careers-footer .careers-container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 900px) {
    .careers-layout { grid-template-columns: 1fr; }
    .careers-sticky { position: static; }
    .careers-header .careers-container { height: auto; padding: 10px 20px; flex-wrap: wrap; }
}
@media (max-width: 600px) {
    .careers-grid { grid-template-columns: 1fr; }
    .careers-hero { padding: 26px 20px; }
    .careers-hero h1 { font-size: 1.35rem; }
}

/* ══════ WIZARD CREA CV (/lavora/crea-cv) ══════ */
.cvw { max-width: 900px; margin: 0 auto; }
.cvw-steps { list-style: none; padding: 0; margin: 0 0 22px; display: flex; gap: 6px; flex-wrap: wrap; }
.cvw-steps li { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--cr-border); font-size: .8rem; font-weight: 600; color: var(--cr-gray); cursor: pointer; }
.cvw-steps li .n { width: 24px; height: 24px; border-radius: 50%; background: #F3F4F6; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 800; flex-shrink: 0; }
.cvw-steps li.active { border-color: var(--cr-primary); color: var(--cr-primary); background: var(--cr-primary-soft); }
.cvw-steps li.active .n { background: var(--cr-primary); color: var(--cr-primary-fg); }
.cvw-steps li.done { color: #065F46; }
.cvw-steps li.done .n { background: #DCFCE7; color: #166534; }
.cvw-hint { font-size: .78rem; color: var(--cr-gray); margin-top: 4px; }
.cvw-list { display: flex; flex-direction: column; gap: 12px; }
.cvw-row { position: relative; border: 1px solid var(--cr-border); border-radius: 10px; padding: 16px 44px 16px 16px; background: #FAFAFB; }
.cvw-list.compact .cvw-row { padding: 10px 44px 10px 10px; }
.cvw-remove { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--cr-border); background: #fff; color: #9CA3AF; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; }
.cvw-remove:hover { color: #DC2626; border-color: #DC2626; background: #FEF2F2; }
.cvw-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.cvw-nav-pos { font-size: .8rem; color: var(--cr-gray); font-weight: 600; }
.careers .form-control.is-invalid { border-color: #DC2626; box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.cvw-summary .cvw-sum-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
.cvw-summary .cvw-sum-role { color: var(--cr-primary); font-weight: 600; }
.cvw-summary .cvw-sum-meta { font-size: .82rem; color: var(--cr-gray); }
.cvw-summary .cvw-sum-head { padding-bottom: 14px; border-bottom: 1px solid var(--cr-border); margin-bottom: 14px; }
.cvw-summary .cvw-sum-p { font-size: .9rem; color: #374151; line-height: 1.6; }
.cvw-summary .cvw-sum-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #9CA3AF; margin-bottom: 6px; }
.cvw-summary .cvw-sum-list { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.cvw-summary .cvw-sum-list li { padding: 4px 0; border-bottom: 1px dashed #F3F4F6; }
@media (max-width: 600px) { .cvw-steps li .l { display: none; } .cvw-steps li { min-width: 0; justify-content: center; } }

/* ══════ FOTO ══════ */
.careers-cvbox .cv-photo { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--cr-border); }
.cvw-photo { display: flex; gap: 16px; align-items: flex-start; }
.cvw-photo-preview { width: 84px; height: 84px; border-radius: 14px; background: #F3F4F6; border: 1px solid var(--cr-border); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #9CA3AF; overflow: hidden; flex-shrink: 0; }
.cvw-photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Accesso con LinkedIn */
.careers .careers-btn.linkedin { background: #0A66C2; border-color: #0A66C2; color: #fff; }
.careers .careers-btn.linkedin:hover { background: #004182; border-color: #004182; color: #fff; }
.careers .careers-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: #9CA3AF; font-size: .82rem; }
.careers .careers-or::before, .careers .careers-or::after { content: ""; flex: 1; height: 1px; background: #E5E7EB; }

/* ══════ PERSONALIZZAZIONE AZIENDA (CVCareerBoardSettings) ══════ */
.careers-brand-logo { height: 40px; max-width: 180px; object-fit: contain; display: block; }
.careers-hero.has-cover { background-size: cover; background-position: center; }
.careers-hero.has-cover::before { display: none; }
.careers-footer .footer-custom { white-space: pre-line; }
.careers-nav-link.website { color: var(--cr-gray); }

/* ══════ VISTA SCHEDE / TABELLA ══════ */
.careers-results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -8px 0 16px; font-size: .85rem; color: var(--cr-gray); }
.careers-view-toggle { display: inline-flex; background: #fff; border: 1px solid var(--cr-border); border-radius: 10px; padding: 3px; gap: 2px; box-shadow: var(--cr-shadow); }
.careers-view-toggle a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; font-size: .8rem; font-weight: 600; color: #4B5563; text-decoration: none; }
.careers-view-toggle a:hover { color: var(--cr-primary); }
.careers-view-toggle a.active { background: var(--cr-primary); color: var(--cr-primary-fg); }

.careers-table-wrap { background: #fff; border: 1px solid var(--cr-border); border-radius: var(--cr-radius); box-shadow: var(--cr-shadow); overflow: hidden; }
.careers-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.careers-table thead th { background: #F9FAFB; border-bottom: 1px solid var(--cr-border); padding: 12px 16px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--cr-gray); text-align: left; white-space: nowrap; }
.careers-table thead th[data-sort] { cursor: pointer; user-select: none; }
.careers-table thead th[data-sort]:hover { color: var(--cr-primary); }
.careers-table thead th .sort-ind { opacity: .35; margin-left: 4px; font-size: .7rem; }
.careers-table thead th.sorted .sort-ind { opacity: 1; color: var(--cr-primary); }
.careers-table tbody td { padding: 14px 16px; border-bottom: 1px solid #F3F4F6; vertical-align: middle; color: #374151; }
.careers-table tbody tr:last-child td { border-bottom: none; }
.careers-table tbody tr { cursor: pointer; transition: background .15s; }
.careers-table tbody tr:hover { background: var(--cr-primary-soft); }
.careers-table .job-title { font-weight: 700; color: var(--cr-text); text-decoration: none; }
.careers-table .job-title:hover { color: var(--cr-primary); }
.careers-table .job-sub { font-size: .76rem; color: var(--cr-gray); margin-top: 2px; }
.careers-table .muted { color: #9CA3AF; }
.careers-table td.actions { text-align: right; white-space: nowrap; }
@media (max-width: 760px) {
    .careers-table thead { display: none; }
    .careers-table, .careers-table tbody, .careers-table tr, .careers-table td { display: block; width: 100%; }
    .careers-table tbody tr { padding: 12px 16px; border-bottom: 1px solid #F3F4F6; }
    .careers-table tbody td { border: none; padding: 3px 0; }
    .careers-table tbody td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; font-weight: 600; color: var(--cr-gray); font-size: .76rem; }
    .careers-table td.actions { text-align: left; padding-top: 8px; }
}
