/* Jobster brand theme on top of Pico CSS v2. No inline styles anywhere (CSP: style-src 'self').
   Tokens follow the JOBSTER GO brand kit (meta_middleware/jobster-go-brand): Rich Black #15171D, English Violet
   #745681, Lavender #E3DCEB, Baby Powder #FAEFE0, Coquelicot #FF4C24 (CTA / GO mark only, never a background). */

/* ─── PP Neue Montreal (display) ─── Inter is the brand body face but the kit ships no usable web files for it,
   so body text uses the system stack the sibling app effectively renders with. */
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --jg-coquelicot: #FF4C24; --jg-coquelicot-light: #FF6437; --jg-coquelicot-dark: #F02106;
  --jg-black: #15171D; --jg-violet: #745681; --jg-lavender: #E3DCEB; --jg-powder: #FAEFE0; --jg-white: #FFFFFF;
  --jg-border: #E5E3DF; --jg-bg-main: #F5F4F2; --jg-text-muted: #6B6E78;
  --jg-status-success: #7BC94A; --jg-status-warning: #FFA305; --jg-status-error: #FC1E1E;
  --jg-font-display: 'PP Neue Montreal', Arial, sans-serif;
  --jg-font-body: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --jg-radius-md: 8px; --jg-radius-lg: 12px;
  --jg-shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
  --jg-ease: cubic-bezier(0.4, 0, 0.2, 1); --jg-duration: 200ms;
}

/* Pico tokens. Same selector Pico uses for its light theme, declared later, so these win. */
[data-theme=light], :root:not([data-theme=dark]) {
  --pico-font-size: 95%;
  --pico-font-family-sans-serif: var(--jg-font-body);
  --pico-font-family: var(--jg-font-body);
  --pico-border-radius: var(--jg-radius-md);
  --pico-background-color: var(--jg-bg-main);
  --pico-color: var(--jg-black);
  --pico-h1-color: var(--jg-black); --pico-h2-color: var(--jg-black); --pico-h3-color: var(--jg-black);
  --pico-h4-color: var(--jg-black); --pico-h5-color: var(--jg-black); --pico-h6-color: var(--jg-black);
  --pico-muted-color: var(--jg-text-muted);
  --pico-muted-border-color: var(--jg-border);
  --pico-primary: var(--jg-coquelicot);
  --pico-primary-background: var(--jg-coquelicot);
  --pico-primary-border: var(--jg-coquelicot);
  --pico-primary-underline: rgba(255, 76, 36, 0.5);
  --pico-primary-hover: var(--jg-coquelicot-dark);
  --pico-primary-hover-background: var(--jg-coquelicot-light);
  --pico-primary-hover-border: var(--jg-coquelicot-light);
  --pico-primary-focus: rgba(255, 76, 36, 0.25);
  --pico-primary-inverse: var(--jg-white);
  --pico-secondary: var(--jg-violet);
  --pico-secondary-background: var(--jg-violet);
  --pico-secondary-border: var(--jg-violet);
  --pico-secondary-hover: #5E4569;
  --pico-secondary-hover-background: #5E4569;
  --pico-secondary-hover-border: #5E4569;
  --pico-secondary-focus: rgba(116, 86, 129, 0.25);
  --pico-secondary-inverse: var(--jg-white);
  --pico-card-background-color: var(--jg-white);
  --pico-card-border-color: var(--jg-border);
  --pico-card-box-shadow: var(--jg-shadow-card);
  --pico-card-sectioning-background-color: #FAFAF8;
  --pico-form-element-background-color: var(--jg-white);
  --pico-form-element-border-color: var(--jg-border);
  --pico-form-element-active-border-color: var(--jg-coquelicot);
  --pico-form-element-focus-color: rgba(255, 76, 36, 0.12);
  --pico-form-element-placeholder-color: #9A9DA6;
  --pico-table-border-color: var(--jg-border);
  --pico-table-row-stripped-background-color: #FAFAF8;
  --pico-code-background-color: var(--jg-powder);
  --pico-mark-background-color: var(--jg-lavender);
}

