/* La feuille commune de mcp-auth : pages de connexion, d'accord, « aucun accès », accueil et administration. */

:root {
    color-scheme: light dark;
    --bg: #f6f7f9;
    --card: #fff;
    --text: #1d2330;
    --muted: #5c6577;
    --line: #d9dde5;
    --accent: #1f4fd8;
    --on-accent: #fff;
    --danger: #b42318;
    --success: #067647;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12151c;
        --card: #1b2029;
        --text: #e8ebf1;
        --muted: #a1a9b8;
        --line: #2e3542;
        --accent: #6c93ff;
        --on-accent: #0b1020;
        --danger: #ff8a80;
        --success: #75e0a7;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    padding: 1.5rem;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
    width: 100%;
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 2rem;
}

/* Une carte étroite au centre de la page : connexion, accord, « aucun accès », accueil. */
body.card { display: grid; place-items: center; }
body.card main { max-width: 28rem; }

/* Une page large, en haut de l'écran : l'administration. */
body.wide main { max-width: 72rem; }

h1 { font-size: 1.25rem; line-height: 1.35; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; line-height: 1.35; margin: 1.5rem 0 .75rem; }
p, ul { margin: 0 0 1rem; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: .9rem; }

label { display: block; font-weight: 600; margin-bottom: .25rem; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; font-weight: 400; }

input[type=email], input[type=password], input[type=text], input[type=search], select, textarea {
    width: 100%;
    padding: .6rem .75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
}

button, a.button {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    padding: .6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

button { border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); }
button.secondary, a.button { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }

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

.actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.alert { border: 1px solid var(--danger); color: var(--danger); border-radius: 8px; padding: .6rem .75rem; margin-bottom: 1rem; }
.notice { border: 1px solid var(--success); color: var(--success); border-radius: 8px; padding: .6rem .75rem; margin-bottom: 1rem; }

/* Administration : navigation, tableaux, filtres. */
nav.admin { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; padding-bottom: 1rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
nav.admin a { color: var(--text); text-decoration: none; font-weight: 600; }
nav.admin a[aria-current=page] { color: var(--accent); }
nav.admin form { margin-left: auto; }

table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
th, td { text-align: left; vertical-align: top; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }

.filters { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; margin-bottom: 0; }

.folder-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .25rem .75rem; margin: .5rem 0 1rem; }
.folder-choices[hidden] { display: none; }
details { margin-bottom: 1rem; }
summary { cursor: pointer; color: var(--accent); margin-bottom: .5rem; }
code { font-size: .9em; }
.badge { display: inline-block; font-size: .8rem; padding: .05rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
