:root {
    /* Thème Marché de Noël */
    --primary: #b3202b;
    --primary-hover: #8f1922;
    --primary-light: #fbeaea;
    --primary-ring: rgba(179,32,43,.15);
    --success: #1f6b45;
    --success-light: #e7f3ec;
    --gold: #c9a227;
    --gold-light: #fbf4dc;
    --danger: #c0392b;
    --muted: #888;
    --border: #e0e0e0;
    --card-bg: #fff;
    --header-bg: linear-gradient(135deg, #8c1a24 0%, #a3222d 45%, #1f5a3c 100%);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: #fbf7f0;
    color: #2d2d2d;
    margin: 0;
    min-height: 100vh;
}

/* ── Header public ── */
.site-header {
    background: var(--header-bg);
    color: #fff;
    padding: 2.5rem 1.5rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid var(--gold);
}
.site-header::before {
    content: '🎄 ❄️ ⭐ 🎁 ❄️ 🎄';
    position: absolute;
    top: 0.5rem;
    left: 0;
    right: 0;
    font-size: 1.2rem;
    opacity: 0.35;
    letter-spacing: 1.5rem;
    white-space: nowrap;
}
/* Neige légère en pur CSS */
.site-header::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,.9) 50%, transparent 51%),
        radial-gradient(2px 2px at 90px 70px, rgba(255,255,255,.7) 50%, transparent 51%),
        radial-gradient(3px 3px at 150px 20px, rgba(255,255,255,.8) 50%, transparent 51%),
        radial-gradient(2px 2px at 60px 110px, rgba(255,255,255,.6) 50%, transparent 51%),
        radial-gradient(3px 3px at 180px 90px, rgba(255,255,255,.7) 50%, transparent 51%);
    background-size: 200px 130px;
    animation: snow 12s linear infinite;
}
@keyframes snow {
    from { background-position: 0 0; }
    to   { background-position: 40px 130px; }
}
@media (prefers-reduced-motion: reduce) {
    .site-header::after { animation: none; }
}
.header-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.header-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .header-inner { flex-direction: column; gap: 0.75rem; }
    .header-logo { width: 70px; height: 70px; }
}

.site-header h1 {
    margin: 0 0 0.25rem;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.site-header .subtitle {
    opacity: 0.9;
    font-size: 1.05rem;
    margin: 0;
}

/* ── Layout ── */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

main.container {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* ── Cards ── */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border-top: 3px solid var(--gold);
}

.card h2 {
    margin: 0 0 1.25rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.6rem;
}

/* ── Form ── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 580px) {
    .form-grid { grid-template-columns: 1fr; }
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.field.full { grid-column: 1 / -1; }

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #444;
}

label .req { color: var(--primary); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color .15s;
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.field-hint {
    font-size: 0.78rem;
    color: var(--muted);
}

.field-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.1rem;
}

/* ── Stands grid ── */
.choice-intro {
    background: var(--gold-light);
    border: 1px solid #ecd98f;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #4a3b00;
}
.stands-group {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.1rem 1.25rem;
    background: #fffdfa;
}
.choice-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--success);
    background: var(--success-light);
    border-radius: 20px;
    padding: 0.15rem 0.55rem;
    order: 2;
    white-space: nowrap;
    flex-shrink: 0;
}
.choice-sep {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.choice-sep::before, .choice-sep::after {
    content: '';
    flex: 1;
    border-top: 2px dashed var(--gold);
}
.choice-sep span {
    background: var(--primary-light);
    border: 1.5px solid var(--primary);
    border-radius: 20px;
    padding: 0.2rem 0.9rem;
}
.stands-group-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.stands-group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    order: 1;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem;
}

.slot-card {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    position: relative;
    background: #fff;
}

.slot-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

/* Case à cocher visible */
.slot-card { padding-right: 2.6rem; }
.slot-check {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 1.3rem;
    height: 1.3rem;
    border: 2px solid #c7c2ba;
    border-radius: 5px;
    background: #fff;
    transition: background .15s, border-color .15s;
}
.slot-card:hover .slot-check { border-color: var(--primary); }
.slot-card:has(input:checked) .slot-check {
    background: var(--primary);
    border-color: var(--primary);
}
.slot-card:has(input:checked) .slot-check::after {
    content: '';
    position: absolute;
    left: 0.36rem;
    top: 0.12rem;
    width: 0.3rem;
    height: 0.62rem;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
.slot-card:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--primary-ring); }
.slot-card.full .slot-check { display: none; }

