/* ==========================================================================
   Placement tests — the public form surface.
   Brand palette matches styles-carolina.css so the test reads as part of the
   same site. Deliberately its own stylesheet: this page is opened cold by
   people who have never seen the catalog, so it must not wait on the catalog's
   large CSS just to render a list of questions.
   ========================================================================== */

:root {
    --primary: #222E66;
    --primary-dark: #1a2452;
    --primary-light: #f0f4ff;
    --accent: #F16C13;
    --accent-dark: #d85a0a;
    --ok: #15803d;
    --ok-light: #f0fdf4;
    --warn: #b45309;
    --warn-light: #fffbeb;
    --err: #b91c1c;
    --err-light: #fef2f2;
    --ink: #1e293b;
    --ink-soft: #64748b;
    --line: #e2e8f0;
    --bg: #f8fafc;
    --card: #ffffff;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    /* The picker is a short page. Without this the footer floats up under the
       cards instead of sitting at the bottom where a footer belongs. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.pt-main { flex: 1 0 auto; }          /* pushes the footer down on a short page */
.pt-footer { flex-shrink: 0; }

/* ------------------------------------------------------------------ header */
/* Copied rule-for-rule from styles-carolina.css so this page's top bar is the
   SAME bar as the catalog's — same 60px height, same navy, same square tabs on
   the right, same orange Student Portal. Copied rather than linked because
   styles-carolina.css is 250KB and this page is opened cold by people who have
   never seen the catalog. ⚠️ If the catalog's nav changes, change it here too. */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.nav-brand { display: flex; align-items: center; gap: .75rem; }

.nav-actions { display: flex; align-items: center; gap: 1rem; }

.nav-login-btn,
.nav-portal-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 0;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}
.nav-login-btn { background: var(--accent); }
.nav-portal-link { background: transparent; }

.nav-login-btn:hover { background: white; border-color: white; color: var(--primary); }
.nav-portal-link:hover { background: rgba(255, 255, 255, 0.15); border-color: white; color: white; }

.nav-login-btn i, .nav-portal-link i { font-size: 1.1rem; }

/* The bar is fixed, so the page needs its height back. */
body { padding-top: 60px; }

/* --------------------------------------------------------------- stepper */
/* The test runs in steps: your details, then the questions ten at a time, then
   a review. Sticky, because "where am I and how much is left" is the question
   people actually have, and clickable, because they are allowed to move around
   freely — nothing is lost by jumping back. */
.pt-steps {
    position: sticky; top: 60px; z-index: 20;      /* clears the fixed top bar */
    width: 100%; flex-shrink: 0;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}
.pt-steps-inner { max-width: 900px; margin: 0 auto; padding: .75rem 1.25rem .6rem; }

