:root {
    color-scheme: light;
    --accent: #cc0000;
    --accent-dark: #a30000;
    --link: #cc0000;
    --error: #b00020;
    --success: #1a8a3c;
    --text: #1a1a1a;
    --text-muted: #6b6b6b;
    --border: #d9d9d9;
    --bg: #ffffff;
    --bg-soft: #f6f6f6;
}

html[data-theme-mode="dark"] {
    color-scheme: dark;
    --link: #ff7a7a;
    --error: #ff8a8a;
    --success: #4cc26e;
    --text: #e8e8e8;
    --text-muted: #9a9a9a;
    --border: #3a3a3a;
    --bg: #161616;
    --bg-soft: #222222;
}

@media (prefers-color-scheme: dark) {
    html[data-theme-mode="system"], html:not([data-theme-mode]) {
        color-scheme: dark;
        --link: #ff7a7a;
        --error: #ff8a8a;
        --success: #4cc26e;
        --text: #e8e8e8;
        --text-muted: #9a9a9a;
        --border: #3a3a3a;
        --bg: #161616;
        --bg-soft: #222222;
    }
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
}

body {
    transition: background-color 0.15s ease, color 0.15s ease;
}

h1 {
    font-size: 1.7rem;
    line-height: 1.25;
}

h1:focus {
    outline: none;
}

a {
    color: var(--link);
}

button.primary {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.3rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

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

.error {
    color: var(--error);
}

/* ---- Theme toggle ---- */

.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
}

.theme-toggle:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.theme-toggle .icon {
    display: none;
    line-height: 0;
}

html[data-theme-mode="system"] .theme-toggle .icon-system,
html:not([data-theme-mode]) .theme-toggle .icon-system {
    display: block;
}

html[data-theme-mode="light"] .theme-toggle .icon-light {
    display: block;
}

html[data-theme-mode="dark"] .theme-toggle .icon-dark {
    display: block;
}

/* ---- Homepage ---- */

.home {
    max-width: 640px;
    margin: 0 auto;
    padding: 22vh 1.5rem 2rem;
    text-align: center;
}

.home h1 {
    font-size: 2.2rem;
    margin-bottom: 0.4rem;
}

.home .tagline {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.link-form {
    display: flex;
    gap: 0.6rem;
}

.link-input {
    flex: 1;
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}

.link-input:focus {
    outline: 2px solid var(--accent);
    border-color: transparent;
}

.privacy-note {
    position: fixed;
    bottom: 0.9rem;
    left: 1rem;
    right: 1rem;
    margin: 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---- Summary page ---- */

.summary-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 4rem;
}

.summary-page .back {
    margin-bottom: 2rem;
}

.summary-page .back a {
    color: var(--text-muted);
    text-decoration: none;
}

.summary-page .back a:hover {
    color: var(--link);
}

.meta-line {
    color: var(--text-muted);
    margin-top: -0.5rem;
}

.summary {
    margin-top: 1.5rem;
}

.summary h2 {
    font-size: 1.25rem;
    margin-top: 1.8rem;
}

.summary li {
    margin-bottom: 0.3rem;
}

.footnote {
    margin-top: 2.5rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

.steps {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.steps li {
    padding: 0.55rem 0 0.55rem 2.1rem;
    position: relative;
    color: var(--text-muted);
}

.steps li::before {
    position: absolute;
    left: 0;
    width: 1.4rem;
    text-align: center;
}

.steps li.done {
    color: var(--text);
}

.steps li.done::before {
    content: "✓";
    color: var(--success);
    font-weight: 700;
}

.steps li.current {
    color: var(--text);
    font-weight: 600;
}

.steps li.current::before {
    content: "";
    top: 0.75rem;
    height: 0.9rem;
    width: 0.9rem;
    margin-left: 0.2rem;
    border: 2px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.steps li.pending::before {
    content: "·";
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.last-log {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- Blazor plumbing (from template) ---- */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#blazor-error-ui {
    display: none;
}
