/* ==========================================================================
   MS Recruiter — design system
   Palette sampled directly from the Media Solutions monogram:
     brick   #871622  — the M's exact color
     ink     #171310  — near-black, matched to the wordmark's weight
   Everything else is derived from those two.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    /* brand */
    --brick: #871622;
    --brick-mid: #69111A;
    --brick-deep: #3A0A0F;
    --brick-light: #9E424C;
    --brick-mist: #F6EEEF;

    /* neutrals (warm-tinted, echo the paper the logo would print on) */
    --ink: #171310;
    --paper: #FBFAF8;
    --paper-2: #F1ECE9;
    --line: #E3DBD7;
    --muted: #766E69;

    /* status — deliberately different hues from brick, so "brand" and
       "state" are never visually confused */
    --success: #2F6B4F;
    --success-bg: #E8F1EC;
    --warn: #A6491C;
    --warn-bg: #F8ECE3;

    /* type */
    --font-display: 'Big Shoulders Display', sans-serif;
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* signature geometry — corners are cut, never rounded, echoing the
       monogram's angular strokes. structural containers get the cut;
       status pills stay fully round, so shape itself tells you which is which. */
    --notch: 16px;
    --notch-sm: 10px;

    --shadow: 0 1px 2px rgba(23,19,16,0.06), 0 8px 24px -12px rgba(23,19,16,0.18);
    --shadow-lg: 0 4px 8px rgba(23,19,16,0.08), 0 24px 48px -16px rgba(23,19,16,0.28);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.01em;
    margin: 0;
    text-transform: uppercase;
}

a { color: var(--brick); }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* notch utility — a diagonal cut on the top-left and bottom-right corners.
   Applied to structural containers only (cards, panels, buttons, inputs);
   status pills and checkboxes deliberately stay round for contrast. */
.notch {
    clip-path: polygon(
        var(--notch) 0, 100% 0, 100% calc(100% - var(--notch)),
        calc(100% - var(--notch)) 100%, 0 100%, 0 var(--notch)
    );
}
.notch-sm {
    clip-path: polygon(
        var(--notch-sm) 0, 100% 0, 100% calc(100% - var(--notch-sm)),
        calc(100% - var(--notch-sm)) 100%, 0 100%, 0 var(--notch-sm)
    );
}

/* ==========================================================================
   Focus / motion baseline
   ========================================================================== */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--brick);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ==========================================================================
   App shell — header, layout
   ========================================================================== */
.app-shell { max-width: 900px; margin: 0 auto; padding: 28px 20px 64px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 3px solid var(--ink);
}
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup img { height: 38px; width: auto; display: block; }
.brand-lockup .brand-text { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.15; }
.brand-lockup .brand-text small { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 10px; letter-spacing: 0.16em; color: var(--brick); text-transform: uppercase; margin-top: 2px; }

.session-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 14px; letter-spacing: 0.02em; }
.session-meta strong { color: var(--ink); font-weight: 600; }
.session-meta a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; transition: color .15s, border-color .15s; }
.session-meta a:hover { color: var(--brick); border-color: var(--brick); }

/* ==========================================================================
   Section blocks
   ========================================================================== */
.panel {
    background: #fff;
    border: 1px solid var(--line);
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.panel > h2 {
    font-size: 15px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.panel > h2 .eyebrow { text-transform: none; font-weight: 500; }

/* ==========================================================================
   Region — segmented control
   ========================================================================== */
.segmented { display: inline-flex; gap: 2px; background: var(--ink); padding: 2px; }
.segmented label {
    position: relative;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: var(--ink);
    padding: 10px 26px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--brick); color: #fff; }
.segmented label:hover { background: var(--brick-mid); color: #fff; }

/* ==========================================================================
   Position list
   ========================================================================== */
ul.positions { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
ul.positions li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    font-weight: 500;
    transition: padding-left .15s, color .15s;
}
ul.positions li::before {
    content: '';
    width: 8px; height: 8px;
    background: var(--brick);
    display: inline-block;
    margin-right: 12px;
    flex-shrink: 0;
    clip-path: polygon(30% 0, 100% 0, 100% 70%, 70% 100%, 0 100%, 0 30%);
}
ul.positions li::after { content: '→'; color: var(--muted); font-family: var(--font-mono); transition: transform .15s, color .15s; }
ul.positions li:hover { padding-left: 10px; color: var(--brick); background: var(--brick-mist); }
ul.positions li:hover::after { transform: translateX(3px); color: var(--brick); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 12px 22px;
    margin: 4px 8px 0 0;
    background: var(--brick);
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn:hover { background: var(--brick-mid); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }

/* ==========================================================================
   Response / results area
   ========================================================================== */
#response-container { padding: 24px; }
#response-container h2 { font-size: 20px; margin-bottom: 6px; }
#response-container h3 { font-family: var(--font-body); text-transform: none; font-weight: 600; font-size: 14px; color: var(--muted); margin: 18px 0 10px; letter-spacing: 0; }

.select-all-row {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--muted);
    padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    margin: 14px 0;
}

.candidate-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--paper);
    margin-bottom: 10px;
}
.candidate-row .name { font-family: var(--font-display); font-weight: 700; font-size: 17px; text-transform: none; letter-spacing: 0; margin-bottom: 6px; }
.candidate-row .data-block { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); display: grid; gap: 3px; }
.candidate-row .data-block .field-label { color: var(--muted); display: inline-block; width: 60px; }
.candidate-row .data-block .missing { color: var(--warn); }
.candidate-row .source { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 8px; }

