/* ViCargo: Careers page ("Lavora con noi"). Loads after home.css (section, tag, reveal and nav
   rules) and about.css (.au-card shell, .au-two, .au-h1, .au-lede, .au-grid--3), before
   headings.css. Every class here is prefixed jb- (about.css already owns au-, home.css already
   owns cr- for the credentials rows) so nothing collides. */

/* ---------- 1. intro: heading + lede left, the V-mark detail bleeding off the right edge ---------- */
.jb-first {
  position: relative; z-index: 1;
  padding-top: calc(var(--bar-h) + var(--sec-pt));
  min-height: clamp(460px, 48vw, 640px); display: flex; align-items: center;
  /* No overflow rule here at all, on purpose. Setting overflow-x:hidden with overflow-y:visible
     (an earlier attempt) silently turns the "visible" axis into "auto" per the CSS spec --
     browsers cannot leave one axis truly visible once the other is clipped, so that combination
     creates its own scroll container, which is the "scroll inside a scroll" that showed up.
     body already carries overflow-x:hidden site-wide (directions.css:59), so the mark's bleed
     past the right edge (see .jb-mark--edge below) is already caught at the page level -- this
     section does not need, and must not add, any overflow rule of its own.
     z-index:1 on the SECTION itself (not just a child) puts it in the "positioned, positive
     z-index" paint layer, which draws above #roles right after it -- a plain in-flow sibling
     with no position of its own -- so the mark's lower half, now never clipped by anything,
     shows over #roles instead of being painted over by its background: no boundary between
     the two sections at all. */
}
.jb-first .home-inner { width: min(100%, 1180px); position: relative; z-index: 1; }
.jb-first .au-two { grid-template-columns: 1fr; max-width: 34em; }
.jb-lede { max-width: 28em; }
@media (min-width: 861px) { .jb-lede > span { display: block; } }

/* The V-mark: the same 4-path contour the CTA band uses (components.css:113-117), oversized and
   anchored so it bleeds off the page edge -- "the logo-edge detail", the user's own description.
   Colour, stroke width and opacity are the values confirmed live in the V-mark lab tool
   (careers-vmark-lab.html): #3F67D3 (the user's own pick, see DIRECTOR-FEEDBACK adjacent chat),
   1.5, fully opaque. Size/position are a responsive reconstruction of that lab session -- the lab
   positioned the mark with raw pixel offsets tuned to one specific browser window, which does not
   carry over to other viewport widths; this uses the same percentage-based anchor the V2 "edge"
   option already used, scaled up to match how large the user made it. */
.jb-mark--edge {
  position: absolute; inset: 0; left: 46%; right: calc(var(--pad) * -1);
  transform: scale(1.65) translateY(-6%); transform-origin: left center;
  pointer-events: none; z-index: 0;
}
.jb-mark--edge svg { position: absolute; left: 0; top: 0; height: 100%; width: auto; max-width: none; }
.jb-mark--edge .line-path { stroke: #3F67D3; stroke-width: 1.5; opacity: 1; fill: none; }
/* stack the text column above the mark without touching .sec-tag's own absolute positioning
   (home.css:252) -- re-positioning it to relative/static here stretched it to the full width of
   .home-inner, which turned its thin text-width underline into a line running the width of the
   page. */
.jb-first .home-inner .au-two { position: relative; z-index: 1; }

/* Traces in once, the same way the .hl-line section-label underline does: pathLength=1
   normalises the four contours (very different lengths) to one shared duration. */
.jb-mark--edge .line-path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.jb-mark--edge.is-in .line-path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1100ms var(--ease-sweep) calc(var(--i, 0) * 120ms);
}
@media (prefers-reduced-motion: reduce) { .jb-mark--edge .line-path { stroke-dashoffset: 0; transition: none; } }
@media (max-width: 860px) { .jb-mark--edge { display: none; } }

/* ---------- 2. roles: slim stacked rows, heading left, roles right (option R1) ---------- */
.r1-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.r1-wrap > * { min-width: 0; }
.r1-stack { display: grid; gap: 0; }
.r1-row {
  display: flex; flex-direction: row; align-items: center; justify-content: space-between;
  gap: 20px 32px; padding: clamp(18px, 1.8vw, 24px) clamp(12px, 1.4vw, 18px);
  margin-inline: clamp(-12px, -1.4vw, -18px);
  border-top: 1px solid var(--border-hairline); border-radius: 10px; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .r1-row:hover { background: var(--steel-050); } }
