/* ============================================================================
   CAREERS-EVOLUTION — design system clonato da EVOLUTION-SITE
   Palette burgundy #832146 (wordmark del logo) + slate #646c77, fondo bianco
   caldo. Tipografia Anton (display) + Inter (body). Firma "fulmine" via mask SVG.
   CSS vanilla: niente toolchain, resa fedele al sito statico Astro.
============================================================================ */
:root {
  --brand-bg: #ffffff;
  --brand-surface: #f8f5f6;
  --brand-surface-2: #efe9eb;
  --brand-border: #e3dcdf;

  --brand-fg: #1a1417;
  --brand-fg-muted: #5a4d52;
  --brand-fg-dim: #9a8f93;

  --brand-accent: #832146;
  --brand-accent-hover: #6e1b3b;
  --brand-accent-deep: #5a1530;
  --brand-accent-soft: #f5e6ec;
  --brand-pink: #de7ca4;

  --brand-slate: #646c77;
  --brand-success: #1f7a4d;
  --brand-danger: #c2351a;

  --font-display: "Anton", "Bebas Neue", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius-card: 12px;
  --radius-pill: 999px;
  --container-max: 1200px;
}

* { box-sizing: border-box; }

html {
  background: var(--brand-bg);
  color: var(--brand-fg);
  color-scheme: light;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { margin: 0; min-height: 100dvh; background: var(--brand-bg); }

a { color: var(--brand-accent); }
p { orphans: 2; widows: 2; }

.h-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.95;
  text-transform: uppercase;
  text-wrap: balance;
  margin: 0;
}

::selection { background: var(--brand-accent); color: #fff; }
:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: 4px; }

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Header (identico a EVOLUTION-SITE: sticky, blur, logo + nav + CTA) ──── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1rem;
}
.site-header__logo { display: inline-flex; align-items: center; text-decoration: none; }
.site-header__logo img { height: 40px; width: auto; display: block; }
@media (min-width: 768px) { .site-header__logo img { height: 48px; } }
.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav__link {
  font-size: 0.875rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.05em; text-decoration: none; color: var(--brand-fg-muted);
  transition: color 0.18s ease;
}
.site-nav__link:hover { color: var(--brand-fg); }
.site-nav__link.is-active { color: var(--brand-accent); }
.header-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.1rem; border-radius: var(--radius-pill);
  background: var(--brand-accent); color: #fff;
  font-size: 0.875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  text-decoration: none; transition: background-color 0.18s ease;
}
.header-cta:hover { background: var(--brand-accent-hover); }
.header-cta .arrow { transition: transform 0.24s cubic-bezier(0.4,0.05,0.25,1); }
.header-cta:hover .arrow { transform: translateX(5px); }

/* ── Hero (PageHero) ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: #2a1019;
  color: #fff;
}
.hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  opacity: 0.55;
}
.hero__overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(105deg, rgba(131,33,70,0.92) 0%, rgba(90,21,48,0.78) 45%, rgba(42,16,25,0.55) 100%),
    radial-gradient(120% 120% at 80% 10%, rgba(222,124,164,0.25), transparent 60%);
}
.hero__inner {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 7rem);
  max-width: 820px;
}
.hero__eyebrow {
  font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase;
  font-weight: 700; color: var(--brand-pink); margin: 0 0 1rem;
}
.hero__title {
  font-size: clamp(1.9rem, 6.4vw, 5rem);
  color: #fff;
}
.hero__subtitle {
  margin: 1.1rem 0 0;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
  text-wrap: pretty;
  max-width: 60ch;
}

/* Firma fulmine (mask SVG, eredita il colore da background-color) */
.bolt {
  width: 100%;
  height: 22px;
  max-width: 300px;
  margin-top: 1.4rem;
  background-color: var(--brand-pink);
  -webkit-mask: url("/static/brand/bolt.svg") repeat-x left center / auto 100%;
  mask: url("/static/brand/bolt.svg") repeat-x left center / auto 100%;
}
.bolt--accent { background-color: var(--brand-accent); }
.bolt--divider { max-width: 220px; height: 24px; margin: 0 auto 2rem; }

