/*
 * Page publique de rendez-vous — nouveau design (Figma « Techghil UX/UI Redesign », section D · Rendez-vous).
 * Chargé uniquement par les vues rdv::v2.public.* ; toutes les règles sont sous .rdv-v2.
 * Mobile d'abord (maquettes 390 px), puis ordinateur (maquettes 1440 px) à partir de 768 px.
 * Propriétés logiques (inline-start / inline-end) : la version arabe (dir="rtl") est le miroir.
 */

.rdv-v2 {
    /* Couleurs (variables Figma) */
    --forest-green: #024222;
    --emerald-green: #00a552;
    --emerald-deep: #00753b;
    --mint-mist: #e6f6ed;
    --cloud-gray: #fafafa;
    --brick-red: #a82d2d;
    --coral-red: #e05050;
    --blush-white: #fce8e8;
    --ambre: #8a5a00;
    --ambre-fond: #fdf3d7;
    --ambre-point: #e0a800;
    --neutral-100: #f2f5f3;
    --neutral-200: #dfe7e2;
    --neutral-300: #cfd6d2;
    --neutral-500: #6b7770;
    --neutral-700: #44514a;
    --neutral-900: #1a1f1c;
    --white: #ffffff;

    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--neutral-100);
    color: var(--neutral-900);
    font-family: 'Readex Pro', 'Segoe UI', Tahoma, sans-serif;
    font-size: 16px;
    line-height: 26px;
    -webkit-font-smoothing: antialiased;
}

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

.rdv-v2 p,
.rdv-v2 h1,
.rdv-v2 h2,
.rdv-v2 dl,
.rdv-v2 dd,
.rdv-v2 fieldset {
    margin: 0;
}

.rdv-v2 a {
    color: var(--emerald-deep);
    text-decoration: none;
}

.rdv-v2 a:hover {
    text-decoration: underline;
}

.rdv-v2 [hidden] {
    display: none !important;
}

.rdv-v2 :focus-visible {
    outline: 2px solid var(--emerald-green);
    outline-offset: 2px;
}

/* Numéros, codes et e-mails restent de gauche à droite en arabe */
.rdv-v2 .ltr {
    direction: ltr;
    unicode-bidi: isolate;
}

/* ── En-tête ───────────────────────────────────────────── */
.rdv-v2__entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    background: var(--white);
    border-bottom: 1px solid var(--neutral-200);
}

.rdv-v2__logo img {
    display: block;
    width: 116px;
    height: 36px;
    object-fit: contain;
}

.rdv-v2__entete-liens {
    display: flex;
    align-items: center;
    gap: 24px;
}

.rdv-v2__retour-portail {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 19px;
    color: var(--neutral-700) !important;
}

.rdv-v2__retour-portail img {
    width: 16px;
    height: 16px;
}

[dir="rtl"] .rdv-v2__retour-portail img {
    transform: scaleX(-1);
}

.rdv-v2__separateur-vertical {
    display: none;
    width: 1px;
    height: 20px;
    background: var(--neutral-300);
}

.rdv-v2__langue {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 500;
    line-height: 21px;
}

.rdv-v2__langue img {
    width: 18px;
    height: 18px;
}

/* ── Contenu et carte ─────────────────────────────────── */
.rdv-v2__contenu {
    flex: 1 0 auto;
    padding: 24px 16px 32px;
}

.rdv-v2__carte {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px 20px;
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: 16px;
}

.rdv-v2__titre {
    font-size: 24px;
    font-weight: 600;
    line-height: 30px;
    letter-spacing: -0.06px;
}

.rdv-v2__sous-titre {
    font-size: 16px;
    font-weight: 500;
    line-height: 21px;
}

.rdv-v2__texte {
    color: var(--neutral-700);
}

.rdv-v2__texte-petit {
    font-size: 14px;
    line-height: 20px;
    color: var(--neutral-700);
}

.rdv-v2__panneau,
.rdv-v2__etape {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Onglets ──────────────────────────────────────────── */
.rdv-v2__onglets {
    display: flex;
    border-bottom: 1px solid var(--neutral-200);
}

.rdv-v2__onglet {
    flex: 1 1 0;
    padding: 12px 8px;
    margin-bottom: -1px;
    background: none;
    border: 0;
    border-bottom: 3px solid transparent;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 21px;
    color: var(--neutral-700);
    text-align: center;
    cursor: pointer;
}

.rdv-v2__onglet[aria-selected="true"] {
    color: var(--emerald-deep);
    border-bottom-color: var(--emerald-green);
}

/* ── Indicateur d'étapes ──────────────────────────────── */
.rdv-v2__etapes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.rdv-v2__puce {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--cloud-gray);
    color: var(--neutral-700);
    font-size: 14px;
    font-weight: 500;
    line-height: 19px;
    white-space: nowrap;
}

