/*
 * GymKey stylesheet.
 *
 * Hand-written on purpose: there is no Node, no Vite and no build step, so
 * `docker compose up -d` is the only command a fresh host needs and there is
 * nothing to recompile when someone edits a view.
 *
 * Mobile-first throughout — nearly every public visitor is a parent on a phone.
 */

:root {
    color-scheme: light dark;

    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --border: #e1e5ec;
    --border-strong: #c9d1dd;
    --text: #1f2430;
    --text-muted: #5d6779;
    --brand: #1f3a5f;
    --brand-contrast: #ffffff;
    --accent: #2563a8;
    --ok-bg: #e7f6ec;
    --ok-text: #1b6b35;
    --warn-bg: #fdf3dc;
    --warn-text: #8a5a09;
    --err-bg: #fdeaea;
    --err-text: #9a2420;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 10%);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171d;
        --surface: #1b1f27;
        --surface-2: #21262f;
        --border: #2d343f;
        --border-strong: #3c4553;
        --text: #e7eaf0;
        --text-muted: #9aa5b8;
        --brand: #27405f;
        --accent: #6aa6e8;
        --ok-bg: #16301f;
        --ok-text: #86d9a3;
        --warn-bg: #352a12;
        --warn-text: #e5bd6b;
        --err-bg: #3a1c1c;
        --err-text: #f0a0a0;
        --shadow: none;
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 var(--font);
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }

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

code, pre, .mono { font-family: var(--mono); font-size: 0.875em; }

.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* ---------------------------------------------------------------- layout */

.wrap {
    width: 100%;
    max-width: 68rem;
    margin: 0 auto;
    padding: 0 16px;
}

.wrap-narrow { max-width: 34rem; }

.topbar {
    background: var(--brand);
    color: var(--brand-contrast);
    padding: 0.7rem 0;
}

.topbar a { color: var(--brand-contrast); }

.topbar-inner { display: flex; align-items: center; gap: 0.75rem; justify-content: space-between; }

.brand {
    font-weight: 650;
    font-size: 1.05rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--radius-sm);
    background: rgb(255 255 255 / 18%);
    font-size: 0.85rem;
}

.whoami { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }

.avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: rgb(255 255 255 / 20%);
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    object-fit: cover;
}

.nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-inner { display: flex; gap: 0.25rem; }

.nav a {
    display: block;
    padding: 0.7rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 550;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

main { padding: 1.25rem 0 3rem; }

.page-head { margin-bottom: 1.1rem; }
.page-head p { margin: 0.2rem 0 0; color: var(--text-muted); font-size: 0.925rem; }

/* ---------------------------------------------------------------- cards */

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

.card + .card { margin-top: 1rem; }
.card-head { margin: -0.25rem 0 0.75rem; }
.card-head h2 { margin: 0; }
.card-head p { margin: 0.15rem 0 0; font-size: 0.875rem; color: var(--text-muted); }

.grid { display: grid; gap: 1rem; }

@media (min-width: 46rem) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-side { grid-template-columns: 15rem 1fr; align-items: start; }
}

/* ---------------------------------------------------------------- forms */

.field { display: block; margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }

.label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.help { display: block; font-size: 0.825rem; color: var(--text-muted); margin-top: 0.3rem; }

.input, .select, .textarea {
    width: 100%;
    padding: 0.6rem 0.65rem;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}

.input:focus-visible, .select:focus-visible, .textarea:focus-visible, .btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.textarea { min-height: 16rem; font-family: var(--mono); font-size: 0.9rem; line-height: 1.5; resize: vertical; }

.check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.925rem; }
.check input { width: 1.1rem; height: 1.1rem; margin: 0.2rem 0 0; flex: none; }

.error { color: var(--err-text); font-size: 0.85rem; margin-top: 0.3rem; }

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.95rem;
    font: inherit;
    font-size: 0.925rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
}

.btn:hover { background: var(--surface-2); }

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-contrast);
}

.btn-primary:hover { background: var(--accent); border-color: var(--accent); }

.btn-danger { color: var(--err-text); border-color: var(--err-text); background: transparent; }
.btn-sm { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--accent); padding: 0; font-weight: 550; }

/* ---------------------------------------------------------------- alerts */

.alert {
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-ok { background: var(--ok-bg); color: var(--ok-text); }
.alert-warn { background: var(--warn-bg); color: var(--warn-text); }
.alert-err { background: var(--err-bg); color: var(--err-text); }

/* ---------------------------------------------------------------- badges */

.badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    white-space: nowrap;
}

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

/* ---------------------------------------------------------------- tables */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }

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

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

table.table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    white-space: nowrap;
}

table.table tr:last-child td { border-bottom: none; }

.empty { padding: 1.5rem 0.5rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* ---------------------------------------------------------------- checklist */

.checklist { list-style: none; margin: 0; padding: 0; }

.checklist li {
    display: flex;
    gap: 0.65rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.925rem;
}

.checklist li:last-child { border-bottom: none; }

.tick {
    flex: none;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--warn-bg);
    color: var(--warn-text);
}

.tick-done { background: var(--ok-bg); color: var(--ok-text); }

.checklist strong { display: block; font-weight: 600; }
.checklist .detail { color: var(--text-muted); font-size: 0.85rem; }

/* ---------------------------------------------------------------- stats */

.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem; }
.stat .n { font-size: 1.6rem; font-weight: 650; line-height: 1.1; }
.stat .k { font-size: 0.8rem; color: var(--text-muted); }

/* ---------------------------------------------------------------- email preview */

.preview {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    background: var(--surface-2);
    font-size: 0.925rem;
}

.preview :first-child { margin-top: 0; }
.preview :last-child { margin-bottom: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.chip {
    font-family: var(--mono);
    font-size: 0.75rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.1rem 0.35rem;
    color: var(--text-muted);
}

/* ---------------------------------------------------------------- public */

.hero { padding: 1.5rem 0 0.5rem; }
.hero h1 { font-size: 1.65rem; }

.choice {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem;
    text-decoration: none;
    color: var(--text);
}

.choice:hover { border-color: var(--accent); }
.choice h2 { color: var(--accent); }
.choice p { margin: 0.25rem 0 0; font-size: 0.925rem; color: var(--text-muted); }

.choice-off { opacity: 0.65; }

footer.site { padding: 1.5rem 0 2.5rem; font-size: 0.85rem; color: var(--text-muted); }

/* Pagination rendered by Laravel's simple default markup. */
.pagination-wrap { margin-top: 1rem; font-size: 0.9rem; }
.pagination-wrap svg { width: 1rem; height: 1rem; vertical-align: middle; }
