/* assets/style.css — minimal, accessible styling.
   Focus is always visible; error text meets contrast requirements. */

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --muted: #555555;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --danger: #b91c1c;
    --error-bg: #fef2f2;
    --error-border: #b91c1c;
    --error-text: #7f1d1d;
    --notice-bg: #eff6ff;
    --notice-border: #1d4ed8;
    --border: #d4d4d4;
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 1rem; }

/* Skip link: visible only when focused */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--text);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 100;
}
.skip-link:focus { left: 0; }

/* Visible focus for keyboard users everywhere */
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.site-header { border-bottom: 1px solid var(--border); background: #f8fafc; }
.site-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.brand { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--text); }
.site-header nav a { margin-left: 1rem; }

.site-footer {
    margin-top: 3rem; border-top: 1px solid var(--border);
    color: var(--muted); font-size: 0.9rem;
}

/* Forms */
.field { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input[type="text"], input[type="email"], input[type="password"] {
    width: 100%; max-width: 28rem;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
}
input[aria-invalid="true"] { border-color: var(--error-border); }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0; }

/* Error summary (top of form) */
.error-summary {
    border: 3px solid var(--error-border);
    background: var(--error-bg);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.error-summary h2 { margin: 0 0 0.5rem; font-size: 1.15rem; color: var(--error-text); }
.error-summary ul { margin: 0; padding-left: 1.25rem; }
.error-summary a { color: var(--error-text); font-weight: 600; }
.error-summary:focus { outline: 3px solid var(--error-border); outline-offset: 2px; }

/* Per-field error message */
.field-error { color: var(--error-text); font-weight: 600; margin: 0.25rem 0; }

/* Success / info boxes */
.notice {
    border: 2px solid var(--notice-border);
    background: var(--notice-bg);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.notice h1, .notice h2 { margin-top: 0; }
.notice-error { border-color: var(--error-border); background: var(--error-bg); }
.dev-note {
    background: #fffbeb; border: 1px dashed #92400e;
    padding: 0.75rem; border-radius: var(--radius);
    overflow-wrap: anywhere;
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--primary); color: #fff;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 0.6rem 1.25rem;
    font-size: 1rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--primary); }
.btn-secondary:hover { background: #eff6ff; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-small { padding: 0.25rem 0.6rem; font-size: 0.85rem; margin: 0.1rem; }

/* Definition list (profile) */
.profile { display: grid; grid-template-columns: 10rem 1fr; gap: 0.25rem 1rem; }
.profile dt { font-weight: 600; }
.profile dd { margin: 0; }

/* Stats */
.stats { list-style: none; padding: 0; display: flex; gap: 2rem; flex-wrap: wrap; }
.stats li strong { font-size: 1.5rem; display: block; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
caption { text-align: left; }
th, td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; }
thead th { background: #f1f5f9; }
.inline-form { display: inline; }
.muted { color: var(--muted); }

/* Screen-reader-only text */
.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Modal dialog (TeamTalk connect) */
dialog {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 32rem;
    width: calc(100% - 2rem);
}
dialog::backdrop { background: rgba(15, 23, 42, 0.5); }
dialog h2 { margin-top: 0; }
.dialog-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* Pagination */
.pagination {
    display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
    margin: 1rem 0 0.5rem;
}
.pagination a, .pagination span {
    padding: 0.25rem 0.6rem; border: 1px solid var(--border);
    border-radius: 0.25rem; text-decoration: none;
}
.pagination a:hover { background: #eff6ff; }
.pagination span[aria-disabled="true"] { color: var(--muted); }
.pagination span[aria-current="page"] { border-color: var(--primary); }
.pagination-jump { margin: 0.5rem 0 1rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.pagination-jump input[type="number"] { width: 4.5rem; }
