/* Public intake-test pages.
 *
 * Standalone (not the admin SPA). Same warm-neutral palette as styles.css but
 * built for a single-task focused candidate flow: landing → entry → 20-min
 * timed test → thank-you.
 */

:root {
    --bg: #fafaf8;
    --surface: #fff;
    --border: #e5e3dd;
    --text: #1a1a1a;
    --muted: #6b6862;
    --accent: #2b6cb0;
    --accent-dark: #1f4f80;
    --warn: #b08800;
    --danger: #b91c1c;
    --ok: #166534;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Dosis', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.brand {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: var(--muted);
}

/* --- Landing page (intake_apply.html) ---------------------------------- */

.intake-shell {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 96px;
}
.intake-shell.intake-done {
    text-align: center;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.brand-logo-lg {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: contain;
}

.intake-header h1 {
    font-size: 32px;
    font-weight: 600;
    margin: 8px 0 12px;
}
.intake-header .lead {
    font-size: 17px;
    color: var(--muted);
    line-height: 1.5;
    max-width: 620px;
}

.intake-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px 28px;
    margin: 24px 0;
}
.intake-card h2 {
    font-size: 18px;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.checklist li {
    padding: 6px 0 6px 24px;
    position: relative;
}
.checklist li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--ok);
    font-weight: 700;
}

.entry-form .field {
    display: block;
    margin-bottom: 14px;
}
.entry-form .field span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}
.entry-form .field em {
    font-style: normal;
    color: var(--muted);
    font-size: 12px;
}
.entry-form input,
.intake-card input,
.intake-card textarea,
.intake-card select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
}
.entry-form input:focus,
.intake-card input:focus,
.intake-card textarea:focus,
.intake-card select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}
.entry-form .hp { display: none; }    /* honeypot */

.primary-cta {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 22px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}
.primary-cta:hover { background: var(--accent-dark); }
.primary-cta:disabled { opacity: 0.5; cursor: not-allowed; }

.error-card {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #78350f;
    padding: 14px 18px;
    border-radius: 8px;
    margin: 16px 0;
}

.fineprint {
    margin-top: 18px;
    font-size: 12px;
    color: var(--muted);
}

/* --- Test page (intake_test.html) -------------------------------------- */

.intake-test-body {
    background: var(--bg);
    min-height: 100vh;
}

.test-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.test-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.test-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.test-header-titles {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}
.test-header-titles strong { font-weight: 600; }
.brand-logo {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    object-fit: contain;
}

.countdown {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 18px;
    background: #1a1a1a;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    transition: background 0.3s;
}
.countdown.warn { background: var(--warn); }
.countdown.over { background: var(--danger); }

.over-banner {
    background: #fff4ce;
    border: 1px solid #f0c674;
    color: #6b4d00;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
    font-weight: 600;
}
.submit-status {
    margin-top: 12px;
    padding: 0;
    font-size: 14px;
}
.submit-status.err {
    background: #fde7e7;
    border: 1px solid #e08383;
    color: #8a1a1a;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 600;
}
.submit-status.ok { color: #1a6b1a; }
.secondary-cta {
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #1a1a1a;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-left: 8px;
}
.q.q-error legend { color: var(--danger); }
.q.q-error { outline: 2px solid var(--danger); outline-offset: 4px; border-radius: 4px; }

.test-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
}
.test-shell.test-shell-no-product {
    grid-template-columns: 1fr;
    max-width: 880px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    align-self: start;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.product-card h2 { margin-top: 0; font-size: 22px; }
.product-logo { max-width: 200px; max-height: 80px; margin: 0 0 12px; }
.product-screenshot { max-width: 100%; border-radius: 6px; margin: 8px 0; border: 1px solid var(--border); }
.product-desc { white-space: pre-wrap; }
.product-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}
.product-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0 0 6px;
}
.product-section pre.plain {
    margin: 0;
    font-family: inherit;
    white-space: pre-wrap;
    color: var(--text);
}

.test-pane {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px 32px;
}

.preamble h2 { margin-top: 0; }
.preamble .primary-cta { margin-top: 18px; font-size: 17px; padding: 14px 28px; }

#testForm fieldset.q {
    border: none;
    padding: 0;
    margin: 0 0 32px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 28px;
}
#testForm fieldset.q:last-of-type { border-bottom: none; }
#testForm legend {
    font-size: 17px;
    font-weight: 600;
    padding: 0;
    margin-bottom: 8px;
    color: var(--text);
}
#testForm .q-num { color: var(--muted); margin-right: 4px; }
#testForm .req { color: var(--danger); margin-left: 2px; }
#testForm .q-help {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 12px;
}
#testForm input[type="text"],
#testForm input[type="url"],
#testForm input[type="number"],
#testForm input[type="email"],
#testForm textarea,
#testForm select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    font-family: inherit;
    font-size: 15px;
}
#testForm textarea { resize: vertical; min-height: 80px; }
#testForm textarea.codebox {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #fafaf8;
    min-height: 140px;
}
#testForm input:focus,
#testForm textarea:focus,
#testForm select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

