/* JobDesk 4.0 public look: rounded, calm, one step at a time.
   Deliberately different from 3.0 (bright blue, dark bar, system font, square-ish cards).
   Everything is scoped under .v4 so the admin screens keep their own styles. */
@font-face {
  font-family: 'Nunito';
  src: url('/static/fonts/nunito-var.woff2') format('woff2-variations'), url('/static/fonts/nunito-var.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

.v4 {
  --bg: #f1f0fa;
  --bg-deep: #e6e4f6;
  --panel: #ffffff;
  --indigo: #2e2a6b;
  --indigo-2: #463fa0;
  --indigo-soft: #e9e7fb;
  --sun: #f5b700;
  --sun-soft: #fff4cc;
  --text: #24223f;
  --muted: #625f80;
  --line: #d9d6ee;
  --danger: #b4233c;
  --ok: #1d7a55;
  --r-xl: 28px;
  --r-lg: 18px;
  --r-md: 12px;
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
}
body.v4 {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
  background: var(--bg);
  background-image: radial-gradient(900px 500px at 85% -10%, var(--bg-deep), transparent 70%);
}
/* background picture (built-in drawing or the company's own photo, softened so text stays readable) */
body.v4.has-bg {
  background-image: linear-gradient(rgba(241, 240, 250, .35), rgba(241, 240, 250, .35)), var(--bg-image);
  background-size: cover; background-position: center; background-attachment: fixed;
}
body.v4.has-bg .foot { color: var(--indigo); font-weight: 700; }
.v4 [hidden] { display: none !important; }
.v4 a { color: var(--indigo-2); font-weight: 700; text-underline-offset: 3px; }
.v4 a:hover { color: var(--indigo); }
.v4 :focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* ---------- top bar ---------- */
.v4 .bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; max-width: 1080px; width: 100%; box-sizing: border-box; margin: 0 auto; padding: 22px 24px 0; }
.v4 .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.25rem; color: var(--indigo); text-decoration: none; }
.v4 .brand img { width: 30px; height: 30px; border-radius: 9px; }
.v4 .bar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.v4 .bar nav a { color: var(--indigo); text-decoration: none; padding: 8px 16px; border-radius: 999px; font-weight: 750; }
.v4 .bar nav a:hover { background: var(--indigo-soft); }
.v4 .bar nav a[aria-current="page"] { background: var(--indigo); color: #fff; }

.v4 .page { flex: 1; max-width: 1080px; width: 100%; box-sizing: border-box; margin: 0 auto; padding: 40px 24px 64px; }
.v4 .foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 0 24px 26px; }

/* ---------- headings ---------- */
.v4 .hello { text-align: center; max-width: 640px; margin: 0 auto 28px; }
.v4 .hello h1 { text-wrap: balance; font-weight: 900; font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 12px; color: var(--indigo); }
.v4 .hello p { margin: 0; color: var(--muted); font-size: 1.1rem; }

/* ---------- panels ---------- */
.v4 .panel { background: var(--panel); border-radius: var(--r-xl); box-shadow: 0 2px 0 var(--line), 0 24px 48px -32px rgba(46, 42, 107, .35); }
.v4 .wizard { max-width: 640px; margin: 0 auto; padding: 26px 30px 26px; }
.v4 .narrow { max-width: 440px; margin: 0 auto; padding: 32px 32px 28px; }
.v4 .panel h2 { font-weight: 900; font-size: 1.6rem; margin: 0 0 18px; color: var(--indigo); }
.v4 .below { text-align: center; color: var(--muted); margin: 22px auto 0; max-width: 640px; }
.v4 .below p { margin: 6px 0; }

/* ---------- single request form (same layout as 3.0, 4.0 styling) ---------- */
.v4 .formcard { max-width: 640px; margin: 0 auto; padding: 30px 32px 26px; }
.v4 .formcard h1 { font-weight: 900; font-size: clamp(1.7rem, 3.4vw, 2.1rem); line-height: 1.15; color: var(--indigo); margin: 0 0 8px; }
.v4 .formcard .intro { color: var(--muted); margin: 0 0 20px; }
.v4 .formcard h3 { font-weight: 900; font-size: 1.12rem; color: var(--indigo); margin: 22px 0 12px; padding-top: 18px; border-top: 2px solid var(--bg); }
.v4 .formcard form > h3:first-child { margin-top: 4px; padding-top: 0; border-top: 0; }
.v4 label.fld select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 44px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%232e2a6b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
}

