:root {
    --violet: #8e3a8c;
    --violet-fonce: #6a2370;
    --violet-pale: #f6eef6;
    --texte: #2a1a2c;
    --gris: #6f6472;
    --bord: #e2d6e3;
    --erreur: #b42318;
    --ok: #1f7a4d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--texte);
    background:
        radial-gradient(1200px 600px at 10% -10%, #efdcef 0%, transparent 60%),
        radial-gradient(900px 500px at 110% 110%, #e8d2ea 0%, transparent 60%),
        #faf6fa;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px;
}

.card {
    width: 100%;
    max-width: 560px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px -20px rgba(106, 35, 112, .35);
    padding: 28px 28px 32px;
}

.head { text-align: center; margin-bottom: 20px; }
.logo { width: 190px; height: auto; display: block; margin: -10px auto -14px; }

h1 {
    font-family: "Playfair Display", Georgia, serif;
    color: var(--violet-fonce);
    font-size: 1.9rem;
    margin: 0 0 8px;
}
.intro { color: var(--gris); margin: 0; line-height: 1.5; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; gap: 0; } }

.field { margin-bottom: 14px; }

label { font-weight: 500; font-size: .92rem; display: block; margin-bottom: 6px; }
.req { color: var(--violet); }
.opt { color: var(--gris); font-weight: 400; }

input[type=text], input[type=tel], input[type=email], input[type=date], input[type=password], textarea {
    width: 100%;
    font: inherit;
    padding: 11px 13px;
    border: 1.5px solid var(--bord);
    border-radius: 10px;
    background: #fff;
    color: var(--texte);
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgba(142, 58, 140, .15);
}
[aria-invalid=true] { border-color: var(--erreur); }

.hint { margin: 4px 0 0; text-align: right; font-size: .8rem; color: var(--gris); }
.err { margin: 5px 0 0; font-size: .85rem; color: var(--erreur); }

.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 400;
    line-height: 1.45;
    margin: 12px 0 0;
    cursor: pointer;
}
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--violet); flex: none; }

.btn {
    display: inline-block;
    width: 100%;
    margin-top: 22px;
    padding: 14px 18px;
    border: 0;
    border-radius: 12px;
    font: 600 1rem Inter, system-ui, sans-serif;
    color: #fff;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(135deg, var(--violet), var(--violet-fonce));
    cursor: pointer;
    transition: transform .1s, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .7; cursor: wait; }
.btn:focus-visible { outline: 3px solid rgba(142, 58, 140, .4); outline-offset: 2px; }

.note { text-align: center; font-size: .8rem; color: var(--gris); margin: 10px 0 0; }

.alert {
    background: #fdecea;
    color: var(--erreur);
    border-radius: 10px;
    padding: 11px 14px;
    margin-bottom: 16px;
    font-size: .92rem;
}

.success { text-align: center; padding: 8px 0; }
.success h2 { color: var(--ok); font-family: "Playfair Display", Georgia, serif; margin: 0 0 8px; }
.success p { color: var(--gris); line-height: 1.5; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Sexe : boutons radio en pastilles */
fieldset.radios { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.radios legend { font-weight: 500; font-size: .92rem; padding: 0; margin-bottom: 6px; }
.choices { display: flex; gap: 10px; }
.choice { margin: 0; flex: 1; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
    display: block;
    text-align: center;
    padding: 11px 13px;
    border: 1.5px solid var(--bord);
    border-radius: 10px;
    font-weight: 500;
    transition: border-color .15s, background .15s, color .15s;
}
.choice:hover span { border-color: var(--violet); }
.choice input:checked + span { border-color: var(--violet); background: var(--violet-pale); color: var(--violet-fonce); }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px rgba(142, 58, 140, .15); }

/* Téléphone : pays dans une case à part, numéro à droite */
.iti { display: flex; width: 100%; gap: 10px; }
.iti .iti__country-container {
    position: relative;
    padding: 0;
    flex: none;
    border: 1.5px solid var(--bord);
    border-radius: 10px;
    background: #fff;
}
.iti .iti__country-container:focus-within { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(142, 58, 140, .15); }
.iti .iti__selected-country { border-radius: 10px; padding: 0 12px; height: 100%; }
.iti .iti__selected-country:hover, .iti .iti__selected-country[aria-expanded=true] { background: var(--violet-pale); }
.iti .iti__selected-dial-code { color: var(--texte); font-weight: 500; }
.iti input.iti__tel-input { flex: 1 1 0; width: auto; min-width: 0 !important; padding-left: 13px !important; }
.iti__dropdown-content { border-radius: 10px; border: 1.5px solid var(--bord); box-shadow: 0 12px 30px -12px rgba(106, 35, 112, .35); }
.iti__country.iti__highlight { background: var(--violet-pale); }

/* Ville : liste avec recherche */
.combo { position: relative; }
.combo select { width: 100%; font: inherit; padding: 11px 13px; border: 1.5px solid var(--bord); border-radius: 10px; background: #fff; color: var(--texte); }
.combo-input {
    width: 100%;
    font: inherit;
    padding: 11px 36px 11px 13px;
    border: 1.5px solid var(--bord);
    border-radius: 10px;
    color: var(--texte);
    background: #fff 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 1.5l5 5 5-5' fill='none' stroke='%236f6472' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 13px center;
    transition: border-color .15s, box-shadow .15s;
}
.combo-input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(142, 58, 140, .15); }
.combo-list {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    margin: 0;
    padding: 6px;
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1.5px solid var(--bord);
    border-radius: 10px;
    box-shadow: 0 12px 30px -12px rgba(106, 35, 112, .35);
}
.combo-option { padding: 9px 10px; border-radius: 7px; cursor: pointer; }
.combo-option.is-active, .combo-option:hover { background: var(--violet-pale); color: var(--violet-fonce); }
.combo-autre { margin-top: 4px; border-top: 1px solid var(--bord); border-radius: 0 0 7px 7px; color: var(--gris); font-style: italic; }
.combo-empty { padding: 9px 10px; color: var(--gris); font-size: .9rem; }
.ville-autre { margin-top: 10px; }

/* Lien vers l'espace administrateur (coin de la carte) */
.card { position: relative; }
.admin-link {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border: 1.5px solid var(--bord);
    border-radius: 999px;
    background: #fff;
    color: var(--gris);
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    transition: color .15s, border-color .15s, background .15s;
}
.admin-link:hover, .admin-link:focus-visible { color: var(--violet-fonce); border-color: var(--violet); background: var(--violet-pale); outline: none; }