/* custom checkbox — round, deliberately distinct from the notched
   structural shapes, so "select" reads differently from "container" */
input.candidate-checkbox, #select-all-candidates {
    appearance: none; -webkit-appearance: none;
    width: 20px; height: 20px; min-width: 20px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    margin-top: 2px;
}
input.candidate-checkbox:checked, #select-all-candidates:checked { background: var(--brick); border-color: var(--brick); }
input.candidate-checkbox:checked::after, #select-all-candidates:checked::after {
    content: '';
    position: absolute; left: 6px; top: 2px;
    width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 999px;
    background: var(--success-bg); color: var(--success);
}
.chip.warn { background: var(--warn-bg); color: var(--warn); }

.failure-list {
    font-size: 13px; color: var(--warn);
    background: var(--warn-bg);
    border-left: 3px solid var(--warn);
    padding: 12px 16px;
    margin: 14px 0;
}
.failure-list ul { margin: 8px 0 0; padding-left: 18px; }
.failure-list strong { font-family: var(--font-mono); text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }

.result-row { font-family: var(--font-mono); font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 8px; }
.result-row.ok { color: var(--success); }
.result-row.err { color: var(--warn); }
.results-block h4 { font-family: var(--font-body); text-transform: none; font-weight: 600; font-size: 13px; margin: 16px 0 8px; letter-spacing: 0; }

.hidden { display: none !important; }
.error-msg { color: var(--warn); font-weight: 500; }

/* ==========================================================================
   Login — split panel
   ========================================================================== */
.login-shell { min-height: 100vh; display: flex; }
.login-brand {
    flex: 1 1 45%;
    background:
        radial-gradient(circle at 15% 85%, rgba(158,66,76,0.35), transparent 55%),
        linear-gradient(155deg, var(--brick) 0%, var(--brick-deep) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 48px;
    min-height: 320px;
}
.login-brand .ghost-m {
    position: absolute;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 62vh;
    line-height: 0.8;
    color: rgba(255,255,255,0.06);
    right: -8vh;
    bottom: -18vh;
    user-select: none;
    pointer-events: none;
}
.login-brand .wordmark { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; position: relative; z-index: 1; }
.login-brand .tagline { position: relative; z-index: 1; max-width: 320px; }
.login-brand .tagline .eyebrow { color: rgba(255,255,255,0.65); }
.login-brand .tagline p { font-family: var(--font-display); font-weight: 700; font-size: 28px; text-transform: uppercase; line-height: 1.08; margin: 8px 0 0; letter-spacing: 0.01em; }

.login-form-side { flex: 1 1 55%; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--paper); }
.login-form-side .login-inner { width: 100%; max-width: 340px; }
.login-form-side .login-inner img { height: 34px; margin-bottom: 28px; }
.login-form-side h1 { font-size: 26px; margin-bottom: 4px; }
.login-form-side .sub { font-size: 13px; color: var(--muted); margin-bottom: 28px; }

form.login-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field input {
    font-family: var(--font-body);
    font-size: 15px;
    padding: 10px 2px;
    border: none;
    border-bottom: 2px solid var(--line);
    background: transparent;
    color: var(--ink);
    transition: border-color .15s;
}
.field input:focus { border-color: var(--brick); outline: none; }
form.login-form .btn { justify-content: center; margin-top: 6px; width: 100%; }

@media (max-width: 760px) {
    .login-shell { flex-direction: column; }
    .login-brand { min-height: 220px; padding: 32px; }
    .login-brand .ghost-m { font-size: 40vh; }
    .login-form-side { padding: 32px 20px 48px; }
}

/* ==========================================================================
   History page
   ========================================================================== */
table.history { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12.5px; }
table.history th {
    text-align: left; padding: 10px 12px;
    background: var(--ink); color: #fff;
    font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; font-size: 10.5px;
}
table.history td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.history tr:nth-child(even) td { background: var(--paper-2); }
table.history td a { font-weight: 600; }

@media (max-width: 640px) {
    table.history { display: block; overflow-x: auto; white-space: nowrap; }
}
