/* =========================================================
   base.css : variables, reset, typographie, boutons, messages
   ========================================================= */

:root {
    --header-h: 64px;

    --bg: #0f1420;
    --surface: #171e2e;
    --surface-2: #1f2940;
    --border: #2b3652;
    --text: #e8ecf5;
    --muted: #a3aec8;
    --link: #8aa8ff;

    --primary: #3d63e8;
    --primary-hover: #2f54d4;
    --danger: #c62828;
    --danger-hover: #a91f1f;
    --success: #4caf7d;
    --error: #ef5350;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f4f6fb;
        --surface: #ffffff;
        --surface-2: #eef1f8;
        --border: #d8deec;
        --text: #1b2236;
        --muted: #586180;
        --link: #2f5fe0;
        --success: #237a4b;
        --error: #c62828;
        --shadow: 0 10px 30px rgba(20, 30, 60, 0.12);
        color-scheme: light;
    }
}

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

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

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

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

h1, h2, h3 {
    line-height: 1.25;
}

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

/* ---------- Mise en page ---------- */

.main {
    min-height: calc(100vh - var(--header-h));
}

.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.muted {
    color: var(--muted);
    font-weight: 400;
}

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

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

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

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

.btn-danger {
    background: var(--danger);
    color: #fff;
}

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

/* ---------- Messages ---------- */

.alert {
    padding: 0.8rem 1rem;
    margin-bottom: 1.1rem;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.95rem;
}

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

.alert-success {
    border-color: var(--success);
}