.rdv-v2__puce img {
    display: none;
    width: 14px;
    height: 14px;
}

.rdv-v2__puce--en-cours {
    background: var(--forest-green);
    color: var(--white);
}

.rdv-v2__puce--terminee {
    background: var(--mint-mist);
    color: var(--forest-green);
}

.rdv-v2__puce--terminee img {
    display: block;
}

.rdv-v2__puce-numero {
    display: none;
}

/* ── Options « Vous êtes ? » ─────────────────────────── */
.rdv-v2__choix {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.rdv-v2__choix legend {
    padding: 0;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 19px;
}

.rdv-v2__option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--neutral-300);
    border-radius: 12px;
    cursor: pointer;
}

.rdv-v2__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rdv-v2__radio {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--neutral-500);
    border-radius: 999px;
    background: var(--white);
}

.rdv-v2__option-texte {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rdv-v2__option-titre {
    font-size: 16px;
    font-weight: 500;
    line-height: 21px;
}

.rdv-v2__option-description {
    font-size: 14px;
    line-height: 20px;
    color: var(--neutral-700);
}

.rdv-v2__option:has(input:checked) {
    border: 1.5px solid var(--emerald-green);
    background: var(--mint-mist);
}

.rdv-v2__option input:checked + .rdv-v2__radio {
    border-color: var(--forest-green);
    background: radial-gradient(circle, var(--forest-green) 0 5px, var(--white) 5.5px);
}

.rdv-v2__option input:focus-visible + .rdv-v2__radio {
    outline: 2px solid var(--emerald-green);
    outline-offset: 2px;
}

/* Encadré « Demandez votre rendez-vous depuis votre espace » (D2, D3) */
.rdv-v2__encadre {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--mint-mist);
    border-top: 3px solid var(--emerald-green);
    border-radius: 0 0 12px 12px;
}

.rdv-v2__encadre-titre {
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
    color: var(--emerald-deep);
}

/* ── Champs ───────────────────────────────────────────── */
.rdv-v2__groupe {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rdv-v2__libelle {
    font-size: 16px;
    font-weight: 500;
    line-height: 21px;
}

.rdv-v2__champ {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: 8px;
    font: inherit;
    font-size: 16px;
    line-height: 26px;
    color: var(--neutral-900);
}

.rdv-v2__champ::placeholder {
    color: var(--neutral-500);
}

.rdv-v2__champ:focus {
    border-color: var(--emerald-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 165, 82, 0.15);
}

select.rdv-v2__champ {
    height: 52px;
    padding-inline-end: 40px;
    font-weight: 500;
    line-height: 21px;
    appearance: none;
    -webkit-appearance: none;
    background-repeat: no-repeat;
    background-size: 18px 18px;
    background-position: right 12px center;
    cursor: pointer;
}

[dir="rtl"] select.rdv-v2__champ {
    background-position: left 12px center;
}

select.rdv-v2__champ.est-vide {
    color: var(--neutral-500);
}

textarea.rdv-v2__champ {
    min-height: 120px;
    resize: vertical;
}

.rdv-v2__aide {
    font-size: 12px;
    line-height: 19px;
    color: var(--neutral-500);
}

.rdv-v2__erreur {
    font-size: 12px;
    line-height: 19px;
    color: var(--brick-red);
}

.rdv-v2__groupe.a-erreur .rdv-v2__champ {
    border: 1.5px solid var(--brick-red);
}

/* ── Messages ─────────────────────────────────────────── */
.rdv-v2__resume-erreurs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--blush-white);
    border-top: 3px solid var(--coral-red);
    border-radius: 0 0 12px 12px;
}

.rdv-v2__succes:focus,
.rdv-v2__resume-erreurs:focus {
    outline: none;
}

.rdv-v2__resume-titre {
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
    color: var(--brick-red);
}

.rdv-v2__resume-lien {
    font-weight: 500;
    color: var(--forest-green) !important;
}

.rdv-v2__message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 20px;
}

.rdv-v2__message img {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
}

.rdv-v2__message--info {
    background: var(--mint-mist);
}

.rdv-v2__message--erreur {
    flex-direction: column;
    background: var(--blush-white);
    border-top: 3px solid var(--coral-red);
    border-radius: 0 0 12px 12px;
    padding: 16px;
}

/* ── Boutons ──────────────────────────────────────────── */
.rdv-v2__actions {
    display: flex;
    gap: 12px;
}

.rdv-v2__actions > * {
    flex: 1 1 0;
    min-width: 0;
}

.rdv-v2__bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 24px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    font: inherit;
    font-size: 18px;
    font-weight: 500;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
}

.rdv-v2__bouton--primaire {
    background: var(--emerald-green);
    color: var(--white) !important;
}

