/*
    Candidate portal styling.

    Written mobile-first and kept deliberately plain. A candidate reads their
    six-digit code off this page while dialling a phone, often on that same
    phone, so legibility of the code beats everything else on the page.

    Self-contained - no framework, no external fonts. This site loads for
    someone about to make a nervous phone call; it should not be waiting on a
    CDN.
*/

:root {
    --ink: #1d2430;
    --ink-soft: #5a6675;
    --line: #dde3ea;
    --bg: #f6f8fa;
    --panel: #ffffff;
    --accent: #1f5f8b;
    --accent-dark: #17496b;
    --good: #2e7d4f;
    --warn-bg: #fdf6e3;
    --warn-line: #e6d4a8;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Header and footer ---- */

.site-header {
    background: var(--accent);
    color: #fff;
    padding: 18px 0;
}

.site-header .brand { font-weight: 600; letter-spacing: .01em; }

.site-header .brand-sub {
    display: block;
    font-size: 14px;
    opacity: .85;
}

.site-footer {
    margin: 48px 0 32px;
    font-size: 14px;
    color: var(--ink-soft);
}

.site-footer p { margin: 4px 0; }
.muted { color: var(--ink-soft); font-size: 13px; }

/* ---- Content ---- */

main.wrap { padding-top: 32px; }

h1 { font-size: 26px; margin: 0 0 8px; line-height: 1.25; }
h2 { font-size: 19px; margin: 32px 0 8px; }

.lead { font-size: 17px; color: var(--ink-soft); margin: 0 0 24px; }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin: 0 0 20px;
}

/* ---- The candidate code ----
   The single most important thing on the site. Large, monospaced so the digits
   are unambiguous, and spaced into two groups because people read a grouped
   number aloud correctly and a six-digit run incorrectly. */

.code-panel {
    text-align: center;
    background: var(--panel);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px;
    margin: 0 0 24px;
}

.code-label {
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.code-value {
    display: block;
    font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
    font-size: 40px;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--accent-dark);
}

/* ---- Call steps ---- */

.call-step {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 16px;
    margin-bottom: 12px;
}

.call-step .step-no {
    flex: 0 0 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-step .step-body { flex: 1 1 auto; }
.call-step .step-title { font-weight: 600; }
.call-step .step-note { font-size: 14px; color: var(--ink-soft); }

.call-step a.tel {
    font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
    font-size: 19px;
    color: var(--accent-dark);
    text-decoration: none;
    white-space: nowrap;
}

.call-step a.tel:hover { text-decoration: underline; }

/* ---- Status banner ---- */

.status {
    border-left: 4px solid var(--accent);
    background: var(--panel);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 14px 16px;
    margin: 0 0 24px;
}

.status.waiting {
    border-left-color: var(--warn-line);
    background: var(--warn-bg);
}

.status.done { border-left-color: var(--good); }

/* ---- Forms ---- */

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.field .hint { font-size: 13px; color: var(--ink-soft); font-weight: 400; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"] {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 16px; /* 16px or iOS zooms the page on focus */
    font-family: inherit;
    color: var(--ink);
    background: #fff;
}

.field input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: var(--radius);
    padding: 13px 22px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover { background: var(--accent-dark); }

.error-summary {
    border: 1px solid #e0b4b4;
    background: #fdf2f2;
    color: #8a2020;
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 15px;
}

/* ---- Feedback and results ---- */

.feedback-body { white-space: pre-wrap; }

.criteria { width: 100%; border-collapse: collapse; margin-top: 8px; }

.criteria th,
.criteria td {
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
}

.criteria th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }

.verdict { font-weight: 600; }
.verdict.success { color: var(--good); }
.verdict.failure { color: #a33; }
.verdict.unknown { color: var(--ink-soft); }

.movement.improved { color: var(--good); font-weight: 600; }
.movement.regressed { color: #a33; font-weight: 600; }
.movement.unchanged { color: var(--ink-soft); }

.empty {
    color: var(--ink-soft);
    background: var(--panel);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

@media (min-width: 560px) {
    h1 { font-size: 30px; }
    .code-value { font-size: 48px; }

    /* Size the signup fields to their content once there is room for it.
       Full width is right on a phone and wrong on a desktop, where a phone
       number field stretched to the full 640px column looks broken.

       max-width rather than width, so the fields still shrink with the
       column. Below 560px nothing here applies and they stay full width. */
    .field input[type="text"]  { max-width: 26em; }
    .field input[type="email"] { max-width: 26em; }
    .field input[type="tel"]   { max-width: 14em; }
}