body { -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-family: var(--jg-font-display); font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }
h1 { font-size: 2rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.2rem; }
/* Links are violet, not coquelicot: the brand reserves coquelicot for CTAs. Buttons keep Pico's primary. */
a:not([role=button]) { --pico-color: var(--jg-violet); --pico-underline: transparent; }
a:not([role=button]):is(:hover, :active, :focus) { --pico-color: var(--jg-black); --pico-underline: var(--jg-violet); }
button:not(.secondary):not(.outline):not(.link), [role=button]:not(.secondary):not(.outline), input[type=submit] {
  font-weight: 600; transition: background-color var(--jg-duration) var(--jg-ease), transform var(--jg-duration) var(--jg-ease), box-shadow var(--jg-duration) var(--jg-ease);
}
button:not(.secondary):not(.outline):not(.link):hover, [role=button]:not(.secondary):not(.outline):hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255, 76, 36, 0.35); }
button:not(.secondary):not(.outline):not(.link):active { transform: translateY(0); box-shadow: none; }
article { border: 1px solid var(--jg-border); border-radius: var(--jg-radius-lg); }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--jg-text-muted); font-weight: 600; }

/* ─── Header: Rich Black bar with the white lockup ─── */
body > header.ats-nav { background: var(--jg-black); color: var(--jg-white); border-bottom: 1px solid rgba(255, 255, 255, 0.06); margin-bottom: 1.5rem; }
.ats-nav nav { padding: .45rem 0; }
.ats-nav nav ul:first-child li { padding-left: 0; }
.ats-nav .brand { display: inline-flex; align-items: center; text-decoration: none; --pico-color: var(--jg-white); }
.ats-nav .brand img { display: block; height: 22px; width: auto; }
.ats-nav .brand-text { font-family: var(--jg-font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.3px; }
.ats-nav .role { font-size: .8rem; color: rgba(255, 255, 255, 0.55); margin-left: .75rem; }
.ats-nav a:not(.brand) { --pico-color: rgba(255, 255, 255, 0.78); --pico-underline: transparent; font-weight: 500; font-size: .92rem; }
.ats-nav a:not(.brand):is(:hover, :focus) { --pico-color: var(--jg-white); }
.ats-nav form { margin: 0; display: inline; }
.ats-nav button.link { background: none; border: 0; color: rgba(255, 255, 255, 0.78); padding: 0; cursor: pointer; font-weight: 500; font-size: .92rem; width: auto; margin: 0; }
.ats-nav button.link:hover { color: var(--jg-white); }

/* ─── Auth pages (login, reset, invitation, MFA challenge): the sibling app's gradient and card ─── */
body.auth { background: linear-gradient(135deg, #15171D 0%, #745681 60%, #FF4C24 100%); min-height: 100vh; }
body.auth > main { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding-top: 2rem; padding-bottom: 2rem; }
.auth-logo { margin-bottom: 1.5rem; }
.auth-logo img { display: block; height: 28px; width: auto; }
.auth-card { background: var(--jg-white); border: 0; border-radius: var(--jg-radius-lg); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25); width: 100%; max-width: 440px; margin: 0; padding: 2.25rem 2.5rem; }
.auth-card h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.auth-card button[type=submit]:not(.secondary) { width: 100%; }
.auth-card .flash { margin-bottom: 1rem; }
body.auth > main > .flash { width: 100%; max-width: 440px; }

/* ─── Candidate portal: the employer's name in the bar, Jobster in the footer ─── */
.portal-footer { display: flex; justify-content: center; align-items: center; gap: .5rem; padding: 2.5rem 0 2rem; color: var(--jg-text-muted); font-size: .8rem; }
.portal-footer img { display: inline-block; height: 13px; width: auto; vertical-align: middle; }
.portal-footer a { display: inline-flex; align-items: center; }

/* ─── Shared UI ─── */
.banner-inspect { background: #A11212; color: #fff; padding: .6rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.banner-inspect form { margin: 0; }
.banner-inspect button { margin: 0; padding: .2rem .8rem; background: #fff; color: #A11212; border: 0; width: auto; }
.flash { padding: .6rem 1rem; border-radius: var(--pico-border-radius); margin-bottom: 1rem; border: 1px solid transparent; }
.flash-status { background: #E8F5DE; color: #2F6B0F; border-color: #CBE7B4; }
.flash-error { background: #FDE3E3; color: #A11212; border-color: #F7BFBF; }
.flash ul { margin: 0; padding-left: 1.1rem; }
.secret-reveal { background: var(--jg-powder); border: 1px solid var(--jg-status-warning); padding: .8rem 1rem; border-radius: var(--pico-border-radius); margin-bottom: 1rem; word-break: break-all; }
.secret-reveal code { font-size: 1rem; user-select: all; background: var(--jg-white); }
.muted { color: var(--pico-muted-color); }
.small { font-size: .85rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; background: var(--jg-lavender); color: #4B3A58; white-space: nowrap; letter-spacing: .01em; }
.badge-published, .badge-delivered, .badge-clean, .badge-hired { background: #E8F5DE; color: #2F6B0F; }
.badge-draft, .badge-queued, .badge-sent { background: #ECEBE8; color: #4A4D56; }
.badge-closed, .badge-bounced, .badge-complained, .badge-infected, .badge-rejected { background: #FDE3E3; color: #A11212; }
.badge-meta { background: var(--jg-lavender); color: #4B3A58; }
.badge-career { background: var(--jg-powder); color: #7A4A1B; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.stats article { margin: 0; padding: .9rem 1rem; text-align: left; }
.stats .n { font-family: var(--jg-font-display); font-size: 1.8rem; font-weight: 700; display: block; color: var(--jg-coquelicot); letter-spacing: -0.5px; line-height: 1.1; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.toolbar form, .toolbar select { margin: 0; }
.toolbar .spacer { flex: 1; }
.btn-sm { padding: .25rem .7rem; font-size: .85rem; margin: 0; width: auto; display: inline-block; }
.inline-form { display: inline; margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions select { width: auto; margin: 0; flex: 1 1 160px; }
table.compact td, table.compact th { padding: .4rem .5rem; font-size: .9rem; vertical-align: top; }
/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: .6rem; overflow-x: auto; align-items: start; }
.kanban .col { background: #FAFAF8; border: 1px solid var(--jg-border); border-radius: var(--pico-border-radius); padding: .5rem; min-height: 60vh; }
.kanban .col.drag-over { outline: 2px dashed var(--jg-coquelicot); }
.kanban .col h4 { font-family: var(--jg-font-body); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--jg-text-muted); margin: .2rem .2rem .6rem; display: flex; justify-content: space-between; }
.card-candidate { background: var(--jg-white); border: 1px solid var(--jg-border); border-radius: var(--pico-border-radius); padding: .55rem .65rem; margin-bottom: .5rem; cursor: grab; font-size: .88rem; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); transition: box-shadow var(--jg-duration) var(--jg-ease); }
.card-candidate:hover { box-shadow: var(--jg-shadow-card); }
.card-candidate.dragging { opacity: .5; }
.card-candidate .name { font-weight: 600; display: block; text-decoration: none; }
.card-candidate .meta { color: var(--pico-muted-color); font-size: .78rem; display: flex; justify-content: space-between; gap: .4rem; margin-top: .25rem; }
.card-candidate input[type=checkbox] { margin: 0 .3rem 0 0; float: right; }
.stars { letter-spacing: .05em; color: var(--jg-status-warning); }
/* Drawer page */
.drawer { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .drawer { grid-template-columns: 1fr; } .kanban { grid-template-columns: repeat(6, 220px); } }
.qa dt { font-weight: 600; margin-top: .5rem; }
.qa dd { margin: 0 0 .25rem; }
.timeline li { margin-bottom: .5rem; }
.rating-form button { background: none; border: 0; font-size: 1.3rem; padding: 0 .1rem; color: var(--jg-status-warning); cursor: pointer; width: auto; margin: 0; box-shadow: none; }
.rating-form button:hover { transform: none; box-shadow: none; }
/* Modal */
dialog.modal { max-width: 720px; width: 95%; }
dialog.modal article { border-radius: var(--jg-radius-lg); }
dialog.modal textarea { min-height: 260px; font-family: var(--pico-font-family-monospace); font-size: .9rem; }
.hidden { display: none !important; }
/* Portal */
.portal-main { max-width: 820px; margin: 0 auto; }
.portal-desc h2, .portal-desc h3 { margin-top: 1.2rem; }
.field-error { color: #A11212; font-size: .85rem; margin-top: -.6rem; margin-bottom: .8rem; }
.vacancy-list { list-style: none; padding: 0; }
.vacancy-list li { list-style: none; }
.vacancy-list li { background: var(--jg-white); border: 1px solid var(--jg-border); border-radius: var(--pico-border-radius); padding: .8rem 1rem; margin-bottom: .6rem; }