.rdv-v2__bouton--primaire:hover {
    background: var(--emerald-deep);
    text-decoration: none !important;
}

.rdv-v2__bouton--secondaire {
    background: var(--white);
    border-color: var(--emerald-green);
    color: var(--emerald-deep) !important;
}

.rdv-v2__bouton--secondaire:hover {
    background: var(--mint-mist);
    text-decoration: none !important;
}

.rdv-v2__bouton:disabled,
.rdv-v2__bouton[aria-disabled="true"] {
    background: var(--neutral-200);
    border-color: var(--neutral-200);
    color: var(--neutral-500) !important;
    cursor: not-allowed;
}

.rdv-v2__lien {
    font-size: 16px;
    font-weight: 500;
    line-height: 21px;
}

/* ── Demande envoyée (D10) ────────────────────────────── */
.rdv-v2__succes {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rdv-v2__succes-tete {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.rdv-v2__succes-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: var(--mint-mist);
}

.rdv-v2__succes-icone img {
    width: 28px;
    height: 28px;
}

.rdv-v2__succes-titre {
    font-size: 28px;
    font-weight: 600;
    line-height: 32px;
}

.rdv-v2__code-bloc {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px;
    background: var(--mint-mist);
    border-radius: 12px;
}

.rdv-v2__code {
    font-size: 24px;
    font-weight: 600;
    line-height: 30px;
    color: var(--emerald-deep);
}

/* ── Récapitulatif et statut ──────────────────────────── */
.rdv-v2__separateur {
    height: 1px;
    background: var(--neutral-200);
}

.rdv-v2__titre-resultat {
    font-size: 18px;
    font-weight: 600;
    line-height: 26px;
}

.rdv-v2__recap {
    display: flex;
    flex-direction: column;
}

.rdv-v2__recap-ligne {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--neutral-200);
    font-size: 14px;
}

.rdv-v2__recap-ligne dt {
    flex: 0 0 110px;
    line-height: 20px;
    color: var(--neutral-700);
}

.rdv-v2__recap-ligne dd {
    flex: 1 1 auto;
    font-weight: 500;
    line-height: 19px;
    text-align: end;
}

.rdv-v2__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    line-height: 19px;
}

.rdv-v2__badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.rdv-v2__badge--confirme {
    background: var(--mint-mist);
    color: var(--forest-green);
}

.rdv-v2__badge--confirme::before {
    background: var(--emerald-green);
}

.rdv-v2__badge--attente {
    background: var(--ambre-fond);
    color: var(--ambre);
}

.rdv-v2__badge--attente::before {
    background: var(--ambre-point);
}

.rdv-v2__badge--annule {
    background: var(--blush-white);
    color: var(--brick-red);
}

.rdv-v2__badge--annule::before {
    background: var(--coral-red);
}

.rdv-v2__badge--honore {
    background: var(--neutral-100);
    color: var(--neutral-700);
}

.rdv-v2__badge--honore::before {
    background: var(--neutral-500);
}

/* ── Pied de page ─────────────────────────────────────── */
.rdv-v2__pied {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--neutral-100);
    border-top: 1px solid var(--neutral-200);
    text-align: center;
    line-height: 19px;
}

.rdv-v2__pied-mentions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rdv-v2__pied-copyright {
    font-size: 14px;
    font-weight: 500;
}

.rdv-v2__pied-aide {
    font-size: 12px;
    color: var(--neutral-700);
}

.rdv-v2__pied-aide a {
    color: inherit;
}

.rdv-v2__pied-liens {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Bouton occupé (envoi en cours) */
.rdv-v2__bouton.est-occupe {
    opacity: 0.7;
    cursor: progress;
}

/* ── Ordinateur (maquettes 1440 px) ───────────────────── */
@media (min-width: 768px) {
    .rdv-v2__entete {
        height: 74px;
        padding: 0 max(24px, calc((100% - 1200px) / 2));
    }

    .rdv-v2__logo img {
        width: 148px;
        height: 46px;
    }

    .rdv-v2__retour-portail,
    .rdv-v2__separateur-vertical {
        display: flex;
    }

    .rdv-v2__contenu {
        padding: 64px 24px 96px;
    }

    .rdv-v2__carte {
        width: 600px;
        max-width: 100%;
        margin: 0 auto;
        padding: 40px;
        gap: 24px;
    }

    .rdv-v2__titre {
        font-size: 28px;
        line-height: 32px;
        letter-spacing: -0.14px;
    }

    .rdv-v2__puce {
        padding: 8px 16px;
        font-size: 16px;
        line-height: 21px;
    }

    .rdv-v2__puce-numero {
        display: inline;
    }

    .rdv-v2__pied {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 24px max(24px, calc((100% - 1200px) / 2));
        text-align: start;
    }
}