/* ── Section ──────────────────────────────────────────────────────────── */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--surface { background: var(--brand-surface); }
.section--accent { background: var(--brand-accent); color: #fff; }
.section--accent .section__eyebrow { color: var(--brand-pink); }

.section__eyebrow {
  font-size: 0.74rem; letter-spacing: 0.26em; text-transform: uppercase;
  font-weight: 700; color: var(--brand-accent); margin: 0 0 0.6rem;
}
/* Titoli di sezione: Inter (non Anton) — coerenti coi sotto-titoli, meno impattanti. */
.section__title {
  font-family: var(--font-body); font-weight: 700; text-transform: none;
  letter-spacing: -0.01em; line-height: 1.2;
  font-size: clamp(1.3rem, 2.8vw, 1.95rem); color: var(--brand-fg);
}
.section__lead {
  margin: 0.8rem 0 0; color: var(--brand-fg-muted);
  font-size: 1.05rem; line-height: 1.6; max-width: 60ch; text-wrap: pretty;
}
.section--accent .section__lead { color: rgba(255,255,255,0.88); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.7rem;
  border-radius: var(--radius-pill);
  font-weight: 700; font-size: 0.96rem;
  text-decoration: none; border: 0; cursor: pointer;
  background: var(--brand-accent); color: #fff;
  transition: background-color 0.18s ease, transform 0.18s ease;
}
.btn:hover { background: var(--brand-accent-hover); }
.btn--lg { padding: 1rem 2rem; font-size: 1.05rem; }
.btn--ghost {
  background: transparent; color: var(--brand-accent);
  border: 1.5px solid var(--brand-accent);
}
.btn--ghost:hover { background: var(--brand-accent-soft); }
.btn--onaccent { background: #fff; color: var(--brand-accent); }
.btn--onaccent:hover { background: var(--brand-accent-soft); }
.btn--block { width: 100%; justify-content: center; }
.btn .arrow { transition: transform 0.24s cubic-bezier(0.4,0.05,0.25,1); }
.btn:hover .arrow { transform: translateX(5px); }
.btn[disabled] { opacity: 0.6; cursor: default; }

/* ── Job cards (elenco posizioni) ─────────────────────────────────────── */
.jobs-grid { display: grid; gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 720px) { .jobs-grid { grid-template-columns: 1fr; } }

.job-card {
  display: block;
  padding: 1.6rem 1.7rem;
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-card);
  text-decoration: none; color: inherit;
  break-inside: avoid;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.job-card:hover {
  border-color: var(--brand-accent);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -22px rgba(131,33,70,0.5);
}
.job-card__top { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.job-card__title {
  font-family: var(--font-body); font-weight: 700; text-transform: none;
  letter-spacing: -0.01em; line-height: 1.25;
  font-size: clamp(1.2rem, 2.6vw, 1.55rem); color: var(--brand-fg);
}
.job-card__meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0.7rem 0 0; color: var(--brand-fg-muted); font-size: 0.92rem; }
.job-card__meta span { display: inline-flex; align-items: center; gap: 0.4rem; }
.job-card__desc { margin: 0.9rem 0 0; color: var(--brand-fg-muted); line-height: 1.6; }
.job-card__cta {
  margin-top: 1.1rem; display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 700; color: var(--brand-accent);
}

.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.7rem; border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.badge--open { background: var(--brand-accent-soft); color: var(--brand-accent-deep); }
.badge--dot::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-success); display: inline-block;
}

/* ── Dettaglio offerta ────────────────────────────────────────────────── */
.offer { display: grid; gap: 2.2rem; }
@media (min-width: 900px) { .offer { grid-template-columns: 1.5fr 1fr; align-items: start; } }

.offer__meta-card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-card);
  padding: 1.4rem 1.5rem;
  position: sticky; top: 84px;
}
.offer__meta-card dl { margin: 0; display: grid; gap: 0.85rem; }
.offer__meta-card dt { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-fg-dim); font-weight: 700; }
.offer__meta-card dd { margin: 0.15rem 0 0; font-weight: 600; }

.offer-block { margin-bottom: 1.9rem; break-inside: avoid; }
/* Sotto-titoli di contenuto: Inter (non Anton), leggeri — non "titoloni". */
.offer-block__title {
  font-family: var(--font-body); font-weight: 600; letter-spacing: -0.01em;
  font-size: 1.18rem; margin: 0 0 0.7rem; color: var(--brand-fg);
}
.offer-block p { line-height: 1.75; color: var(--brand-fg-muted); margin: 0; text-align: justify; hyphens: auto; }

.bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.bullets li { position: relative; padding-left: 1.5rem; line-height: 1.6; color: var(--brand-fg-muted); }
.bullets li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 0.7rem; height: 0.7rem;
  background-color: var(--brand-accent);
  -webkit-mask: url("/static/brand/bolt.svg") no-repeat center / contain;
  mask: url("/static/brand/bolt.svg") no-repeat center / contain;
}