/* ---------- stepper ---------- */
.v4 .steps { display: flex; gap: 8px; margin: 0 0 26px; padding: 0; list-style: none; }
.v4 .steps li { flex: 1; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); font-weight: 750; font-size: .95rem; }
.v4 .steps li b { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--muted); font-size: .95rem; box-shadow: inset 0 0 0 2px var(--line); }
.v4 .steps li.on { background: var(--indigo); color: #fff; }
.v4 .steps li.on b { background: var(--sun); color: var(--indigo); box-shadow: none; }
.v4 .steps li.done { background: var(--indigo-soft); color: var(--indigo); }
.v4 .steps li.done b { background: var(--indigo); color: #fff; box-shadow: none; }
.v4 .wiz:not(.wiz-on) .steps { display: none; }  /* without JavaScript all parts show at once */

.v4 .step > h3 { font-weight: 900; font-size: 1.25rem; margin: 0 0 16px; color: var(--indigo); }
.v4 .wiz.wiz-on .step { display: none; }
.v4 .wiz.wiz-on .step.current { display: block; animation: stepin .22s ease-out; }
.v4 .wiz:not(.wiz-on) .step + .step { margin-top: 26px; padding-top: 22px; border-top: 2px dashed var(--line); }
@keyframes stepin { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

/* ---------- fields ---------- */
.v4 .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.v4 .fld { display: block; margin: 0 0 16px; font-weight: 750; font-size: .93rem; color: var(--text); }
.v4 .fld .hint { font-weight: 500; color: var(--muted); }
.v4 .fld input, .v4 .fld select, .v4 .fld textarea, .v4 .hc-input, .v4 .copyline input {
  display: block; width: 100%; box-sizing: border-box; margin-top: 6px; padding: 12px 16px;
  border: 2px solid var(--line); border-radius: var(--r-md); background: #fff;
  font: inherit; font-weight: 600; font-size: 1rem; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.v4 .fld textarea { resize: vertical; min-height: 120px; }
.v4 .fld input:focus, .v4 .fld textarea:focus, .v4 .fld select:focus, .v4 .hc-input:focus { outline: none; border-color: var(--indigo-2); box-shadow: 0 0 0 4px var(--indigo-soft); }
.v4 .fld input::placeholder, .v4 .fld textarea::placeholder { color: #a6a3c2; font-weight: 500; }
.v4 .fld.bad input { border-color: var(--danger); }
.v4 .note { color: var(--muted); font-size: .9rem; margin: -6px 0 16px; }

/* choice chips (type of work, urgency) */
.v4 .chips { border: 0; margin: 0 0 18px; padding: 0; }
.v4 .chips legend { font-weight: 750; font-size: .93rem; margin-bottom: 8px; padding: 0; }
.v4 .chips .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.v4 .chip { position: relative; cursor: pointer; }
.v4 .chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.v4 .chip span { display: inline-flex; flex-direction: column; padding: 9px 16px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-weight: 750; color: var(--text); transition: background .15s, border-color .15s, color .15s; }
.v4 .chip span small { font-weight: 600; color: var(--muted); font-size: .8rem; line-height: 1.2; }
.v4 .chip:hover span { border-color: var(--indigo-2); }
.v4 .chip input:checked + span { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.v4 .chip input:checked + span small { color: #d9d6ff; }
.v4 .chip input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }

/* review (step 3) */
.v4 .review { background: var(--bg); border-radius: var(--r-lg); padding: 14px 18px; margin: 0 0 18px; }
.v4 .review dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; }
.v4 .review dt { color: var(--muted); font-weight: 700; }
.v4 .review dd { margin: 0; font-weight: 700; word-break: break-word; }
.v4 .review .edit { display: inline-block; margin-top: 10px; font-size: .9rem; background: none; border: 0; padding: 0; color: var(--indigo-2); font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* human check */
.v4 .hc { border: 0; background: var(--sun-soft); border-radius: var(--r-lg); padding: 14px 18px 4px; margin: 0 0 18px; }
.v4 .hc legend { float: left; width: 100%; font-weight: 900; color: var(--indigo); padding: 0; margin-bottom: 8px; }
.v4 .hc-row { clear: both; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.v4 .hc-row img { border-radius: var(--r-md); background: #fff; max-width: 100%; height: auto; }
.v4 .hc label { display: block; font-weight: 750; font-size: .93rem; margin-bottom: 12px; }
.v4 .hc-input { max-width: 240px; letter-spacing: .3em; text-transform: uppercase; font-weight: 900; font-size: 1.15rem; }

/* ---------- buttons ---------- */
.v4 .nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.v4 .nav .spacer { flex: 1; }
.v4 .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 850; font-size: 1rem; cursor: pointer; padding: 12px 24px; border-radius: 999px; border: 2px solid var(--indigo); background: #fff; color: var(--indigo); text-decoration: none; transition: background .15s, transform .1s; }
.v4 .btn:hover { background: var(--indigo-soft); color: var(--indigo); }
.v4 .btn:active { transform: translateY(1px); }
.v4 .btn.primary { background: var(--indigo); color: #fff; }
.v4 .btn.primary:hover { background: var(--indigo-2); border-color: var(--indigo-2); color: #fff; }
.v4 .btn.sun { background: var(--sun); border-color: var(--sun); color: var(--indigo); }
.v4 .btn.sun:hover { background: #ffc61f; border-color: #ffc61f; }
.v4 .btn.small { padding: 7px 14px; font-size: .9rem; }
.v4 .btn.wide { width: 100%; }
.v4 .wiz:not(.wiz-on) [data-wiz-next], .v4 .wiz:not(.wiz-on) [data-wiz-back] { display: none; }
.v4 .wiz.wiz-on .send-only { display: none; }
.v4 .wiz.wiz-on.at-last .send-only { display: inline-flex; }

.v4 .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* messages */
.v4 .flash { margin: 0 0 18px; padding: 12px 16px; border-radius: var(--r-md); font-weight: 750; }
.v4 .flash.error { background: #fde8ec; color: var(--danger); }
.v4 .flash.ok { background: #e3f5ec; color: var(--ok); }
.v4 .sub { margin: 16px 0 0; color: var(--muted); text-align: center; font-size: .95rem; }

/* ---------- sent ---------- */
.v4 .sent { max-width: 600px; margin: 0 auto; padding: 34px 32px 30px; text-align: center; }
.v4 .badge { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; }
.v4 .badge svg { width: 46px; height: 46px; }
.v4 .badge path { fill: none; stroke: var(--indigo); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: tick .5s .2s ease-out forwards; }
@keyframes tick { to { stroke-dashoffset: 0; } }
.v4 .sent h1 { font-weight: 900; font-size: 1.9rem; line-height: 1.15; color: var(--indigo); margin: 0 0 10px; text-wrap: balance; }
.v4 .ref { display: inline-block; margin: 10px 0 14px; padding: 8px 22px; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo); font-weight: 900; font-size: 1.6rem; letter-spacing: .03em; }
.v4 .copyline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 0; }
.v4 .copyline input { flex: 1; min-width: 220px; margin: 0; font-size: .92rem; background: var(--bg); }
.v4 .next { text-align: left; margin: 10px 0 0; padding: 18px 20px; border-radius: var(--r-lg); background: var(--bg); list-style: none; counter-reset: s; }
.v4 .next-title { font-weight: 900; color: var(--indigo); margin: 26px 0 0; text-align: left; font-size: 1.05rem; }
.v4 .next li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; align-items: center; padding: 5px 0; font-weight: 750; }
.v4 .next li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--indigo); font-weight: 900; font-size: .85rem; box-shadow: inset 0 0 0 2px var(--line); }
.v4 .next li:first-child::before { background: var(--indigo); color: #fff; box-shadow: none; }

/* survey stars */
.v4 .q { margin: 0 0 20px; }
.v4 .qlabel { font-weight: 800; margin-bottom: 6px; }
.v4 .stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.v4 .stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.v4 .stars label { font-size: 2.2rem; color: #d3d0ea; cursor: pointer; line-height: 1; }
.v4 .stars input:checked ~ label, .v4 .stars label:hover, .v4 .stars label:hover ~ label { color: var(--sun); }
.v4 .stars input:focus-visible + label { outline: 3px solid var(--indigo); outline-offset: 2px; border-radius: 6px; }

/* inside the logged-in app (client request form) */
.v4-inapp { margin-top: 6px; }
.v4-inapp .wizard { box-shadow: 0 1px 0 var(--line), 0 18px 40px -30px rgba(46, 42, 107, .4); }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .v4 { font-size: 16px; }
  body.v4.has-bg { background-attachment: scroll; }
  .v4 .page { padding: 24px 14px 48px; }
  .v4 .bar { padding: 14px 14px 0; gap: 8px; }
  .v4 .brand { font-size: 1.05rem; }
  .v4 .brand img { width: 26px; height: 26px; }
  .v4 .bar nav a { padding: 6px 11px; font-size: .9rem; }
  .v4 .bar nav a[href="/register"] { display: none; }
  .v4 .wizard, .v4 .narrow, .v4 .sent, .v4 .formcard { padding: 22px 18px; border-radius: 22px; }
  .v4 .row2 { grid-template-columns: 1fr; }
  .v4 .steps li { padding: 6px; justify-content: center; white-space: nowrap; }
  .v4 .steps li.on { flex: 2.4; justify-content: flex-start; }
  .v4 .steps li span { display: none; }
  .v4 .steps li.on span { display: inline; }
  .v4 .review dl { grid-template-columns: 1fr; gap: 0 0; }
  .v4 .review dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .v4 .wiz.wiz-on .step.current { animation: none; } .v4 .badge path { animation: none; stroke-dashoffset: 0; } }
