/*
 * Thème provisoire sombre en attendant la DA.
 * Pour appliquer la DA : modifier uniquement les variables ci-dessous.
 */
:root {
    --bg: #0b0b0d;
    --surface: #16161a;
    --surface-2: #1f1f25;
    --border: #2c2c34;
    --text: #f4f4f6;
    --text-muted: #9a9aa6;
    --accent: #e0365a;          /* rose Sosh (logo) */
    --accent-hover: #f04a6d;
    --danger: #ff6b6b;
    --radius: 14px;
    --font-title: 'Sosh Black', system-ui, sans-serif;
    --font-body: 'Sosh Medium', system-ui, sans-serif;
}

@font-face { font-family: 'Sosh Black'; src: url("../fonts/Sosh-Black-T8Uu0Un.otf") format('opentype'); font-display: swap; }
@font-face { font-family: 'Sosh Medium'; src: url("../fonts/Sosh-Medium-_RZSBpi.otf") format('opentype'); font-display: swap; }

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

html, body { overflow-x: hidden; }
body {
    margin: 0;
    background: radial-gradient(1200px 500px at 50% -200px, #2a0f17 0%, var(--bg) 60%) fixed, var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.site-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    max-width: 760px; margin: 0 auto; padding: 1.25rem 1.25rem .5rem;
}
.site-header .logo { width: 96px; height: auto; display: block; }
.site-header .event { font-family: var(--font-title); text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; color: var(--text-muted); }

.container { max-width: 760px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
.admin .container, .admin .site-header { max-width: 1200px; }

h1 { font-family: var(--font-title); font-size: clamp(1.6rem, 5vw, 2.3rem); line-height: 1.1; margin: .5rem 0 1.25rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.1rem, 4vw, 2rem); }

.lead { font-family: var(--font-title); margin: 0 0 1rem; }
.muted { color: var(--text-muted); }

/* Champs */
.fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.fields-2 { margin-top: 1.5rem; }
@media (min-width: 600px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.form-row, .fields > div { display: flex; flex-direction: column; gap: .35rem; }
label { font-size: .9rem; color: var(--text-muted); }

input[type=text], input[type=email], input[type=tel], input[type=date] {
    width: 100%; min-width: 0; min-height: 3rem; padding: .8rem .9rem; -webkit-appearance: none; appearance: none; font: inherit; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
    color-scheme: dark; transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(224 54 90 / .25); }
input[readonly] { color: var(--text-muted); cursor: not-allowed; }

/* Cases à cocher */
.check { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; margin: 1rem 0 .25rem;
         background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.check input { appearance: none; flex: 0 0 22px; width: 22px; height: 22px; margin: 1px 0 0;
               border: 2px solid var(--text-muted); border-radius: 6px; background: transparent; cursor: pointer; display: grid; place-content: center; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.check label { color: var(--text); font-size: .95rem; cursor: pointer; }
.has-error, .check.has-error { border-color: var(--danger); }

/* Texte juridique */
.legal { overflow-wrap: anywhere; color: #cfcfd6; font-size: .92rem; margin-top: 1.5rem; }
.legal p { margin: 0 0 .9rem; }
.legal strong { color: var(--text); }

/* Erreurs */
ul:has(> li) { list-style: none; padding: 0; margin: .3rem 0 0; }
.fields ul li, .form-row ul li, .check + ul li, .signature ul li, form > ul li { color: var(--danger); font-size: .85rem; }
.alert { background: rgb(255 107 107 / .1); border: 1px solid var(--danger); color: var(--danger); padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1.25rem; }

/* Signature */
.signature { margin-top: 1.5rem; }
.signature-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; color: var(--text-muted); font-size: .9rem; }
.signature canvas { display: block; width: 100%; height: 180px; background: #fff; border-radius: 10px; border: 2px solid var(--border); touch-action: none; cursor: crosshair; }
.signature.has-error canvas { border-color: var(--danger); }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* Boutons */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: .5rem; margin-top: 1.75rem; width: 100%;
       padding: 1rem 1.5rem; font-family: var(--font-title); font-size: 1.1rem; text-transform: uppercase; letter-spacing: .04em;
       color: #fff; background: var(--accent); border: 0; border-radius: 999px; cursor: pointer; text-decoration: none; transition: background .15s, transform .1s; }
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; border: 2px solid var(--accent); }
.btn-ghost:hover { background: rgb(224 54 90 / .12); }

.merci { text-align: center; padding-block: 3rem; }

/* Bandeau démo des variantes */
.demo-switch { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; }
.demo-switch a { color: var(--text); text-decoration: none; padding: .35rem .8rem; border: 1px solid var(--border); border-radius: 999px; }
.demo-switch a.active { background: var(--accent); border-color: var(--accent); }

/* Admin */
.count { display: inline-block; vertical-align: middle; font-size: .9rem; background: var(--accent); border-radius: 999px; padding: .1rem .7rem; margin-left: .4rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.actions .btn { width: auto; margin: 0; font-size: .9rem; padding: .75rem 1.25rem; }
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-muted); font-weight: normal; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
td a { color: var(--accent); }

/* Connexion admin */
.login-page .site-header { display: none; }
.login-page .container { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding-block: 2rem; }
.login { width: 100%; max-width: 420px; text-align: center; }
.login .fields, .login .alert { text-align: left; }
.login-logo { display: block; width: 150px; height: auto; margin: .5rem auto 1rem; transform: rotate(-2deg); }
.login-event { font-family: var(--font-title); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--text-muted); margin: 0 0 1.25rem; }
.login h1 { margin: 0 0 .75rem; }
.login .muted { margin: -.5rem 0 1.5rem; }
.fields-stack { grid-template-columns: minmax(0, 1fr) !important; margin-bottom: 0; }
input[type=password] {
    width: 100%; min-width: 0; min-height: 3rem; padding: .8rem .9rem; font: inherit; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color-scheme: dark;
}
.btn-logout { margin-left: auto !important; border-color: var(--border); }