.r1-row:active { transform: scale(.994); }
.r1-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .r1-row:active { transform: none; } }
.r1-stack .bz-item:last-child .r1-row { border-bottom: 1px solid var(--border-hairline); }
.r1-row > div { display: grid; gap: 4px; min-width: 0; }
.r1-row h3 { margin: 0; font-size: 19px; font-weight: 500; color: var(--ink-900); }
.r1-row p { margin: 0; font-size: 15px; color: var(--steel-600); }
/* .au-go only carries its colour/arrow styling when nested in a.au-card (about.css:61-63) --
   this row is not a card, so the same look is repeated here, scoped to .r1-row. */
.r1-row .au-go { margin-top: 0; align-self: center; white-space: nowrap; font-size: 16px; font-weight: 500; color: var(--blue-700); }
.r1-row .au-go::after { content: ""; display: inline-block; width: .9em; height: 1.5px; margin-left: 10px; vertical-align: .28em; background: currentColor; transform-origin: left; transition: transform 240ms var(--ease-sweep); }
@media (hover: hover) and (pointer: fine) { .r1-row:hover .au-go::after { transform: scaleX(1.5); } }
@media (max-width: 860px) { .r1-wrap { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .r1-row { flex-direction: column; align-items: flex-start; gap: 10px; } }

/* ---------- 3. apply: glass card over an animated mesh-gradient background ---------- */
.jb-apply {
  position: relative; overflow: hidden;
  --text-muted: var(--steel-700);
  --red-600: #8A1E17;
  --border-default: var(--steel-400);
  /* --sec-pt (home.css:250, clamp(96,12vw,176) top AND bottom) is sized for a page of stacked
     sections, not for "the whole form fits on one screen" -- override just the vertical padding,
     --pad stays so the section still lines up with every other section's edges. */
  padding-block: clamp(28px, 4vw, 48px);
}
.jb-mesh-bg {
  position: absolute; inset: 0; z-index: 0;
  /* CSS fallback: paints immediately and stays if the WebGL layer never mounts (no JS,
     WebGL2 unavailable, the CDN script failing to load) -- the section is never blank.
     Same stops as the live shader colours, so the handoff is not a visible jump. */
  background: linear-gradient(155deg, #3F67D3 0%, #0052B8 55%, #0A1A4A 100%);
}

.jb-card {
  position: relative; z-index: 2; border-radius: 16px; isolation: isolate;
  width: min(100%, 720px); margin-inline: auto;
  padding: clamp(18px, 2vw, 28px);
}
/* compact row rhythm -- the shared kit's own defaults (form-grid gap 20/24, input padding 13/16,
   textarea min-height 110, components.css:153-173) are sized for Contact's long page, not for
   "the whole form fits on one screen". The reserved error slot stays at full strength: that is
   the rule that stops the form jumping while it is being filled in, worth the space it costs. */
.jb-card .form-grid { max-width: none; gap: 8px 16px; }
.jb-card .field { gap: 4px; }
.jb-card .field input, .jb-card .field select, .jb-card .field textarea { padding: 9px 13px; font-size: 15px; }
.jb-card .field label { font-size: 13px; }
.jb-card .field textarea { min-height: 44px; }
.jb-card .field .error { display: block; visibility: hidden; min-height: 15px; font-size: 12px; }
.jb-card .field .error.is-on { visibility: visible; }
.jb-card .section-head { margin-bottom: 2px; }
.jb-card .section-head h2 { font-size: clamp(20px, 2vw, 26px); }
.jb-card .section-head p { margin-top: 6px; font-size: 14px; }
.jb-card .btn-lg { min-height: 46px; padding: 0 28px; font-size: 15px; margin-top: 2px; }
.jb-card .jb-file-drop { min-height: 40px; padding: 7px 14px; }
.jb-card .jb-field-check { margin-top: 2px; }
/* select arrow + disabled state: gaps in the shared kit that contact.css patches locally and
   this page does not load contact.css, so the same two rules are repeated here. */
.jb-card .field select {
  appearance: none; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2369727B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; background-size: 18px;
}
.jb-card .field.has-error select { border-color: var(--red-600); }
.jb-card .btn:disabled { opacity: .55; pointer-events: none; }

/* consent checkbox -- the input is a sibling of its label, never nested, same as Contact's
   (contact.html: nesting makes the click fire twice and cancel out). */
.jb-field-check-row { display: flex; align-items: flex-start; gap: 12px; }
.jb-field-check label { font-size: 14px; font-weight: 400; line-height: 1.55; color: var(--ink); cursor: pointer; }
.jb-field-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; cursor: pointer; accent-color: var(--blue-500); }
.jb-field-check a { color: var(--blue-800); }

.jb-note { margin: 10px 0 0; max-width: 46em; font-size: 12px; color: var(--text-muted); }
.jb-sent { margin: 24px 0 0; max-width: 46em; padding: 18px 20px; border-radius: 10px; background: var(--green-100); color: var(--ink); font-size: 15px; line-height: 1.6; }

/* CV upload: a visually-hidden real file input plus a styled label standing in for the button, so
   the control stays keyboard-reachable (the input keeps focus, nothing is display:none). */
.jb-file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.jb-file-drop {
  display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 11px 16px;
  border-radius: 10px; border: 1.5px dashed var(--border-default); background: var(--white);
  font-size: 15px; color: var(--text-muted); cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.jb-file-cta { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--blue-100); color: var(--blue-700); font-size: 14px; font-weight: 500; }
.jb-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .jb-file-drop:hover { border-color: var(--blue-400); background: var(--blue-100); } }
.jb-file-drop:active { transform: scale(.995); }
.jb-file-input:focus-visible + .jb-file-drop { outline: 2px solid var(--focus-ring); outline-offset: 3px; border-color: var(--blue-500); }
.jb-file.is-filled .jb-file-drop { border-style: solid; border-color: var(--blue-300); }
.jb-file.is-filled .jb-file-name { color: var(--ink); font-weight: 500; }