/* Orario settimanale A/B */
.weeks { display: grid; gap: 1rem; margin-top: 0.4rem; }
@media (min-width: 560px) { .weeks { grid-template-columns: 1fr 1fr; } }
.week {
  border: 1px solid var(--brand-border); border-radius: var(--radius-card);
  overflow: hidden; background: #fff; break-inside: avoid;
}
.week__head {
  background: var(--brand-accent-soft); color: var(--brand-accent-deep);
  font-weight: 700; padding: 0.6rem 1rem; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.week table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.week td { padding: 0.55rem 1rem; border-top: 1px solid var(--brand-border); }
.week td:first-child { color: var(--brand-fg-muted); }
.week td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Intro che precede una "tabellina" (settimane A/B, opzioni retribuzione):
   stacco maggiore dal blocco sottostante. */
.block-intro { margin: 0 0 1.4rem; color: var(--brand-fg-muted); }

/* Opzioni di retribuzione: stesso format delle settimane A/B (.week + .week__head). */
.week__body { padding: 0.95rem 1.1rem 1.1rem; }
.pay-amount { font-family: var(--font-body); font-weight: 800; font-size: 1.3rem; color: var(--brand-accent); }
.pay-tagline { font-size: 0.8rem; color: var(--brand-fg-muted); margin: 0.1rem 0 0.8rem; }
.week__body .bullets { gap: 0.5rem; }
.week__body .bullets li { font-size: 0.9rem; padding-left: 1.3rem; text-align: left; }
.pay-note { margin-top: 2.6rem; font-size: 0.85rem; color: var(--brand-fg-muted); font-style: italic; }

/* ── Form candidatura ─────────────────────────────────────────────────── */
.apply-card {
  background: #fff; border: 1px solid var(--brand-border);
  border-radius: var(--radius-card); padding: 1.8rem; break-inside: avoid;
}
.field { margin-bottom: 1.1rem; }
.field > label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.field .req { color: var(--brand-accent); }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"],
.field textarea {
  width: 100%; padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--brand-border); border-radius: 10px;
  font: inherit; color: var(--brand-fg); background: #fff;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand-accent); }
.field textarea { min-height: 130px; resize: vertical; }
.field .hint { font-size: 0.8rem; color: var(--brand-fg-dim); margin: 0.35rem 0 0; }
.field-error { color: var(--brand-danger); font-size: 0.82rem; margin: 0.35rem 0 0; display: none; }
.field-error.show { display: block; }
.grid-2 { display: grid; gap: 0 1rem; }
@media (min-width: 540px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.file-drop { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
/* input nativo nascosto: lo apre la label .file-btn (for="cv") */
.file-drop input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.file-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
  padding: 0.6rem 1.2rem; border-radius: var(--radius-pill);
  background: var(--brand-accent-soft); color: var(--brand-accent-deep);
  border: 1.5px solid transparent; font-weight: 700; font-size: 0.9rem;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.file-btn:hover { background: #fff; border-color: var(--brand-accent); }
.file-drop input[type="file"]:focus-visible + .file-btn { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.file-name { font-size: 0.85rem; color: var(--brand-fg-muted); }

.check { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.88rem; color: var(--brand-fg-muted); line-height: 1.5; }
.check input { margin-top: 0.2rem; }

.errors-box {
  background: #fdecea; border: 1px solid #f5c2bc; color: #8a1c0e;
  border-radius: 10px; padding: 0.9rem 1.1rem; margin-bottom: 1.2rem; font-size: 0.92rem;
}
.errors-box ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.flash { border-radius: 10px; padding: 0.8rem 1.1rem; margin-bottom: 1rem; font-size: 0.92rem; }
.flash--success { background: #e7f5ee; border: 1px solid #b6e0c8; color: #1f5d3e; }
.flash--error { background: #fdecea; border: 1px solid #f5c2bc; color: #8a1c0e; }

.privacy-note {
  font-size: 0.78rem; color: var(--brand-fg-dim); line-height: 1.6;
  background: var(--brand-surface); border-radius: 10px; padding: 0.9rem 1.1rem; margin-top: 1rem;
  text-align: justify; hyphens: auto;
}

/* ── Footer (copyright bar — come l'ultima sezione di EVOLUTION-SITE) ───── */
.footer {
  background: var(--brand-surface);
  border-top: 1px solid var(--brand-border);
  color: var(--brand-fg-dim);
  font-size: 0.78rem;
}
.footer .container { padding-block: 1.5rem; }
.footer__bar {
  display: flex; flex-direction: column; gap: 1rem; align-items: center; text-align: center;
}
@media (min-width: 768px) {
  .footer__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: left; }
}
.footer__bar a { color: var(--brand-fg-dim); text-decoration: none; }
.footer__bar a:hover { color: var(--brand-fg); }
.footer__contacts { display: flex; flex-direction: column; gap: 0.2rem; align-items: center; text-align: center; }
.footer__legalcol { display: flex; flex-direction: column; gap: 0.2rem; align-items: center; }
@media (min-width: 768px) { .footer__legalcol { align-items: flex-end; } }

/* ── Pagina "grazie" ──────────────────────────────────────────────────── */
.thanks { text-align: center; max-width: 560px; margin: 0 auto; padding-block: clamp(3rem, 8vw, 6rem); }
.thanks__icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 1.4rem;
  background: var(--brand-accent-soft); color: var(--brand-accent);
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
}

/* ── Scroll reveal (degrada con grazia) ───────────────────────────────── */
@keyframes evo-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  [data-reveal] { animation: evo-rise both; animation-timeline: view(); animation-range: entry 4% entry 70%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================================
   ADMIN
============================================================================ */
body.admin { background: var(--brand-surface); }
/* Header (pubblico + admin): logo a sx · "Careers" centrato · CTA/Esci a dx. */
.site-header__inner--center {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.site-header__inner--center > :first-child { justify-self: start; }
.site-header__inner--center .site-nav__link { justify-self: center; }
.site-header__inner--center > :last-child { justify-self: end; }
.site-header__right { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; }
.header-logout {
  background: transparent; border: 1.5px solid var(--brand-border); color: var(--brand-fg-muted);
  border-radius: var(--radius-pill); padding: 0.4rem 0.9rem; cursor: pointer; font: inherit;
  font-size: 0.82rem; font-weight: 600; transition: border-color 0.18s ease, color 0.18s ease;
}
.header-logout:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.admin-main { padding-block: 1.8rem; }

.card {
  background: #fff; border: 1px solid var(--brand-border);
  border-radius: var(--radius-card); padding: 1.5rem;
}
.card + .card { margin-top: 1.2rem; }
.card__title { font-family: var(--font-body); font-weight: 700; letter-spacing: -0.01em; font-size: 1.3rem; margin: 0 0 0.2rem; }
.card__sub { color: var(--brand-fg-muted); font-size: 0.9rem; margin: 0 0 1rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1.2rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.85rem; border-radius: var(--radius-pill);
  background: #fff; border: 1px solid var(--brand-border);
  text-decoration: none; color: var(--brand-fg-muted); font-size: 0.85rem; font-weight: 600;
}
.chip.is-active { background: var(--brand-accent); color: #fff; border-color: var(--brand-accent); }
.chip .count { opacity: 0.7; }

table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--brand-border); }
table.data th, table.data td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--brand-border); font-size: 0.9rem; }
table.data th { background: var(--brand-surface); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-fg-muted); }
table.data tr:last-child td { border-bottom: 0; }
table.data a { font-weight: 600; text-decoration: none; }

.status-pill { display: inline-block; padding: 0.2rem 0.6rem; border-radius: var(--radius-pill); font-size: 0.74rem; font-weight: 700; }
.status-new { background: #e8eef6; color: #2e3a46; }
.status-interested { background: #e7f5ee; color: #1f5d3e; }
.status-rejected { background: #f1e3e3; color: #8a3a3a; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 0.5rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--brand-fg-dim); font-size: 0.85rem; }
.kv dd { margin: 0; font-weight: 500; }
.section-title { font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; margin: 1.5rem 0 0.6rem; color: var(--brand-accent); }
.letter { white-space: pre-wrap; background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: 10px; padding: 1rem; line-height: 1.6; }
.back-link { display: inline-block; margin-bottom: 1rem; text-decoration: none; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.actions form { margin: 0; }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.85rem; border-radius: var(--radius-pill); border: 0; cursor: pointer; font-weight: 700; }
.btn-interested { background: var(--brand-success); color: #fff; }
.btn-rejected { background: var(--brand-danger); color: #fff; }
.btn-neutral { background: #fff; border: 1.5px solid var(--brand-border); color: var(--brand-fg-muted); }
.btn-danger-outline { background: #fff; border: 1.5px solid var(--brand-danger); color: var(--brand-danger); }
.note-form textarea { width: 100%; min-height: 90px; border: 1.5px solid var(--brand-border); border-radius: 10px; padding: 0.7rem; font: inherit; }