/* Free-form tag input (type → press Enter → chip). One `.tags-input` host
   contains one `.tag-cat` per category (AI / marketing / role). */
#testForm .tags-input {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}
#testForm .tag-cat .sub-label {
    margin-bottom: 4px;
}
#testForm .tag-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    cursor: text;
    min-height: 42px;
}
#testForm .tag-field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}
#testForm .tag-chips {
    display: contents;
}
#testForm .tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eef4fb;
    border: 1px solid #cdddee;
    color: #143b66;
    padding: 3px 4px 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.4;
}
#testForm .tag-chip-x {
    background: transparent;
    border: 0;
    color: #143b66;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    border-radius: 999px;
}
#testForm .tag-chip-x:hover { background: #cdddee; }
#testForm .tag-entry {
    flex: 1 1 160px;
    min-width: 120px;
    border: 0 !important;
    padding: 4px 4px !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    font-size: 14px;
    color: var(--text);
}
#testForm .tag-counter-hint {
    margin: 4px 0 0;
    font-size: 12px;
}
#testForm .tag-total-counter {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Drag-and-drop value ranking. <ol> + draggable <li>; JS handles reorder
   and renumbers the prefix on every move. */
#testForm .value-rank {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#testForm .value-rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: grab;
    user-select: none;
    font-size: 15px;
}
#testForm .value-rank-item:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
#testForm .value-rank-item.dragging { opacity: 0.5; }
#testForm .value-rank-item.drop-above { box-shadow: inset 0 3px 0 var(--accent); }
#testForm .value-rank-item.drop-below { box-shadow: inset 0 -3px 0 var(--accent); }
#testForm .value-rank-num {
    flex: 0 0 22px;
    text-align: right;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
}
#testForm .value-rank-handle {
    color: var(--muted);
    cursor: grab;
    font-size: 16px;
    line-height: 1;
}
#testForm .value-rank-label { flex: 1; }

#testForm .opts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px 12px;
    margin-bottom: 8px;
}
#testForm .opt {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}
#testForm .opt input { width: auto; }
#testForm .other-input { margin-top: 6px; }

#testForm table.rows {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}
#testForm table.rows th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 6px 8px 6px 0;
    font-weight: 500;
}
#testForm table.rows td {
    padding: 4px 6px 4px 0;
    vertical-align: top;
}
#testForm table.rows td:last-child { padding-right: 0; }

#testForm .sub-field { margin-bottom: 14px; }
#testForm .sub-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}
#testForm .file-input {
    border: 1px dashed var(--border);
    padding: 12px;
    width: 100%;
    background: var(--bg);
    border-radius: 6px;
    cursor: pointer;
}
#testForm .upload-status {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}
#testForm .upload-status .ok { color: var(--ok); }
#testForm .upload-status .err { color: var(--danger); }

.form-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
}

@media (max-width: 880px) {
    .test-shell { grid-template-columns: 1fr; }
    .product-card { position: static; max-height: none; }
}

/* v3: IP/consent click-wrap, live word counters, begin-button error */

.consent-block {
    margin: 18px 0 4px;
    padding: 14px 16px;
    background: var(--surface-alt, #f7f5ef);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    cursor: pointer;
}
.consent-label input[type="checkbox"] {
    margin-top: 3px;
    flex: 0 0 auto;
}

#beginError {
    margin-top: 10px;
    font-size: 13px;
    color: var(--danger);
}

.word-counter {
    display: inline-block;
    margin: 6px 0 2px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.word-counter.low { background: #fef3c7; color: #92400e; }  /* amber — minimum not met yet */
.word-counter.ok  { background: #dcfce7; color: #166534; }  /* green — minimum reached */

#testForm .sub-field .q-help {
    font-size: 12px;
    margin: 4px 0 6px;
}
#testForm .sub-label .muted {
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}

/* "Bring AI, bring yourself" notice — top of every intake test */
.ai-ingenuity-banner {
    background: linear-gradient(135deg, #eef4fb 0%, #f7faff 100%);
    border: 1px solid #cfe0f2;
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0 0 24px;
}
.ai-ingenuity-banner strong { color: var(--accent-dark); }
.ai-ingenuity-banner > strong {
    display: block;
    font-size: 16px;
    margin-bottom: 6px;
}
.ai-ingenuity-banner p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #2d3748;
}
