/* ACS Atletis – Membri */
:root {
    --bg: #f6f5f2;
    --surface: #ffffff;
    --surface-2: #faf9f7;
    --text: #1c1b19;
    --muted: #6b6760;
    --border: #e4e1db;
    --accent: #c2410c;
    --accent-strong: #9a3412;
    --accent-soft: #fff1e8;
    --ok: #15803d;
    --ok-soft: #e8f6ed;
    --soon: #a16207;
    --soon-soft: #fdf5dc;
    --bad: #b91c1c;
    --bad-soft: #fdecec;
    --none: #57534e;
    --none-soft: #efedea;
    --focus: #2563eb;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(28, 27, 25, .05), 0 1px 1px rgba(28, 27, 25, .03);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141311;
        --surface: #1d1c1a;
        --surface-2: #232220;
        --text: #eceae6;
        --muted: #a29d95;
        --border: #34322e;
        --accent: #f97316;
        --accent-strong: #fb923c;
        --accent-soft: #2e1d12;
        --ok: #4ade80;
        --ok-soft: #13291a;
        --soon: #facc15;
        --soon-soft: #2e2711;
        --bad: #f87171;
        --bad-soft: #351515;
        --none: #b5b0a8;
        --none-soft: #2a2826;
        --focus: #60a5fa;
        --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: 15px/1.5 var(--font);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1rem; font-weight: 650; margin-bottom: 12px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.strong { font-weight: 600; color: var(--text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar__inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand__mark {
    display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
    background: var(--accent); color: #fff; font-weight: 800; font-size: 15px;
}
.brand__mark--lg { width: 44px; height: 44px; font-size: 22px; border-radius: 11px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 550; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.nav a.nav__cta { margin-left: auto; color: var(--accent); }
.account { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.account__email { color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account form { margin: 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.link-button:hover { text-decoration: underline; }

/* ---------- Page ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .muted { margin: 0; }
.back { display: inline-block; font-size: 13px; margin-bottom: 4px; }
.count { font-size: .95rem; font-weight: 600; color: var(--muted); background: var(--none-soft); padding: 2px 9px; border-radius: 99px; vertical-align: middle; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card--accent { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(var(--accent-soft), var(--surface) 70%); }
.narrow { max-width: 480px; }
.empty { text-align: center; padding: 36px 18px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + * { margin-top: 16px; }
.note { background: var(--soon-soft); color: var(--text); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.footnote { font-size: 13px; margin-top: 24px; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.tile {
    display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow);
    border-top: 3px solid var(--none);
}
.tile:hover { text-decoration: none; border-color: var(--muted); }
.tile__value { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile__label { color: var(--muted); font-size: 13px; font-weight: 550; }
.tile--ok { border-top-color: var(--ok); }
.tile--soon { border-top-color: var(--soon); }
.tile--expired { border-top-color: var(--bad); }

/* ---------- Lists & badges ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list li > a { margin-right: auto; font-weight: 550; }
.list--compact li { font-size: 13px; padding: 6px 0; }
.badge {
    display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap;
    background: var(--none-soft); color: var(--none);
}
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--soon { background: var(--soon-soft); color: var(--soon); }
.badge--expired { background: var(--bad-soft); color: var(--bad); }
.status-pill { padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: 13px; background: var(--none-soft); color: var(--none); }
.status-pill--ok { background: var(--ok-soft); color: var(--ok); }
.status-pill--soon { background: var(--soon-soft); color: var(--soon); }
.status-pill--expired { background: var(--bad-soft); color: var(--bad); }
.strava { font-size: 11px; font-weight: 700; color: #fc4c02; margin-left: 6px; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Alerts ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid transparent; }
.alert--success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert--error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert--info { background: var(--none-soft); color: var(--text); }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.stack .field, .filters .field { margin-bottom: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea {
    width: 100%; font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; min-height: 40px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
textarea { resize: vertical; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.error { color: var(--bad); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; accent-color: var(--accent); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.form-grid > .card { margin-bottom: 0; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; }
.after-form { margin-top: 16px; }

.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.field--grow { flex: 1 1 240px; }
.filters .field:not(.field--grow) { flex: 0 1 200px; }
.filters__buttons { display: flex; gap: 8px; }

.inline { display: inline; margin: 0; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 0 1 260px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-weight: 600; font-size: 14px; line-height: 1;
    padding: 0 14px; height: 40px; border-radius: 8px; cursor: pointer;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--surface-2); border-color: var(--muted); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn--danger:hover { filter: brightness(.92); background: var(--bad); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn--sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn--block { width: 100%; }

/* ---------- Table ---------- */
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .date { font-variant-numeric: tabular-nums; margin-right: 6px; }
.table td[data-label="Contact"] { font-size: 13px; }
.col-actions { text-align: right; white-space: nowrap; }
.is-inactive td { opacity: .6; }

/* ---------- Import ---------- */
.steps { margin: 0 0 14px; padding-left: 20px; }
.steps li { margin-bottom: 8px; }
code { font-size: 13px; background: var(--none-soft); padding: 1px 5px; border-radius: 4px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--none-soft); color: var(--muted); }
.chip--ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.table td.details { font-size: 13px; color: var(--muted); max-width: 520px; }

/* ---------- Danger zone ---------- */
.danger { border-color: color-mix(in srgb, var(--bad) 30%, var(--border)); margin-top: 16px; }
.danger summary { cursor: pointer; font-weight: 650; color: var(--bad); }
.danger[open] summary { margin-bottom: 12px; }

/* ---------- Guest (login) ---------- */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.guest > .alert { width: 100%; max-width: 400px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.auth-card__head { text-align: center; margin-bottom: 20px; }
.auth-card__head h1 { font-size: 1.3rem; margin: 12px 0 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .tiles { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .form-grid { grid-template-columns: 1fr; }
    .hide-md { display: none; }
    .account__email { display: none; }
}
@media (max-width: 600px) {
    h1 { font-size: 1.35rem; }
    .row { grid-template-columns: 1fr; gap: 0; }
    .hide-sm { display: none; }
    .nav { order: 3; flex-basis: 100%; }
    .account { margin-left: auto; }
    .table th, .table td { padding: 10px; }
    .table td[data-label="Contribuție"] .date { display: block; margin: 0 0 3px; }
    .filters .field:not(.field--grow) { flex: 1 1 140px; }
    .tile__value { font-size: 1.6rem; }
    .col-actions .btn--ghost { display: none; }
    .col-actions { padding-left: 4px; }
}
