/* ===== POLICE (hébergée localement : aucun appel à Google) ===== */
@font-face {
    font-family: 'Mountains of Christmas';
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url('fonts/MountainsOfChristmas-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Mountains of Christmas';
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url('fonts/MountainsOfChristmas-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Nunito';
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url('fonts/Nunito-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Nunito';
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url('fonts/Nunito-700.woff2') format('woff2');
}

/* ===== ARRIÈRE-PLAN ===== */
body {
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background-color: #f9f2f2;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: radial-gradient(circle at 15% 0%, #ffffff 0, #fbe9e9 40%, #ecc9c9 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* ===== CONTAINERS ===== */
.container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    border: 3px solid #d62828;
}

.box {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 10px;
    border: 2px dashed #d62828;
    margin-bottom: 20px;
}

/* ===== TITRES ===== */
h1, h2 {
    font-family: 'Mountains of Christmas', cursive;
    color: #d62828;
    font-size: 2em;
    margin-bottom: 15px;
}

h1 {
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===== FORMULAIRES ===== */
form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin: 0 auto;
    width: fit-content;
}

form label {
    font-weight: bold;
    font-size: 1.1em;
}

form input[type="text"],
form input[type="number"] {
    padding: 8px;
    border: 2px solid #d62828;
    border-radius: 5px;
    width: 200px;
    font-family: inherit;
}

.code-input {
    width: 200px;
}

/* ===== TABLEAUX ===== */
.box table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px auto;
}

.box th, .box td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.box th {
    background-color: #f2f2f2;
}

/* ===== BOUTONS ===== */
input[type="submit"],
button,
a.button {
    padding: 8px 15px;
    background-color: #d62828;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
    margin: 5px;
}

input[type="submit"]:hover,
button:hover,
a.button:hover {
    background-color: #f77f00;
}

/* Boutons spécifiques */
.delete-button {
    background-color: #d62828;
}

.edit-button {
    background-color: #f77f00;
}

.draw-button {
    background-color: #006400;
}

.regen-button {
    background-color: #00008B;
}

.download-button {
    background-color: #006400;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    display: inline-block;
}

.download-button:hover {
    background-color: #008000;
}

/* Groupe de boutons */
.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px auto;
}

/* ===== IMAGES ===== */
.letter-container {
    margin: 20px auto;
    max-width: 100%;
    overflow: hidden;
}

.letter-image {
    box-sizing: border-box;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: 3px solid #d62828;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* ===== ALERTES ===== */
.alert-box {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}

.success {
    background-color: #dff0d8;
    color: #3c763d;
}

.error {
    background-color: #f2dede;
    color: #a94442;
}

/* ===== FLOCONS DE NEIGE ===== */
.snowflakes {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    top: 0;
    left: 0;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    color: white;
    font-size: 1.5em;
    animation: fall linear infinite;
    opacity: 0.8;
}

.snowflake:nth-child(1) { left: 6%;  animation-duration: 11s; animation-delay: 0s;  font-size: 1.3em; }
.snowflake:nth-child(2) { left: 22%; animation-duration: 15s; animation-delay: 3s;  font-size: 1em; }
.snowflake:nth-child(3) { left: 38%; animation-duration: 12s; animation-delay: 6s;  font-size: 1.6em; }
.snowflake:nth-child(4) { left: 55%; animation-duration: 17s; animation-delay: 1s;  font-size: 1.1em; }
.snowflake:nth-child(5) { left: 72%; animation-duration: 13s; animation-delay: 4s;  font-size: 1.4em; }
.snowflake:nth-child(6) { left: 90%; animation-duration: 16s; animation-delay: 8s;  font-size: 1.2em; }

@media (prefers-reduced-motion: reduce) {
    .snowflake { animation: none; display: none; }
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
    }
}



/* ===== AJOUTS v2 ===== */
.small { font-size: 0.85em; color: #555; }
.privacy { margin-top: 20px; }
code { font-family: monospace; background: #f2f2f2; padding: 1px 6px; border-radius: 4px; letter-spacing: 1px; }
.snippet { text-align: left; background: #f2f2f2; padding: 10px; border-radius: 6px; overflow-x: auto; font-size: 0.8em; white-space: pre-wrap; word-break: break-all; }

form.inline { display: inline-block; width: auto; margin: 0; }
td.actions { white-space: nowrap; }
form.logout { margin: 10px auto 0; }

form input[type="password"],
form select {
    padding: 8px;
    border: 2px solid #d62828;
    border-radius: 5px;
    width: 220px;
    font-family: inherit;
}

.settings-form { width: 100%; max-width: 420px; align-items: stretch; text-align: left; }
.settings-form input[type="text"],
.settings-form select { width: 100%; box-sizing: border-box; }
.settings-form input[type="range"] { width: 100%; }
.settings-form input[type="color"] { width: 60px; height: 36px; padding: 0; border: 2px solid #d62828; border-radius: 5px; }
.settings-form output { font-weight: normal; color: #555; font-size: 0.9em; }

/* ===== ÉDITEUR DE LETTRE (v2.1) ===== */
.box h3 { color: #006400; font-size: 1.2em; margin: 18px 0 8px; text-align: left; }
.suggestions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
button.suggestion { background-color: #006400; }
button.suggestion:hover { background-color: #008000; }
.insert-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
button.tag { background-color: #f77f00; padding: 4px 10px; margin: 0; font-family: monospace; }
.settings-form textarea {
    width: 100%; box-sizing: border-box; padding: 8px; border: 2px solid #d62828; border-radius: 5px;
    font-family: inherit; font-size: 1em; resize: vertical;
}
.settings-form details { border: 1px dashed #d62828; border-radius: 6px; padding: 8px 10px; }
.settings-form details > summary { cursor: pointer; font-weight: bold; margin-bottom: 6px; }
.settings-form details[open] { display: flex; flex-direction: column; gap: 10px; }
.settings-form details[open] > summary { margin-bottom: 0; }


/* ===== ADMIN : ONGLETS (v2.2) ===== */
.container.wide { max-width: 1180px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center;
        margin: 0 0 20px; padding-bottom: 14px; border-bottom: 2px solid #f0c7c7; }
.tabs a.tab { padding: 9px 20px; border-radius: 999px; background: #fff; color: #d62828; margin: 0;
              border: 2px solid #d62828; text-decoration: none; font-weight: 700; transition: background-color .2s; }
.tabs a.tab:hover { background: #fde8e8; }
.tabs a.tab.active { background: #d62828; color: #fff; }
.tabs form.logout { margin: 0 0 0 auto; }
.tabs form.logout input[type="submit"] { margin: 0; background: #777; padding: 7px 14px; }
.tabs form.logout input[type="submit"]:hover { background: #444; }
.statusline { display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: .9em; font-weight: 700; margin: 0 0 14px; text-decoration: none; }
.statusline.ok { background: #e2f5e6; color: #1b6b2f; }
.statusline.warn { background: #fdeaea; color: #9b1c1c; }
.statusline.none { background: #eee; color: #555; }
.box h2 { margin-top: 0; }

/* Éditeur de lettre : formulaire à gauche, aperçu fixe à droite */
.letter-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; text-align: left; }
.letter-layout .settings-form { max-width: none; }
.letter-preview-col { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 8px; }
.letter-preview-col .letter-image { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.letter-preview-col input[type="text"] { width: 100%; box-sizing: border-box; padding: 8px; border: 2px solid #d62828; border-radius: 5px; font-family: inherit; }
.letter-preview-col input[type="submit"] { margin: 4px 0 0; padding: 12px; font-size: 1.05em; }
.settings-form details.section { border: 1px solid #e3b5b5; background: #fff8f8; border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; }
.settings-form details.section > summary { font-size: 1.1em; color: #b01f1f; }
.settings-form details.section[open] > summary { margin-bottom: 8px; }
@media (max-width: 900px) {
    .letter-layout { grid-template-columns: 1fr; }
    .letter-preview-col { position: static; }
    .tabs form.logout { margin: 0; }
}

/* Tableau des participants : défilement de secours + version téléphone */
.table-wrap { overflow-x: auto; }
@media (max-width: 600px) {
    .container { padding: 14px; margin: 10px; }
    .col-id { display: none; }
    .box th, .box td { padding: 6px 4px; }
    td.actions { white-space: normal; }
    td.actions a.button, td.actions form.inline { display: block; margin: 3px 0; }
    td.actions .button { text-align: center; padding: 6px 10px; }
}

/* ===== ENVOI DES CODES (v2.3) ===== */
[hidden] { display: none !important; }
.row-actions .button, .row-actions form.inline { margin: 2px 2px; }
.row-actions .button { padding: 5px 10px; font-size: .85em; text-decoration: none; display: inline-block; }
.row-actions .button[disabled], input.button[disabled] { opacity: .45; cursor: not-allowed; }
.msg-preview { text-align: left; white-space: pre-wrap; background: #f7f7f7; border: 1px solid #ddd; border-radius: 6px;
               padding: 10px 12px; font-family: inherit; font-size: .95em; }
form.inline-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: 10px 0; }
form.inline-form input[type="email"], form.inline-form input[type="text"] { padding: 8px; border: 2px solid #d62828; border-radius: 5px; width: 240px; font-family: inherit; }
.settings-form input[type="email"], .settings-form input[type="tel"] { width: 100%; box-sizing: border-box; }
form input[type="email"], form input[type="tel"] { padding: 8px; border: 2px solid #d62828; border-radius: 5px; width: 220px; font-family: inherit; }
#msg-form { max-width: 680px; }

/* ===== ASSISTANT D'ENVOI ET SUIVI (v2.4) ===== */
.stats { margin: 6px 0 10px; }
progress.progress { width: 100%; height: 14px; margin: 8px 0 2px; accent-color: #2e8b57; }
.box h3.assist-name { text-align: center; font-size: 1.6em; margin: 14px 0 0; color: #b01f1f; }
.assist-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 12px 0; }
.assist-actions .button { width: min(100%, 420px); box-sizing: border-box; padding: 14px 18px; font-size: 1.05em; text-align: center; text-decoration: none; margin: 0; }
form.assist-form { margin: 10px 0; width: 100%; align-items: stretch; }
form.assist-form input.button { width: 100%; max-width: 420px; margin: 0 auto; box-sizing: border-box; padding: 14px 18px; font-size: 1.05em; }
input.assist-done { background-color: #2e8b57; font-weight: 700; }
input.assist-done:hover { background-color: #247247; }
.link-button { background: none !important; color: #777; padding: 0 4px; margin: 0; font-size: .9em; border: 0; cursor: pointer; }
.button-group { flex-wrap: wrap; }

/* ===== PLATEFORME ===== */
h2.event-title { margin: -8px 0 10px; color: #b01f1f; font-size: 1.35em; }
.hero { text-align: center; margin: 8px 0 18px; }
.hero p.lead { font-size: 1.15em; margin: 8px auto 16px; max-width: 34em; }
.steps { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 14px 0; padding: 0; list-style: none; }
.steps li { flex: 1 1 200px; max-width: 250px; background: #fff8f8; border: 1px solid #e3b5b5; border-radius: 10px; padding: 12px; }
.steps li strong { display: block; color: #b01f1f; font-size: 1.05em; margin-bottom: 4px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.linkbox { word-break: break-all; text-align: left; background: #f7f7f7; border: 1px solid #ddd; border-radius: 6px; padding: 10px 12px; font-family: monospace; font-size: .9em; }
.legal { text-align: left; }
.legal h2 { text-align: left; font-size: 1.3em; }
.legal ul { padding-left: 1.2em; }

/* ===== COMPTES (v1.2) ===== */
form.auth-form { width: 100%; max-width: 380px; align-items: stretch; gap: 6px; margin: 10px auto; text-align: left; }
form.auth-form label { font-size: 1em; font-weight: 600; margin-top: 6px; }
form.auth-form label .small { font-weight: 400; }
form.auth-form input[type="email"], form.auth-form input[type="password"], form.auth-form input[type="text"], form.auth-form input[type="date"] {
    width: 100%; box-sizing: border-box; padding: 10px; font-size: 1em; border: 2px solid #d62828; border-radius: 5px; font-family: inherit; background: #fff; }
form.auth-form input:focus { outline: 3px solid #f7bcbc; outline-offset: 1px; }
form.auth-form input[type="submit"] { width: 100%; margin: 14px 0 0; padding: 12px 15px; font-size: 1.05em; box-sizing: border-box; }
form.auth-form label.check-label { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: .92em; line-height: 1.4; margin-top: 10px; }
form.auth-form label.check-label input { width: 18px; height: 18px; flex-shrink: 0; margin: 1px 0 0; accent-color: #d62828; }
.box p.small { text-align: center; }
.box h2 + p, .box h2 + .alert-box { margin-top: 4px; }

.event-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.event-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; text-align: left;
              background: #fff8f8; border: 1px solid #e3b5b5; border-radius: 10px; padding: 12px 14px; }
.event-info { flex: 1 1 220px; min-width: 0; }
.event-info strong { display: block; font-size: 1.1em; color: #b01f1f; overflow-wrap: anywhere; }
.event-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; font-size: .88em; color: #555; }
.event-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.event-actions form { margin: 0; width: auto; }
.event-actions input[type="submit"] { margin: 0; }
details.delete-event { font-size: .88em; color: #777; }
details.delete-event summary { cursor: pointer; padding: 4px 2px; }
details.delete-event form { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
details.delete-event label { font-size: 1em; font-weight: 400; }
@media (max-width: 520px) { .event-actions { width: 100%; } .event-actions form:first-child { flex: 1; } .event-actions form:first-child input { width: 100%; } }
.tabs { margin-bottom: 14px; }
form.auth-form input.delete-button, details.delete-event input.delete-button { background: #fff; color: #b01f1f; border: 2px solid #b01f1f; }
form.auth-form input.delete-button:hover, details.delete-event input.delete-button:hover { background: #b01f1f; color: #fff; }
.back-link { text-align: left; margin: 0 0 8px; font-size: .95em; }
.stats-line { list-style: none; margin: 8px 0; padding: 0; flex-direction: column; font-size: .95em; text-align: left; }
form.auth-form select { width: 100%; box-sizing: border-box; padding: 10px; font-size: 1em; border: 2px solid #d62828; border-radius: 5px; font-family: inherit; background: #fff; }

/* ===== Page de téléchargement ===== */
.feature-list, .install-steps { text-align: left; margin: 10px 0; padding-left: 1.3em; line-height: 1.5; }
.feature-list { list-style: none; padding-left: 0; }
.feature-list li { margin-bottom: 10px; }
.install-steps li { margin-bottom: 8px; }
.shots { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 14px; }
.shots img { max-width: 100%; height: auto; max-height: 340px; width: auto; border: 1px solid #e3b5b5; border-radius: 8px; background: #fff; }
.checksum { overflow-wrap: anywhere; word-break: break-all; font-size: .85em; background: #f7f7f7; border-radius: 6px; padding: 8px 10px; }
.free-box { margin-top: 18px; }
