/* ------------------------------------------------------------------ *
 * Whitespark image click study
 * ------------------------------------------------------------------ */

:root {
    --ink: #10242f;
    --ink-soft: #4a6270;
    --ink-faint: #7d919c;
    --paper: #f4f7f8;
    --card: #ffffff;
    --line: #dfe7ea;
    --teal: #0f7c8a;
    --teal-dark: #0a5f6b;
    --teal-wash: #e7f3f5;
    --amber-wash: #fff6e2;
    --amber-line: #f0c96b;
    --green: #1f8a5c;
    --red: #b4342c;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 36, 47, .06), 0 8px 24px rgba(16, 36, 47, .06);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
        "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal-dark); }

/* --- Structure ----------------------------------------------------- */

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

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

.site-header .wrap,
.site-header .wrap-wide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 9px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #fff;
    text-decoration: none;
    font-size: 17px;
}

.brand span { color: #7fd3dd; font-weight: 500; }

main { padding: 40px 0 72px; }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 24px 0 40px;
    color: var(--ink-faint);
    font-size: 14px;
}

/* --- Typography ---------------------------------------------------- */

h1 {
    font-size: clamp(28px, 5vw, 38px);
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: 0 0 16px;
}

h2 {
    font-size: 21px;
    line-height: 1.3;
    letter-spacing: -.01em;
    margin: 36px 0 12px;
}

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

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: 12px;
    font-weight: 700;
    color: var(--teal);
    margin: 0 0 10px;
}

p { margin: 0 0 16px; }

/* --- Cards --------------------------------------------------------- */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

@media (max-width: 560px) { .card { padding: 20px; } }

.note {
    background: var(--amber-wash);
    border: 1px solid var(--amber-line);
    border-radius: 10px;
    padding: 14px 18px;
    margin: 24px 0;
}

.note p:last-child { margin-bottom: 0; }
.note strong { display: block; margin-bottom: 2px; }

/* --- Steps --------------------------------------------------------- */

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }

.steps > li {
    counter-increment: step;
    position: relative;
    padding: 0 0 28px 48px;
    border-left: 2px solid var(--line);
    margin-left: 15px;
}

.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }

.steps > li::before {
    content: counter(step);
    position: absolute;
    left: -16px;
    top: -2px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.steps .substeps { margin: 8px 0 0; padding-left: 22px; color: var(--ink-soft); }
.steps .substeps li { margin-bottom: 4px; }

.step-text { margin: 4px 0 0; }

.shot {
    margin: 14px 0 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.shot figcaption {
    font-size: 13px;
    color: var(--ink-faint);
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    background: #fbfcfd;
}

.shot--target { border: 2px solid var(--teal); }

.search-term {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .95em;
    background: var(--teal-wash);
    border: 1px solid #c7e2e6;
    border-radius: 6px;
    padding: 2px 8px;
}

/* --- Progress ------------------------------------------------------ */

.progress {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-faint);
}

.progress li {
    flex: 1;
    padding-top: 10px;
    border-top: 3px solid var(--line);
}

.progress li.is-done { color: var(--green); border-top-color: var(--green); }
.progress li.is-current { color: var(--teal); border-top-color: var(--teal); }

/* --- Forms & buttons ----------------------------------------------- */

label { display: block; font-weight: 600; margin-bottom: 6px; }

.field-hint { font-weight: 400; color: var(--ink-soft); font-size: 15px; margin: -2px 0 10px; }

input[type="email"], input[type="password"], input[type="text"] {
    width: 100%;
    font: inherit;
    padding: 12px 14px;
    border: 1px solid #c3d1d7;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}

input:focus-visible, .btn:focus-visible, a:focus-visible {
    outline: 3px solid #8fd4de;
    outline-offset: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 650;
    text-align: center;
    padding: 13px 24px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--teal);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background .12s ease;
}

.btn:hover { background: var(--teal-dark); }
.btn--block { display: flex; width: 100%; }
.btn--lg { font-size: 18px; padding: 15px 30px; }

.btn--ghost {
    background: transparent;
    color: var(--teal-dark);
    border-color: #c3d1d7;
}

.btn--ghost:hover { background: var(--teal-wash); }

.form-error { color: var(--red); font-size: 15px; margin: 8px 0 0; }

.form-actions { margin-top: 28px; }

.form-actions .btn + .btn { margin-top: 10px; }

.actions-sticky {
    position: sticky;
    bottom: 0;
    margin: 32px -28px -28px;
    padding: 20px 28px;
    background: linear-gradient(rgba(255, 255, 255, 0), #fff 22%);
    border-radius: 0 0 var(--radius) var(--radius);
}

@media (max-width: 560px) { .actions-sticky { margin: 24px -20px -20px; padding: 16px 20px; } }

/* --- Admin --------------------------------------------------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 0 0 32px;
}

.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}

.stat .stat-value {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.stat .stat-label { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.stat .stat-sub { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.filters { display: flex; flex-wrap: wrap; gap: 6px; }

.filters a {
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink-soft);
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}

.filters a.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.table-scroll {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

table { width: 100%; border-collapse: collapse; font-size: 15px; }

th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }

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

tbody tr:last-child td { border-bottom: 0; }

.pill {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef2f4;
    color: var(--ink-faint);
}

.pill--done { background: #e2f4ea; color: var(--green); }

.muted { color: var(--ink-faint); }

.pagination-wrap { margin-top: 20px; font-size: 15px; }

.empty { padding: 40px 16px; text-align: center; color: var(--ink-faint); }

/* --- Thank you ----------------------------------------------------- */

.celebrate { text-align: center; padding: 20px 0; }
.celebrate .checkmark { font-size: 56px; line-height: 1; margin-bottom: 12px; }

#confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

@media (prefers-reduced-motion: reduce) {
    #confetti-canvas { display: none; }
    * { animation: none !important; transition: none !important; }
}

/* --- Pagination ---------------------------------------------------- */

.pager { display: flex; align-items: center; gap: 12px; }

.pager-link {
    font-weight: 600;
    text-decoration: none;
    color: var(--teal-dark);
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.pager-link:hover { background: var(--teal-wash); }
.pager-link.is-disabled { color: var(--ink-faint); background: transparent; border-color: transparent; }
.pager-status { color: var(--ink-faint); font-size: 14px; }

@media (max-width: 560px) {
    .progress { font-size: 12px; gap: 6px; }
    .progress-detail { display: none; }
}

/* A paragraph that follows a .steps list needs room; the list's last item
   removes its own bottom padding so the timeline doesn't trail off. */
.after-steps { margin-top: 30px; }
