/* ============================================================
   SuperMarc — style.css
   Thèmes : jour (défaut), nuit, noel, anniversaire
   ============================================================ */

/* ── Variables : thème jour ─────────────────────────────── */
:root {
    --bleu:       #4A90C4;
    --orange:     #F5A623;
    --rouge:      #D0021B;
    --noir:       #1A1A1A;
    --fond:       #F7F5F0;
    --fond-carte: #FFFFFF;
    --texte:      #1A1A1A;
    --texte-doux: #666666;
    --bordure:    #E0DDD8;
    --succes:     #2E7D32;
    --erreur:     #C62828;
    --ombre:      0 2px 8px rgba(0,0,0,0.08);
    --rayon:      10px;
    --transition: 0.25s ease;
}

/* ── Thème nuit ─────────────────────────────────────────── */
:root[data-theme="nuit"],
@media (prefers-color-scheme: dark) { :root:not([data-theme]) } {
    --fond:       #1C1E26;
    --fond-carte: #252830;
    --texte:      #EDEAE4;
    --texte-doux: #9A9694;
    --bordure:    #383B45;
    --ombre:      0 2px 8px rgba(0,0,0,0.3);
}

:root[data-theme="nuit"] {
    --fond:       #1C1E26;
    --fond-carte: #252830;
    --texte:      #EDEAE4;
    --texte-doux: #9A9694;
    --bordure:    #383B45;
    --ombre:      0 2px 8px rgba(0,0,0,0.3);

    /* Variables Roland en mode nuit */
    --bg:      #1a1c24;
    --surface: #252830;
    --border:  #383b45;
    --text:    #ede8e0;
    --muted:   #9a9290;
    --hl:      #2e3040;
    --accent:  #c45a3a;
    --accent2: #e07a50;
    --vert:    #4a8a60;
    --vert-bg: #1e2e24;
    --vert-border: #2e4a38;
}

/* ── Thème Noël ─────────────────────────────────────────── */
:root[data-theme="noel"] {
    --bleu:       #1A5C38;
    --orange:     #FFD700;
    --rouge:      #C41E3A;
    --fond:       #F0F7F0;
    --fond-carte: #FFFFFF;
    --bordure:    #B8D4B8;
}

/* ── Thème anniversaire ─────────────────────────────────── */
:root[data-theme="anniversaire"] {
    --bleu:       #7B2FBE;
    --orange:     #FF6B9D;
    --rouge:      #FF4500;
    --fond:       #FFF9FE;
    --fond-carte: #FFFFFF;
    --bordure:    #E8C8F0;
}

/* ── Reset & base ───────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--fond);
    color: var(--texte);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition), color var(--transition);
}

/* ── Typographie ────────────────────────────────────────── */
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; line-height: 1.2; }
h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }

p  { margin-bottom: 0.75rem; }
a  { color: var(--bleu); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout principal ───────────────────────────────────── */
.conteneur {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.conteneur--etroit {
    max-width: 480px;
}

/* ── En-tête ────────────────────────────────────────────── */
.entete {
    background-color: var(--fond-carte);
    border-bottom: 3px solid var(--bleu);
    box-shadow: var(--ombre);
    position: sticky;
    top: 0;
    z-index: 100;
}

.entete__interieur {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.entete__logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--texte);
    text-decoration: none;
}

.entete__logo img {
    height: 40px;
    width: auto;
}

.entete__nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Carte ──────────────────────────────────────────────── */
.carte {
    background-color: var(--fond-carte);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 1.5rem;
}

.carte--centree {
    margin: 2rem auto;
}

/* ── Formulaires ────────────────────────────────────────── */
.champ {
    margin-bottom: 1.1rem;
}

.champ label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: var(--texte);
}

.champ label .optionnel {
    font-weight: 400;
    color: var(--texte-doux);
    font-size: 0.82rem;
}

.champ input,
.champ select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--bordure);
    border-radius: var(--rayon);
    background-color: var(--fond-carte);
    color: var(--texte);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

.champ input:focus,
.champ select:focus {
    outline: none;
    border-color: var(--bleu);
    box-shadow: 0 0 0 3px rgba(74, 144, 196, 0.2);
}

.champ input::placeholder {
    color: var(--texte-doux);
}

.champ select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.2rem;
    cursor: pointer;
}

.champ__erreur {
    color: var(--erreur);
    font-size: 0.82rem;
    margin-top: 0.3rem;
    display: none;
}

.champ--invalide input,
.champ--invalide select {
    border-color: var(--erreur);
}

.champ--invalide .champ__erreur {
    display: block;
}

/* ── Boutons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: var(--rayon);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
    text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn--principal {
    background-color: var(--bleu);
    color: #fff;
    width: 100%;
    padding: 0.8rem;
    font-size: 1.05rem;
}

.btn--principal:hover {
    background-color: #3a7ab0;
    box-shadow: 0 4px 12px rgba(74, 144, 196, 0.35);
}

.btn--discret {
    background: none;
    color: var(--texte-doux);
    border: 1px solid var(--bordure);
    padding: 0.4rem 0.8rem;
    font-size: 0.88rem;
}

.btn--discret:hover {
    background-color: var(--fond);
    color: var(--texte);
}

/* ── Toggle thème ───────────────────────────────────────── */
.toggle-theme {
    background: none;
    border: 1px solid var(--bordure);
    border-radius: 20px;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--texte-doux);
    transition: all var(--transition);
    line-height: 1;
}

.toggle-theme:hover {
    border-color: var(--bleu);
    color: var(--texte);
}

/* ── Messages flash ─────────────────────────────────────── */
.flash {
    padding: 0.8rem 1rem;
    border-radius: var(--rayon);
    margin-bottom: 1rem;
    font-size: 0.92rem;
    font-weight: 500;
}

.flash--succes {
    background-color: #E8F5E9;
    color: var(--succes);
    border-left: 4px solid var(--succes);
}

.flash--erreur {
    background-color: #FFEBEE;
    color: var(--erreur);
    border-left: 4px solid var(--erreur);
}

/* ── Séparateur texte ───────────────────────────────────── */
.separateur {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.2rem 0;
    color: var(--texte-doux);
    font-size: 0.85rem;
}

.separateur::before,
.separateur::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--bordure);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .carte { padding: 1.1rem; }
    .entete__logo span { display: none; } /* garde uniquement le logo image sur mobile */
}

/* ── Thème Noël : éléments décoratifs ───────────────────── */
[data-theme="noel"] body::before {
    content: '🎄';
    position: fixed;
    top: 70px;
    right: 12px;
    font-size: 1.4rem;
    opacity: 0.4;
    pointer-events: none;
}

/* ── Thème anniversaire : éléments décoratifs ───────────── */
[data-theme="anniversaire"] body::before {
    content: '🎉';
    position: fixed;
    top: 70px;
    right: 12px;
    font-size: 1.4rem;
    opacity: 0.4;
    pointer-events: none;
}

/* ── Accessibilité ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}

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