.pt-steps-bar { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.pt-steps-fill {
    height: 100%; width: 0%; background: var(--accent);
    border-radius: 99px; transition: width .3s ease;
}

.pt-steps-list {
    display: flex; gap: .4rem; margin-top: .65rem;
    overflow-x: auto; scrollbar-width: none;
}
.pt-steps-list::-webkit-scrollbar { display: none; }

.pt-step {
    display: flex; align-items: center; gap: .45rem;
    background: none; border: none; cursor: pointer;
    padding: .35rem .7rem; border-radius: 99px;
    font: inherit; font-size: .82rem; font-weight: 600; color: var(--ink-soft);
    white-space: nowrap; transition: background .15s, color .15s;
}
.pt-step:hover { background: var(--primary-light); color: var(--primary); }
.pt-step.is-current { background: var(--primary); color: #fff; }
.pt-step.is-current .pt-step-dot { background: #fff; color: var(--primary); }

.pt-step-dot {
    width: 21px; height: 21px; border-radius: 50%; flex-shrink: 0;
    background: var(--line); color: var(--ink-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700;
}
.pt-step.is-done .pt-step-dot { background: var(--ok); color: #fff; }
.pt-step.is-done { color: var(--ok); }
.pt-step-count { font-weight: 400; opacity: .75; font-size: .76rem; }

/* ------------------------------------------------------------------- main */
.pt-main {
    /* width + auto margins, NOT align-items: a flex item centres on auto
       margins; relying on the default stretch would pin it to the left. */
    width: 100%; max-width: 880px; margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.pt-loading { text-align: center; padding: 4rem 1rem; color: var(--ink-soft); }
.pt-loading i { font-size: 1.8rem; color: var(--accent); }

/* Getting back out of a test. Someone who opened the wrong language should not
   have to use the browser's back button to fix it. */
.pt-back {
    display: inline-flex; align-items: center; gap: .45rem;
    background: none; border: none; padding: 0; margin: 0 0 .9rem;
    font: inherit; font-size: .88rem; font-weight: 600;
    color: var(--ink-soft); cursor: pointer;
}
.pt-back:hover { color: var(--primary); }

.pt-title { font-size: 1.75rem; font-weight: 800; color: var(--primary); margin: 0 0 .35rem; }
.pt-lead { color: var(--ink-soft); margin: 0 0 1.75rem; }

.pt-card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.5rem; margin-bottom: 1.25rem;
}
.pt-card h2 {
    font-size: 1.05rem; font-weight: 700; color: var(--primary);
    margin: 0 0 1rem; display: flex; align-items: center; gap: .55rem;
}
.pt-card h2 i { color: var(--accent); }

.pt-note {
    background: var(--primary-light); border-left: 3px solid var(--primary);
    border-radius: 8px; padding: .9rem 1.1rem; margin: 0 0 1.5rem;
    font-size: .92rem; color: var(--ink);
}

/* ------------------------------------------------------------ test picker */
.pt-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .9rem; }
.pt-pick {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.1rem 1.25rem; text-decoration: none; color: var(--ink);
    box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.pt-pick:hover { border-color: var(--accent); transform: translateY(-2px); }
.pt-pick-name { font-weight: 700; color: var(--primary); font-size: 1.05rem; }
.pt-pick-meta { font-size: .78rem; color: var(--ink-soft); }
.pt-pick i { color: var(--accent); }

/* --------------------------------------------------------------- identity */
/* The email-first step. A returning student should never have to retype what
   we already hold, and should never be forced to sign in to take a test. */
.pt-ident { margin-bottom: 1.1rem; }
.pt-ident-row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.pt-ident-row .pt-field { flex: 1 1 260px; margin-bottom: 0; }

.pt-found {
    background: var(--primary-light); border: 1px solid #c7d2fe;
    border-radius: 10px; padding: 1rem 1.15rem; margin-top: .85rem;
}
.pt-found h3 {
    margin: 0 0 .35rem; font-size: .98rem; color: var(--primary);
    display: flex; align-items: center; gap: .5rem;
}
.pt-found p { margin: 0 0 .85rem; font-size: .9rem; color: var(--ink-soft); }
.pt-found-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.pt-signedin {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    background: var(--ok-light); border: 1px solid #bbf7d0;
    border-radius: 10px; padding: .8rem 1.1rem; margin-bottom: 1.1rem;
    font-size: .92rem;
}
.pt-signedin i { color: var(--ok); }
.pt-signedin strong { color: var(--ink); }
.pt-signedin button {
    margin-left: auto; background: none; border: none; cursor: pointer;
    color: var(--ink-soft); font: inherit; font-size: .85rem; text-decoration: underline;
}

/* A locked field still has to look like a field, just not an editable one. */
.pt-input[readonly] {
    background: var(--bg);
    color: var(--ink-soft);
    cursor: not-allowed;
}
.pt-input[readonly]:focus { border-color: var(--line); box-shadow: none; }
.pt-locked-note {
    margin: .35rem 0 0; font-size: .78rem; color: var(--ink-soft);
    display: flex; align-items: center; gap: .35rem;
}
.pt-locked-note a { color: var(--primary); }

.pt-code-input {
    letter-spacing: .4em; font-size: 1.15rem; font-weight: 700;
    text-align: center; max-width: 190px;
}
.pt-btn-sm { padding: .55rem 1.1rem; font-size: .88rem; }

/* ------------------------------------------------------------------ forms */
.pt-field { margin-bottom: 1.1rem; }
.pt-field label.pt-label {
    display: block; font-weight: 600; font-size: .88rem;
    margin-bottom: .4rem; color: var(--ink);
}
.pt-req { color: var(--err); }
.pt-input {
    width: 100%; padding: .65rem .8rem; font: inherit; font-size: .95rem;
    border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.pt-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.pt-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }

/* Choice rows are labels wrapping their input, so the whole row is clickable —
   a 50-question test on a phone is miserable with small radio hit targets. */
.pt-choice {
    display: flex; align-items: flex-start; gap: .65rem;
    padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 8px;
    margin-bottom: .45rem; cursor: pointer; background: #fff;
    transition: border-color .12s, background .12s;
}
.pt-choice:hover { border-color: var(--primary); background: var(--primary-light); }
.pt-choice input { margin-top: .28rem; accent-color: var(--primary); flex-shrink: 0; }
.pt-choice-text { font-size: .93rem; }
.pt-choice.is-picked { border-color: var(--primary); background: var(--primary-light); }

/* ------------------------------------------------------------- questions */
.pt-q {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.25rem 1.4rem; margin-bottom: .9rem; box-shadow: var(--shadow);
    scroll-margin-top: 150px;  /* clears the fixed nav AND the sticky progress rail */
}
.pt-q.is-missing { border-color: var(--warn); background: var(--warn-light); }
.pt-q-head { display: flex; gap: .75rem; margin-bottom: .85rem; }
.pt-q-num {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary); color: #fff; display: flex;
    align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pt-q.is-answered .pt-q-num { background: var(--ok); }
.pt-q-prompt { font-weight: 600; font-size: 1rem; padding-top: .15rem; }

.pt-passage {
    background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--primary);
    border-radius: 8px; padding: 1rem 1.2rem; margin: 0 0 1rem;
    font-size: .93rem; line-height: 1.75; white-space: pre-line;
}
.pt-passage-tag {
    display: block; font-size: .7rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--ink-soft); margin-bottom: .45rem;
}

/* ------------------------------------------------------------------ review */
/* The last step. Everything they entered and every answer, so nothing is
   submitted sight-unseen — and every row jumps back to the step it came from. */
.pt-review-group { margin-bottom: 1.5rem; }
.pt-review-head {
    display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
    margin: 0 0 .6rem;
}
.pt-review-head h3 {
    margin: 0; font-size: 1rem; font-weight: 700; color: var(--primary);
}
.pt-review-edit {
    background: none; border: none; padding: 0; cursor: pointer;
    font: inherit; font-size: .82rem; font-weight: 600; color: var(--accent);
    text-decoration: underline;
}
.pt-review-edit:hover { color: var(--accent-dark); }

.pt-review-row {
    display: flex; gap: .9rem; align-items: baseline;
    padding: .6rem .85rem; border-radius: 8px;
    border: 1px solid var(--line); background: #fff; margin-bottom: .4rem;
}
.pt-review-row.is-blank { border-color: #fde68a; background: var(--warn-light); }
.pt-review-n {
    flex-shrink: 0; min-width: 1.9rem; font-weight: 700;
    color: var(--ink-soft); font-variant-numeric: tabular-nums; font-size: .85rem;
}
.pt-review-q { flex: 1; min-width: 0; font-size: .9rem; }
.pt-review-a { display: block; margin-top: .15rem; font-weight: 600; color: var(--primary); }
.pt-review-row.is-blank .pt-review-a { color: var(--warn); font-weight: 500; font-style: italic; }

.pt-review-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .5rem .9rem; }
.pt-review-fact { padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pt-review-fact dt {
    font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--ink-soft); margin: 0 0 .15rem;
}
.pt-review-fact dd { margin: 0; font-size: .92rem; font-weight: 600; color: var(--ink); }
.pt-review-fact.is-missing { border-color: #fde68a; background: var(--warn-light); }
.pt-review-fact.is-missing dd { color: var(--warn); font-weight: 500; font-style: italic; }

.pt-summary {
    display: flex; gap: 1.5rem; flex-wrap: wrap;
    background: var(--primary-light); border: 1px solid #c7d2fe;
    border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.pt-summary div { }
.pt-summary dt {
    font-size: .7rem; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--ink-soft);
}
.pt-summary dd { margin: .1rem 0 0; font-size: 1.35rem; font-weight: 800; color: var(--primary); }

/* --------------------------------------------------------------- step nav */
.pt-stepnav {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.pt-stepnav .pt-spacer { margin-left: auto; }

/* ---------------------------------------------------------------- actions */
.pt-actions {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    margin-top: 1.5rem;
}
.pt-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .8rem 1.6rem; font: inherit; font-weight: 700; font-size: .95rem;
    border: none; border-radius: 8px; cursor: pointer;
    background: var(--accent); color: #fff; transition: background .15s;
}
.pt-btn:hover:not(:disabled) { background: var(--accent-dark); }
.pt-btn:disabled { opacity: .6; cursor: not-allowed; }
.pt-btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--line); }
.pt-btn-ghost:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary); }

