/* EPA 608 Practice - base styles. Mobile first, light and dark mode. */

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #1a2230;
    --muted: #556070;
    --border: #d9dee6;
    --brand: #0b5cad;
    --brand-strong: #084a8c;
    --brand-contrast: #ffffff;
    --accent-bg: #e8f1fb;
    --ok-bg: #e5f5ea;
    --ok-text: #165c2c;
    --warn-bg: #fff4de;
    --warn-text: #6b4600;
    --error-bg: #fdecec;
    --error-text: #8a1c1c;
    --focus: #f0a400;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #10151d;
        --surface: #18202b;
        --text: #e8edf3;
        --muted: #a3afbf;
        --border: #2c3747;
        --brand: #5aa6f2;
        --brand-strong: #82bcf6;
        --brand-contrast: #0b1522;
        --accent-bg: #16283d;
        --ok-bg: #133222;
        --ok-text: #9fe0b4;
        --warn-bg: #3a2c0c;
        --warn-text: #f5d38a;
        --error-bg: #3d1717;
        --error-text: #f7b0b0;
        --shadow: none;
        color-scheme: dark;
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.125rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--brand);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--brand-strong);
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

h1, h2, h3 {
    line-height: 1.25;
    margin: 0 0 0.6em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; margin-top: 1.5em; }

p { margin: 0 0 1em; }

code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

cite { font-style: italic; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--surface);
    padding: 0.75rem 1rem;
    z-index: 10;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

/* Layout */

.container {
    width: 100%;
    max-width: 44rem;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
    flex: 1;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
    min-height: 44px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 10px;
    background: var(--brand);
    color: var(--brand-contrast);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.brand-text {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    line-height: 1.2;
}

.brand-text small {
    font-weight: 500;
    color: var(--muted);
    font-size: 0.8rem;
}

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 1.5rem 1rem;
}

.site-footer p {
    margin: 0.25em 0;
}

/* Components */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.card.narrow {
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.callout {
    background: var(--accent-bg);
    border-color: transparent;
}

.callout h2 {
    margin-top: 0;
}

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

.hero {
    padding: 1.5rem 0 0.5rem;
}

.hero h1 {
    font-size: 2rem;
}

.eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 0.5rem;
}

.lead {
    font-size: 1.2rem;
    color: var(--muted);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.feature-list li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.feature-list strong {
    display: block;
    margin-bottom: 0.25rem;
}

.feature-list span {
    color: var(--muted);
}

.muted,
.hint {
    color: var(--muted);
}

.hint {
    font-size: 0.95rem;
    margin: 0.35rem 0 0;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.row-between h1 {
    margin: 0;
}

.link-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.link-list a {
    display: block;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    min-height: 48px;
}

/* Forms */

.stack > * + * {
    margin-top: 1rem;
}

.field label,
label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    min-height: 52px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand);
}

.code-box {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 52px;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--brand);
    border-radius: 10px;
    background: var(--brand);
    color: var(--brand-contrast);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--brand-strong);
    border-color: var(--brand-strong);
    color: var(--brand-contrast);
}

.button[disabled],
.button[aria-busy="true"] {
    opacity: 0.7;
    cursor: progress;
}

.button-quiet {
    background: transparent;
    color: var(--brand);
    min-height: 44px;
    padding: 0.5rem 1rem;
}

.button-quiet:hover {
    background: var(--accent-bg);
    color: var(--brand-strong);
}

form .button {
    width: 100%;
}

form .button-quiet {
    width: auto;
}

@media (min-width: 36rem) {
    form .button {
        width: auto;
    }
}

/* Notices, badges, tables */

.notice {
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}

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

.notice-success { background: var(--ok-bg); color: var(--ok-text); }
.notice-warning { background: var(--warn-bg); color: var(--warn-text); }
.notice-error { background: var(--error-bg); color: var(--error-text); }

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.badge-wait { background: var(--warn-bg); color: var(--warn-text); }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.table th,
.table td {
    text-align: left;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

@media (min-width: 36rem) {
    .container { padding-top: 2rem; }
    .card { padding: 1.75rem; }
    .hero h1 { font-size: 2.4rem; }
}

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