/* Glass card: the literal Contact recipe (contact.css:293-322), same class names, same
   blur/saturate, same gating. What sits behind differs -- Contact repeats its hero photo
   full-bleed for the distortion filter to warp; here it is the mesh canvas itself. */
.glass-card { position: relative; border-radius: 16px; isolation: isolate; }
.jb-card.glass-card { background: #fff; box-shadow: 0 18px 44px rgba(10, 23, 36, .14); }
.glass-card-content { position: relative; z-index: 3; }
.glass-card-sheen { display: none; }

.is-scrubbed .jb-card.glass-card {
  background: none;
  box-shadow: 0 28px 64px rgba(10, 23, 36, .18), 0 3px 12px rgba(10, 23, 36, .07);
}
.is-scrubbed .glass-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  filter: url(#vc-glass-distortion);
}
.is-scrubbed .glass-card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit;
  /* Matched to Contact's own card exactly, value for value (contact.css:316-320): .6 at the
     light corner, .38 at the dark one, same 155deg direction. Measured against this page's own
     moving mesh, this is less forgiving than Contact's fixed, already-light photo -- the darkest
     point of the animation loop can bring some of this card's text under 4.5:1 for a few frames
     (full measurement in the session log). Kept anyway, on request, to look the same as Contact;
     the scoped darker steel-700/red/blue tokens two rules up still buy back some of that margin,
     they just cannot fully close the gap the thinner tint reopens. */
  background: linear-gradient(155deg, rgba(255, 255, 255, .6) 0%, rgba(255, 255, 255, .38) 100%);
}
.is-scrubbed .glass-card-sheen { display: block; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; }

.jb-apply .sec-tag { color: #E6EDF5; }

/* ---------- 4. closing strip ---------- */
.jb-close { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; }
.jb-close > div { flex: 1 1 340px; display: grid; gap: 10px; }
.jb-close .btn { margin-top: 0; }

@media (prefers-reduced-motion: reduce) { .jb-card, .jb-file-drop { transition: none; } }

/* ---------- text on the glass card: contrast (AA 4.5:1) ----------------------------------
   Measured on the pixels behind the text (audit 2026-11-05): intro, notes, help text and the
   Privacy links were 2.2-3.5:1 on the blue mesh. Glass and background unchanged; only the ink
   of the small texts is darker. */
.jb-apply { --text-muted: var(--ink-700); }
.jb-card .section-head p, .jb-note, .jb-card .field .help { color: var(--ink-900); }
.jb-card .form-notice a, .jb-field-check a { color: var(--ink-900); text-decoration: underline; text-underline-offset: 3px; }
.jb-card .field .error, .jb-card .jb-field-check .error { width: fit-content; padding: 0 8px; border-radius: 6px; background: rgba(255, 255, 255, .9); }

/* the blue accent word inside the glass card needs the dark blue to stay readable (same as Contact) */
.jb-card .accent-serif { color: var(--blue-800); }