.slot-card.full {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.slot-card input[type="radio"],
.slot-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.slot-card .slot-label {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.slot-card .slot-time {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.slot-card .slot-position {
    font-size: 0.83rem;
    color: #666;
    margin-bottom: 0.35rem;
}

.slot-card .slot-availability {
    font-size: 0.78rem;
    font-weight: 600;
}

.slot-availability.available { color: var(--success); }
.slot-availability.last { color: #e68a00; }
.slot-availability.full-label { color: var(--danger); }

.slot-card .slot-missing {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #7a5c00;
    background: var(--gold-light);
    border: 1px solid #ecd98f;
    border-radius: 20px;
    padding: 0.1rem 0.55rem;
    white-space: nowrap;
}

.day-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 1rem 0 0.5rem;
}
.day-title:first-of-type { margin-top: 0.25rem; }

/* ── Consignes ── */
.card-consignes { background: #fffdf8; }
.consignes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 760px) {
    .consignes-grid { grid-template-columns: 1fr; gap: 0.9rem; }
}
.consigne {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.consigne-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}
.consigne strong { color: #2d2d2d; }
.consigne > div > strong:first-child {
    display: block;
    color: var(--primary);
    margin-bottom: 0.2rem;
}
.consigne p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #555;
}

.card-rgpd {
    background: #f8f9fb;
    border: 1px solid #e0e4ea;
    border-top: 3px solid var(--gold);
}
.card-rgpd h2 { color: #475569; }

.badge-full {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    background: #ddd;
    color: #777;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.conflict-msg {
    font-size: 0.75rem;
    color: #c0392b;
    font-weight: 600;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid #fcd0cc;
}

.slot-registrants {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

.registrant-chip {
    display: inline-block;
    font-size: 0.75rem;
    background: #f0f0f0;
    color: #555;
    border-radius: 20px;
    padding: 0.15rem 0.55rem;
    font-weight: 500;
}

.slot-card.full .registrant-chip {
    background: #e8e8e8;
    color: #777;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, transform .1s;
    text-decoration: none;
}

.btn:active { transform: scale(.98); }

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

.btn-secondary {
    background: #eee;
    color: #333;
}
.btn-secondary:hover { background: #e0e0e0; }

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

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
}

/* ── Alerts ── */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}
.alert-error {
    background: #fdecea;
    border: 1px solid #f5c6c1;
    color: var(--danger);
}
.alert-success {
    background: var(--success-light);
    border: 1px solid #a8d5be;
    color: var(--success);
}

/* ── Confirmation page ── */
.confirmation-box {
    text-align: center;
    padding: 3rem 2rem;
}
.confirmation-box .icon { font-size: 4rem; margin-bottom: 1rem; }
.confirmation-box h2 { color: var(--success); font-size: 1.75rem; margin-bottom: 0.5rem; }
.confirmation-detail {
    background: var(--success-light);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem auto;
    max-width: 420px;
    text-align: left;
}
.confirmation-detail p { margin: 0.3rem 0; }
.confirmation-detail strong { color: var(--success); }
.confirmation-step { font-weight: 600; color: var(--success); }
.confirmation-consignes { text-align: left; margin: 1.5rem 0; }
.confirmation-consignes .card { box-shadow: none; border: 1px solid #eee; border-top: 3px solid var(--gold); margin-bottom: 0; }
.confirmation-consignes .consignes-grid { grid-template-columns: 1fr; }

/* ── Admin layout ── */
body.admin-body {
    background: #f0f2f5;
}

.admin-header {
    background: #1e293b;
    color: #fff;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-header .logo {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -.3px;
}

.admin-header .logo span { color: var(--primary); }

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

.admin-nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: background .15s, color .15s;
}

.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.admin-main {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.25rem;
}

.admin-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: 10px; }

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

thead tr { background: #f8fafc; }
th { font-weight: 700; color: #475569; text-align: left; }
th, td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
}
tbody tr:hover { background: #f8fafc; }

/* ── Dashboard badges ── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}
.badge-ok { background: var(--success-light); color: var(--success); }
.badge-warn { background: #fff3cd; color: #856404; }
.badge-full { background: #fdecea; color: var(--danger); }
.badge-missing { background: var(--gold-light); color: #7a5c00; }

/* ── Admin form ── */
.admin-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.slot-row {
    display: grid;
    grid-template-columns: 1fr 130px 100px 100px 1fr 70px 60px 36px;
    gap: 0.6rem;
    align-items: end;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.slot-row:last-child { border-bottom: none; }

.btn-remove-slot {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.3rem;
    border-radius: 4px;
}
.btn-remove-slot:hover { background: #fdecea; }

#slots-header {
    display: grid;
    grid-template-columns: 1fr 130px 100px 100px 1fr 70px 60px 36px;
    gap: 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 0 0 0.4rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.5rem;
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.82rem;
}

/* ── Misc ── */
.text-muted { color: var(--muted); font-size: 0.9rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.flex { display: flex; align-items: center; gap: 0.75rem; }
.spacer { flex: 1; }
.no-slots { color: var(--muted); font-style: italic; padding: 1rem 0; }

@media print {
    .admin-header, .admin-nav, .btn, form { display: none !important; }
    body { background: #fff; }
    table { font-size: 11pt; }
}
