/*
 * Collector page styling. Colours and font come from the Soverli theme
 * (theme/colours.css, synced by scripts/sync-theme.sh), so brand changes land
 * here without touching this file.
 */

:root {
    --page-bg: #f4f6fb;
    --card-bg: #ffffff;
    --text: var(--colour-dark, #08122e);
    --text-muted: var(--colour-dark-muted, #3a466e);
    --line: #dde3f0;
    --error: #a4232b;
    --ok: #1c7a4a;
    --warn: #8a5a00;
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0 1.25rem 3rem;
    background: var(--page-bg);
    color: var(--text);
    font-family: var(--font-family, "Helvetica Neue", Helvetica, Arial, sans-serif);
    line-height: 1.55;
}

main,
.masthead,
footer {
    max-width: 46rem;
    margin: 0 auto;
}

.masthead {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    padding: 2rem 0 1.5rem;
}

/*
 * Sized by height, not width: the lockup is the mark plus the wordmark at about
 * 3:1, so a width that suits a square icon renders the wordmark unreadably
 * small. web/theme/logo-lockup.svg is cropped to the artwork by
 * scripts/sync-theme.sh, so this height is the real height of the mark rather
 * than mostly empty canvas.
 */
.masthead-logo {
    height: 2.75rem;
    width: auto;
    flex: none;
}

.masthead h1 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

.masthead-sub {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
}

.card h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
}

.card.quiet {
    background: transparent;
    border-style: dashed;
}

.card.quiet h2,
.card.quiet p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card.success {
    border-color: var(--ok);
    border-left-width: 4px;
}

.card.warn {
    border-color: var(--warn);
    border-left-width: 4px;
}

.step {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    flex: none;
    border-radius: 50%;
    background: var(--colour-primary, #2a59e6);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

p {
    margin: 0 0 0.75rem;
}

p:last-child {
    margin-bottom: 0;
}

.hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.checklist {
    margin: 0;
    padding-left: 1.3rem;
}

.checklist li {
    margin-bottom: 0.35rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

button {
    font: inherit;
    padding: 0.6rem 1.1rem;
    border-radius: 6px;
    border: 1px solid var(--colour-primary-dark, #1e42b4);
    background: #fff;
    color: var(--colour-primary-dark, #1e42b4);
    cursor: pointer;
}

button.primary {
    background: var(--colour-primary, #2a59e6);
    color: #fff;
}

button:hover:not(:disabled) {
    background: var(--colour-primary-dark, #1e42b4);
    color: #fff;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.fields {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.6rem 1rem;
    align-items: start;
}

.fields label {
    padding-top: 0.55rem;
    font-size: 0.92rem;
    color: var(--text-muted);
}

input,
textarea {
    font: inherit;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: 2px solid var(--colour-primary-light, #6b8cf0);
    outline-offset: 1px;
    border-color: var(--colour-primary, #2a59e6);
}

.details {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

dl {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.3rem 1rem;
    margin: 0;
    font-size: 0.95rem;
}

dt {
    color: var(--text-muted);
}

dd {
    margin: 0;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.progress-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 0.5rem;
}

.progress-step {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.progress-percent {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--colour-primary-dark, #1e42b4);
}

.progress-detail {
    margin: 0.45rem 0 0;
    min-height: 1.3em;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}

.bar {
    height: 0.75rem;
    border-radius: 999px;
    background: var(--colour-primary-lighter, #d4defb);
    overflow: hidden;
}

.bar-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--colour-primary, #2a59e6);
    transition: width 0.25s ease;
}

/*
 * Upload gets a moving stripe on top of the real fill. A customer watching a
 * 60 MB upload over a slow link needs to see that something is still happening
 * between percentage ticks.
 */
.bar-fill.moving {
    background-image: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 2.5rem 100%;
    background-repeat: repeat-x;
    animation: bar-stripe 1.1s linear infinite;
}

@keyframes bar-stripe {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 2.5rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bar-fill.moving {
        animation: none;
    }

    .bar-fill {
        transition: none;
    }
}

details {
    margin-top: 0.9rem;
    font-size: 0.9rem;
}

summary {
    cursor: pointer;
    color: var(--colour-primary-dark, #1e42b4);
}

pre {
    max-height: 16rem;
    overflow: auto;
    margin: 0.6rem 0 0;
    padding: 0.75rem;
    border-radius: 6px;
    background: var(--colour-dark, #08122e);
    color: #d7e0f5;
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.error {
    color: var(--error);
    font-size: 0.92rem;
}

.reference {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow-wrap: anywhere;
}

.muted {
    color: var(--text-muted);
}

footer {
    padding-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

@media (max-width: 34rem) {
    .fields,
    dl {
        grid-template-columns: 1fr;
    }

    .fields label {
        padding-top: 0;
    }
}