.pt-msg { border-radius: 8px; padding: .85rem 1.1rem; margin: 1rem 0; font-size: .92rem; }
.pt-msg-err { background: var(--err-light); border-left: 3px solid var(--err); color: var(--err); }
.pt-msg-warn { background: var(--warn-light); border-left: 3px solid var(--warn); color: var(--warn); }

/* ------------------------------------------------------------------- done */
.pt-done { text-align: center; padding: 2.5rem 1.5rem; }
.pt-done-icon {
    width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 1.25rem;
    background: var(--ok-light); color: var(--ok);
    display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
}
.pt-done h2 { font-size: 1.5rem; color: var(--primary); margin: 0 0 .5rem; }
.pt-done p { color: var(--ink-soft); margin: 0 auto 1.5rem; max-width: 460px; }

/* ------------------------------------------------------------------ footer */
/* This had NO rules at all, so the academy's name sat as bare text against the
   page background, flush left, under a centred layout. */
.pt-footer {
    border-top: 1px solid var(--line);
    background: #fff;
    margin-top: 3rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
}
.pt-footer p {
    margin: 0;
    font-size: .82rem;
    color: var(--ink-soft);
}

/* ------------------------------------------------------------------ small */
@media (max-width: 600px) {
    .pt-main { padding: 1.5rem 1rem 3rem; }
    .pt-card, .pt-q { padding: 1.1rem; }
    .pt-title { font-size: 1.4rem; }
    .pt-actions .pt-btn { width: 100%; justify-content: center; }
}
