/*
 * EloviaBookingRTK — Front-end styles
 *
 * Charte RTK Travel Center (3 couleurs + blanc) :
 *   --ebrtk-primary   #007071 (teal / bleu-vert)
 *   --ebrtk-secondary #CBDB2A (lime / vert)
 *   --ebrtk-accent    #F26522 (orange, CTA + danger)
 *
 * NOTE : La variable --ebrtk-dark existe toujours (compatibilité settings)
 * mais elle est aliasée sur l'accent orange pour éviter toute teinte rose
 * issue du bordeaux d'origine. Tout élément "danger" (annulation, erreur)
 * utilise l'orange.
 *
 * Design : mobile-first, ensuite élargi via min-width media queries.
 * On scope tout sous .ebrtk-booking / .ebrtk-manage-body / .ebrtk-manage
 * pour battre la spécificité CSS du thème hôte. Quelques !important
 * ciblés sur les boutons pour neutraliser les thèmes WP qui forcent
 * des couleurs (ex: rose bonbon par défaut du thème Hostinger).
 */

/* =========================================================
 * RESET LOCAL (scopé au conteneur booking)
 * ====================================================== */

.ebrtk-booking,
.ebrtk-manage {
    --ebrtk-primary: #007071;
    --ebrtk-secondary: #CBDB2A;
    --ebrtk-accent: #F26522;
    --ebrtk-dark: #F26522;          /* alias vers l'orange — plus de bordeaux */
    --ebrtk-danger: #F26522;        /* annulation / erreurs = orange aussi */
    --ebrtk-bg: #f3f5f5;
    --ebrtk-card-bg: #ffffff;
    --ebrtk-text: #1f2937;
    --ebrtk-muted: #6b7280;
    --ebrtk-border: #e5e7eb;
    --ebrtk-radius: 12px;
    --ebrtk-radius-sm: 8px;
    --ebrtk-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --ebrtk-shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.10);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    color: var(--ebrtk-text);
    font-size: 16px;
    line-height: 1.5;
    box-sizing: border-box;
}

.ebrtk-booking *,
.ebrtk-booking *::before,
.ebrtk-booking *::after,
.ebrtk-manage *,
.ebrtk-manage *::before,
.ebrtk-manage *::after {
    box-sizing: border-box;
}

.ebrtk-booking img,
.ebrtk-manage img {
    max-width: 100%;
    height: auto;
}

/* =========================================================
 * CONTAINER PRINCIPAL
 * ====================================================== */

.ebrtk-booking {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 20px;
    width: 100%;
}

/* Neutralisation globale des styles de bouton du thème hôte :
   certains thèmes (dont le thème Hostinger par défaut) forcent
   background rose + color blanc sur tous les <button> avec
   !important. On remet tout à plat à l'intérieur du plugin. */
.ebrtk-booking button,
.ebrtk-manage button {
    font-family: inherit;
    letter-spacing: normal;
    text-transform: none;
    box-shadow: none;
}

.ebrtk-manage-body {
    margin: 0;
    background: #f3f5f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

.ebrtk-manage {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

/* =========================================================
 * PROGRESSBAR (ol .ebrtk-steps)
 * ====================================================== */

.ebrtk-steps {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ebrtk-steps::-webkit-scrollbar {
    display: none;
}

.ebrtk-step {
    flex: 1 1 auto;
    min-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px;
    border-top: 3px solid var(--ebrtk-border);
    color: var(--ebrtk-muted);
    font-size: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.ebrtk-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--ebrtk-border);
    color: #ffffff !important;  /* toujours blanc, tous états */
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.ebrtk-step-label {
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}

/* Étape courante : cercle teal + label teal + trait teal */
.ebrtk-step.is-active {
    border-top-color: var(--ebrtk-primary);
    color: var(--ebrtk-primary);
    font-weight: 700;
}

.ebrtk-step.is-active .ebrtk-step-num {
    background: var(--ebrtk-primary);
}

/* Étapes terminées : cercle teal (pas lime !), label teal, trait lime.
   Le lime reste visible via la barre de progression au-dessus.
   On évite la combinaison texte blanc sur lime (illisible). */
.ebrtk-step.is-done {
    border-top-color: var(--ebrtk-secondary);
    color: var(--ebrtk-primary);
}

.ebrtk-step.is-done .ebrtk-step-num {
    background: var(--ebrtk-primary);
}

@media (min-width: 640px) {
    .ebrtk-step-label {
        font-size: 13px;
    }
    .ebrtk-step-num {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

/* =========================================================
 * CARD (conteneur d'étape)
 * ====================================================== */

.ebrtk-card {
    background: var(--ebrtk-card-bg);
    border-radius: var(--ebrtk-radius);
    padding: 24px 20px;
    box-shadow: var(--ebrtk-shadow);
    margin-bottom: 16px;
}

@media (min-width: 640px) {
    .ebrtk-card {
        padding: 32px;
    }
}

.ebrtk-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--ebrtk-primary);
    line-height: 1.3;
}

@media (min-width: 640px) {
    .ebrtk-title {
        font-size: 24px;
    }
}

.ebrtk-subtitle {
    margin: 0 0 20px;
    color: var(--ebrtk-muted);
    font-size: 15px;
}

.ebrtk-muted {
    color: var(--ebrtk-muted);
}

.ebrtk-strikethrough {
    text-decoration: line-through;
    color: var(--ebrtk-muted);
}

/* =========================================================
 * GRID (cards agence/type/agent)
 * ====================================================== */

.ebrtk-grid {
    display: grid;
    gap: 16px;
}

.ebrtk-grid-cols-2 {
    grid-template-columns: 1fr;
}

.ebrtk-grid-cols-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .ebrtk-grid-cols-2 {
        grid-template-columns: 1fr 1fr;
    }
    .ebrtk-grid-cols-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 960px) {
    .ebrtk-grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Cartes plus aérées */
.ebrtk-choice {
    min-height: 110px;
}

/* Card cliquable (agence / type / agent) — scopée + !important pour
   battre les thèmes WP qui forcent fond/couleur sur tous les <button>. */
body .ebrtk-booking .ebrtk-choice,
body .ebrtk-manage .ebrtk-choice {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #ffffff !important;
    border: 2px solid var(--ebrtk-border) !important;
    border-radius: var(--ebrtk-radius);
    padding: 18px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: inherit;
    color: var(--ebrtk-text) !important;
    width: 100%;
    box-shadow: none !important;
}

body .ebrtk-booking .ebrtk-choice:hover,
body .ebrtk-booking .ebrtk-choice:focus-visible,
body .ebrtk-manage .ebrtk-choice:hover,
body .ebrtk-manage .ebrtk-choice:focus-visible {
    border-color: var(--ebrtk-primary) !important;
    box-shadow: var(--ebrtk-shadow-hover) !important;
    outline: none;
    transform: translateY(-1px);
}

body .ebrtk-booking .ebrtk-choice.is-selected,
body .ebrtk-manage .ebrtk-choice.is-selected {
    border-color: var(--ebrtk-primary) !important;
    background: rgba(0, 112, 113, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(0, 112, 113, 0.15) !important;
}

.ebrtk-choice-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--ebrtk-text);
}

.ebrtk-choice-meta {
    color: var(--ebrtk-muted);
    font-size: 13px;
}

.ebrtk-choice-desc {
    color: var(--ebrtk-muted);
    font-size: 13px;
    line-height: 1.4;
}

/* v1.2.13 : placeholder photo agent — cercle blanc avec bordure à la
 * couleur de l'agent et icône personne générique (remplacer par une
 * vraie photo quand disponible). Même composant utilisé côté back-office. */
.ebrtk-choice-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--ebrtk-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    border: 2px solid currentColor; /* surchargée inline par la couleur agent */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}
.ebrtk-choice-avatar svg {
    width: 30px;
    height: 30px;
    display: block;
}
.ebrtk-choice-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
/* Variante "peu importe" — étoile dorée plutôt que silhouette. */
.ebrtk-choice-avatar-any {
    background: var(--ebrtk-primary);
    color: #ffffff;
    border-color: var(--ebrtk-primary);
    font-weight: 700;
    font-size: 24px;
}

.ebrtk-badge-visio {
    display: inline-block;
    background: var(--ebrtk-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* =========================================================
 * CALENDAR
 * ====================================================== */

.ebrtk-calendar {
    border: 1px solid var(--ebrtk-border);
    border-radius: var(--ebrtk-radius);
    padding: 16px;
    background: #fff;
    width: 100%;
}

.ebrtk-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}

.ebrtk-calendar-title {
    flex: 1;
    text-align: center;
    font-size: 20px;
    color: var(--ebrtk-primary);
    text-transform: capitalize;
}

.ebrtk-calendar-days-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.ebrtk-calendar-days-head > span {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--ebrtk-muted);
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ebrtk-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

body .ebrtk-booking .ebrtk-day,
body .ebrtk-manage .ebrtk-day {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 1px solid transparent !important;
    background: #f9fafb !important;
    border-radius: var(--ebrtk-radius-sm);
    padding: 0;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--ebrtk-text) !important;
    cursor: pointer;
    transition: all 0.12s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
}

@media (min-width: 640px) {
    .ebrtk-day {
        min-height: 60px;
        font-size: 16px;
    }
    .ebrtk-calendar {
        padding: 24px;
    }
}

@media (min-width: 960px) {
    .ebrtk-day {
        min-height: 72px;
        font-size: 17px;
    }
}

.ebrtk-day.is-empty {
    background: transparent;
    cursor: default;
}

body .ebrtk-booking .ebrtk-day.is-available:hover,
body .ebrtk-booking .ebrtk-day.is-available:focus-visible,
body .ebrtk-manage .ebrtk-day.is-available:hover,
body .ebrtk-manage .ebrtk-day.is-available:focus-visible {
    background: rgba(0, 112, 113, 0.1) !important;
    border-color: var(--ebrtk-primary) !important;
    outline: none;
}

body .ebrtk-booking .ebrtk-day.is-selected,
body .ebrtk-manage .ebrtk-day.is-selected {
    background: var(--ebrtk-accent) !important;
    color: #ffffff !important;
    border-color: var(--ebrtk-accent) !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(242, 101, 34, 0.35) !important;
}

body .ebrtk-booking .ebrtk-day.is-full,
body .ebrtk-manage .ebrtk-day.is-full {
    background: rgba(242, 101, 34, 0.08) !important;
    color: var(--ebrtk-accent) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

body .ebrtk-booking .ebrtk-day.is-closed,
body .ebrtk-manage .ebrtk-day.is-closed {
    background: #f3f4f6 !important;
    color: #cbd5e1 !important;
    cursor: not-allowed;
    text-decoration: line-through;
}

body .ebrtk-booking .ebrtk-day.is-past,
body .ebrtk-manage .ebrtk-day.is-past {
    background: transparent !important;
    color: #cbd5e1 !important;
    cursor: not-allowed;
}

body .ebrtk-booking .ebrtk-day.is-today,
body .ebrtk-manage .ebrtk-day.is-today {
    border-color: var(--ebrtk-primary) !important;
    font-weight: 700;
}

.ebrtk-calendar-legend {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--ebrtk-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

.ebrtk-calendar-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.ebrtk-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ebrtk-legend-available { background: var(--ebrtk-primary); }
.ebrtk-legend-full      { background: var(--ebrtk-accent); }
.ebrtk-legend-closed    { background: #cbd5e1; }

/* =========================================================
 * SLOTS (créneaux horaires)
 * ====================================================== */

.ebrtk-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
    width: 100%;
}

body .ebrtk-booking .ebrtk-slot,
body .ebrtk-manage .ebrtk-slot {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 2px solid var(--ebrtk-border) !important;
    background: #ffffff !important;
    padding: 14px 8px;
    border-radius: var(--ebrtk-radius-sm);
    font-family: inherit;
    font-weight: 600;
    font-size: 16px;
    color: var(--ebrtk-text) !important;
    cursor: pointer;
    transition: all 0.12s ease;
    text-align: center;
    min-height: 48px;
    box-shadow: none !important;
}

body .ebrtk-booking .ebrtk-slot:hover:not(:disabled),
body .ebrtk-booking .ebrtk-slot:focus-visible:not(:disabled),
body .ebrtk-manage .ebrtk-slot:hover:not(:disabled),
body .ebrtk-manage .ebrtk-slot:focus-visible:not(:disabled) {
    border-color: var(--ebrtk-primary) !important;
    color: var(--ebrtk-primary) !important;
    outline: none;
}

body .ebrtk-booking .ebrtk-slot.is-selected,
body .ebrtk-manage .ebrtk-slot.is-selected {
    background: var(--ebrtk-accent) !important;
    color: #ffffff !important;
    border-color: var(--ebrtk-accent) !important;
    box-shadow: 0 2px 8px rgba(242, 101, 34, 0.35) !important;
}

body .ebrtk-booking .ebrtk-slot.is-disabled,
body .ebrtk-booking .ebrtk-slot:disabled,
body .ebrtk-manage .ebrtk-slot.is-disabled,
body .ebrtk-manage .ebrtk-slot:disabled {
    background: #f3f4f6 !important;
    color: #cbd5e1 !important;
    cursor: not-allowed;
    border-color: #e5e7eb !important;
}

.ebrtk-slots-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px 16px;
    color: var(--ebrtk-muted);
    font-size: 14px;
    background: #f9fafb;
    border-radius: var(--ebrtk-radius-sm);
}

/* =========================================================
 * FORMULAIRE (coordonnées)
 * ====================================================== */

.ebrtk-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ebrtk-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .ebrtk-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.ebrtk-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ebrtk-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ebrtk-text);
}

.ebrtk-optional {
    color: var(--ebrtk-muted);
    font-weight: 400;
    font-size: 12px;
}

body .ebrtk-booking .ebrtk-form-group input,
body .ebrtk-booking .ebrtk-form-group textarea,
body .ebrtk-manage .ebrtk-form-group input,
body .ebrtk-manage .ebrtk-form-group textarea {
    font-family: inherit;
    font-size: 15px;
    padding: 12px 14px;
    border: 1px solid var(--ebrtk-border) !important;
    border-radius: var(--ebrtk-radius-sm);
    background: #ffffff !important;
    color: var(--ebrtk-text) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    box-shadow: none !important;
}

.ebrtk-form-group input:focus,
.ebrtk-form-group textarea:focus {
    outline: none;
    border-color: var(--ebrtk-primary);
    box-shadow: 0 0 0 3px rgba(0, 112, 113, 0.15);
}

body .ebrtk-booking .ebrtk-form-group input.is-invalid,
body .ebrtk-booking .ebrtk-form-group textarea.is-invalid,
body .ebrtk-manage .ebrtk-form-group input.is-invalid,
body .ebrtk-manage .ebrtk-form-group textarea.is-invalid {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18) !important;
    background: #fff6f5 !important;
}

.ebrtk-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.ebrtk-form-error {
    color: var(--ebrtk-dark);
    font-size: 12px;
    margin-top: 2px;
}

.ebrtk-form-group-checkbox {
    flex-direction: row;
}

.ebrtk-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    font-weight: 400;
    color: var(--ebrtk-text);
    line-height: 1.4;
    cursor: pointer;
}

.ebrtk-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 2px;
    accent-color: var(--ebrtk-primary);
    cursor: pointer;
}

.ebrtk-checkbox-label a {
    color: var(--ebrtk-primary);
    text-decoration: underline;
}

/* =========================================================
 * NAV (boutons prev/next)
 * ====================================================== */

.ebrtk-nav {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 16px;
}

/* Note : on utilise !important + un préfixe `body` + la classe scopée
   pour maximiser la spécificité. Sans ça, certains thèmes WP forcent
   background rose/magenta sur tous les <button> avec !important
   eux-mêmes. Combat de spécificité = on gagne avec body+classe+!important. */
body .ebrtk-booking .ebrtk-btn,
body .ebrtk-manage .ebrtk-btn,
html .ebrtk-manage-body .ebrtk-manage .ebrtk-btn {
    appearance: none !important;
    -webkit-appearance: none !important;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: var(--ebrtk-radius-sm);
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
    min-height: 44px;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.ebrtk-booking .ebrtk-btn-primary,
.ebrtk-manage .ebrtk-btn-primary {
    background: var(--ebrtk-primary) !important;
    color: #fff !important;
    border-color: var(--ebrtk-primary) !important;
}

.ebrtk-booking .ebrtk-btn-primary:hover:not(:disabled),
.ebrtk-booking .ebrtk-btn-primary:focus-visible:not(:disabled),
.ebrtk-manage .ebrtk-btn-primary:hover:not(:disabled),
.ebrtk-manage .ebrtk-btn-primary:focus-visible:not(:disabled) {
    background: #005e5f !important;
    border-color: #005e5f !important;
    outline: none;
}

.ebrtk-booking .ebrtk-btn-accent,
.ebrtk-manage .ebrtk-btn-accent {
    background: var(--ebrtk-accent) !important;
    color: #fff !important;
    border-color: var(--ebrtk-accent) !important;
}

.ebrtk-booking .ebrtk-btn-accent:hover:not(:disabled),
.ebrtk-booking .ebrtk-btn-accent:focus-visible:not(:disabled),
.ebrtk-manage .ebrtk-btn-accent:hover:not(:disabled),
.ebrtk-manage .ebrtk-btn-accent:focus-visible:not(:disabled) {
    background: #d9541a !important;
    border-color: #d9541a !important;
    outline: none;
}

.ebrtk-booking .ebrtk-btn-ghost,
.ebrtk-manage .ebrtk-btn-ghost {
    background: #fff !important;
    color: var(--ebrtk-primary) !important;
    border-color: var(--ebrtk-border) !important;
}

.ebrtk-booking .ebrtk-btn-ghost:hover:not(:disabled),
.ebrtk-booking .ebrtk-btn-ghost:focus-visible:not(:disabled),
.ebrtk-manage .ebrtk-btn-ghost:hover:not(:disabled),
.ebrtk-manage .ebrtk-btn-ghost:focus-visible:not(:disabled) {
    border-color: var(--ebrtk-primary) !important;
    background: rgba(0, 112, 113, 0.05) !important;
    outline: none;
}

.ebrtk-booking .ebrtk-btn-danger,
.ebrtk-manage .ebrtk-btn-danger {
    background: #fff !important;
    color: var(--ebrtk-accent) !important;
    border-color: var(--ebrtk-accent) !important;
}

.ebrtk-booking .ebrtk-btn-danger:hover:not(:disabled),
.ebrtk-booking .ebrtk-btn-danger:focus-visible:not(:disabled),
.ebrtk-manage .ebrtk-btn-danger:hover:not(:disabled),
.ebrtk-manage .ebrtk-btn-danger:focus-visible:not(:disabled) {
    background: var(--ebrtk-accent) !important;
    color: #fff !important;
    outline: none;
}

.ebrtk-btn:disabled,
.ebrtk-btn.is-loading {
    opacity: 0.55;
    cursor: not-allowed;
}

.ebrtk-btn.is-hidden {
    visibility: hidden;
}

body .ebrtk-booking .ebrtk-btn-icon,
body .ebrtk-manage .ebrtk-btn-icon {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #ffffff !important;
    border: 1px solid var(--ebrtk-border) !important;
    border-radius: 50% !important;
    width: 40px;
    height: 40px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--ebrtk-primary) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow: none !important;
    padding: 0 !important;
}

body .ebrtk-booking .ebrtk-btn-icon:hover,
body .ebrtk-booking .ebrtk-btn-icon:focus-visible,
body .ebrtk-manage .ebrtk-btn-icon:hover,
body .ebrtk-manage .ebrtk-btn-icon:focus-visible {
    background: rgba(0, 112, 113, 0.08) !important;
    border-color: var(--ebrtk-primary) !important;
    outline: none;
}

.ebrtk-submit-hint {
    margin-top: 16px;
    font-size: 13px;
    color: var(--ebrtk-muted);
    text-align: center;
}

/* =========================================================
 * SUMMARY (récap)
 * ====================================================== */

.ebrtk-summary {
    background: #f9fafb;
    border-radius: var(--ebrtk-radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    border: 1px solid var(--ebrtk-border);
}

.ebrtk-summary-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--ebrtk-border);
}

.ebrtk-summary-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

@media (min-width: 640px) {
    .ebrtk-summary-row {
        grid-template-columns: 130px 1fr;
        gap: 16px;
        align-items: baseline;
    }
}

.ebrtk-summary-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ebrtk-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ebrtk-summary-value {
    font-size: 15px;
    color: var(--ebrtk-text);
    word-break: break-word;
}

.ebrtk-summary-value strong {
    text-transform: capitalize;
    display: block;
}

/* =========================================================
 * ÉTAPE DONE — confirmation visuelle (v1.2.13)
 * - check animé (apparition + dessin du trait)
 * - tuiles à icônes (date, heure, agent, agence)
 * - bloc cadré charté RTK
 * ====================================================== */

.ebrtk-step-done {
    text-align: center;
    padding: 8px 4px 4px;
}

.ebrtk-step-done[hidden] { display: none; }
.ebrtk-step-done:not([hidden]) {
    animation: ebrtk-done-fade .4s ease both;
}

.ebrtk-done-icon {
    position: relative;
    display: inline-flex;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(203, 219, 42, 0.25);
    color: var(--ebrtk-primary);
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: ebrtk-done-pop .45s cubic-bezier(.2, .9, .3, 1.2) .05s both;
}
.ebrtk-done-icon svg {
    width: 56px;
    height: 56px;
}
/* Le cercle + la coche dessinés : on anime le stroke-dashoffset pour
 * donner l'illusion d'un tracé qui s'écrit. */
.ebrtk-done-icon svg circle,
.ebrtk-done-icon svg path {
    stroke-dasharray: 180;
    stroke-dashoffset: 180;
    animation: ebrtk-done-draw .55s ease-out .2s forwards;
}
.ebrtk-done-icon svg path {
    animation-delay: .45s;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
}

.ebrtk-step-done .ebrtk-title {
    margin-top: 0;
}

/* Grille de tuiles du récap final. */
[data-role="done-recap"] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 20px auto 0;
    max-width: 560px;
    text-align: left;
}
.ebrtk-done-tile {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid rgba(0, 112, 113, 0.18);
    border-radius: var(--ebrtk-radius-sm, 10px);
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    animation: ebrtk-done-tile-in .45s ease both;
    animation-delay: .35s;
}
.ebrtk-done-tile[data-tile="time"]   { animation-delay: .45s; }
.ebrtk-done-tile[data-tile="agent"]  { animation-delay: .55s; }
.ebrtk-done-tile[data-tile="agency"] { animation-delay: .65s; }
.ebrtk-done-tile-link                { animation-delay: .75s; }

.ebrtk-done-tile-link {
    grid-column: 1 / -1;
    border-color: var(--ebrtk-accent);
}
.ebrtk-done-tile-link:hover,
.ebrtk-done-tile-link:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(242, 101, 34, 0.18);
    border-color: var(--ebrtk-accent);
}

.ebrtk-done-tile-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 112, 113, 0.08);
    color: var(--ebrtk-primary);
}
.ebrtk-done-tile-link .ebrtk-done-tile-icon {
    background: rgba(242, 101, 34, 0.12);
    color: var(--ebrtk-accent);
}
.ebrtk-done-tile-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}
.ebrtk-done-tile-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ebrtk-muted, #6b7280);
    font-weight: 600;
}
.ebrtk-done-tile-value {
    font-size: 14.5px;
    font-weight: 600;
    color: #1f2937;
    word-break: break-word;
}
.ebrtk-done-tile-sub {
    margin-top: 2px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ebrtk-muted, #6b7280);
    word-break: break-word;
}

@media (max-width: 540px) {
    [data-role="done-recap"] { grid-template-columns: 1fr; }
}

/* Animations */
@keyframes ebrtk-done-fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
@keyframes ebrtk-done-pop {
    0%   { opacity: 0; transform: scale(.5); }
    70%  { opacity: 1; transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes ebrtk-done-draw {
    to { stroke-dashoffset: 0; }
}
@keyframes ebrtk-done-tile-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ebrtk-step-done,
    .ebrtk-done-icon,
    .ebrtk-done-icon svg circle,
    .ebrtk-done-icon svg path,
    .ebrtk-done-tile {
        animation: none !important;
    }
    .ebrtk-done-icon svg circle,
    .ebrtk-done-icon svg path {
        stroke-dashoffset: 0;
    }
}

/* =========================================================
 * NOTICES (messages / erreurs)
 * ====================================================== */

.ebrtk-notice {
    border-radius: var(--ebrtk-radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    margin: 12px 0;
}

.ebrtk-notice-info {
    background: rgba(0, 112, 113, 0.08);
    color: var(--ebrtk-primary);
    border-left: 3px solid var(--ebrtk-primary);
}

.ebrtk-notice-warn {
    background: rgba(242, 101, 34, 0.08);
    color: var(--ebrtk-accent);
    border-left: 3px solid var(--ebrtk-accent);
}

.ebrtk-notice-error {
    background: rgba(152, 27, 30, 0.08);
    color: var(--ebrtk-dark);
    border-left: 3px solid var(--ebrtk-dark);
}

.ebrtk-notice-success {
    background: rgba(203, 219, 42, 0.2);
    color: #3f4f00;
    border-left: 3px solid var(--ebrtk-secondary);
}

.ebrtk-manage-message {
    border-radius: var(--ebrtk-radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    margin: 16px 0 0;
}

.ebrtk-manage-message.is-success {
    background: rgba(203, 219, 42, 0.2);
    color: #3f4f00;
    border-left: 3px solid var(--ebrtk-secondary);
}

.ebrtk-manage-message.is-error {
    background: rgba(152, 27, 30, 0.08);
    color: var(--ebrtk-dark);
    border-left: 3px solid var(--ebrtk-dark);
}

/* =========================================================
 * PAGE MANAGE (magic link)
 * ====================================================== */

.ebrtk-manage-header {
    text-align: center;
    padding: 16px 0 24px;
}

.ebrtk-manage-logo {
    max-height: 64px;
    width: auto;
    display: inline-block;
}

.ebrtk-manage-brand {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--ebrtk-primary);
    letter-spacing: 0.3px;
}

.ebrtk-manage-main {
    margin-bottom: 24px;
}

.ebrtk-manage-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

@media (min-width: 640px) {
    .ebrtk-manage-actions {
        flex-direction: row;
    }

    .ebrtk-manage-actions .ebrtk-btn {
        flex: 1 1 auto;
    }
}

.ebrtk-manage-footer {
    text-align: center;
    padding: 16px 0;
    border-top: 1px solid var(--ebrtk-border);
    margin-top: 24px;
}

.ebrtk-manage-footer p {
    margin: 0;
    font-size: 13px;
}

.ebrtk-manage-footer a {
    color: var(--ebrtk-primary);
    text-decoration: none;
    font-weight: 600;
}

.ebrtk-manage-footer a:hover {
    text-decoration: underline;
}

/* =========================================================
 * LOADING / SPINNER
 * ====================================================== */

.ebrtk-loading {
    text-align: center;
    padding: 32px 16px;
    color: var(--ebrtk-muted);
    font-size: 14px;
}

.ebrtk-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 112, 113, 0.2);
    border-top-color: var(--ebrtk-primary);
    border-radius: 50%;
    animation: ebrtk-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes ebrtk-spin {
    to { transform: rotate(360deg); }
}

/* =========================================================
 * UTILS
 * ====================================================== */

.ebrtk-hidden,
[hidden] {
    display: none !important;
}

.ebrtk-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* v1.2.10 : feedback validation formulaire coordonnées */
.ebrtk-form input.is-invalid,
.ebrtk-form textarea.is-invalid {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .15);
}
.ebrtk-form label.is-invalid {
    color: #c0392b;
}
.ebrtk-form-error {
    margin-top: 16px;
    padding: 10px 14px;
    background: #fdecea;
    border: 1px solid #f5b7b1;
    color: #922b21;
    border-radius: 6px;
    font-size: 14px;
}

/* v1.2.10 : étapes cliquables (retour arrière uniquement) */
.ebrtk-step[data-step-marker] { cursor: pointer; }
.ebrtk-step.is-done:hover .ebrtk-step-num {
    transform: scale(1.08);
    transition: transform .12s ease;
}

/* =========================================================
 * v1.2.53 — Responsive mobile (≤ 600px) du front-end booking.
 * ----------------------------------------------------------
 * Corrige les bugs visuels observés sur iPhone (~390px) :
 *
 *   1) Cards type/agent qui débordent : padding & fontes
 *      ajustés. v1.2.53 : on contraint aussi .ebrtk-booking à
 *      max-width:100vw + overflow-x:hidden pour que la grille
 *      ne dépasse jamais le viewport, même quand le container
 *      parent (Elementor / thème WP) impose une largeur fixe.
 *      + white-space:normal explicite sur les descriptions car
 *      certains thèmes injectent un nowrap implicite.
 *
 *   2) Card wrapper (.ebrtk-card) : padding réduit.
 *
 *   3) Bloc RGPD rendu dans une colonne narrow à droite :
 *      v1.2.52 mettait flex-direction:column sur le form-group
 *      mais ça ne suffisait pas (la pathologie était plus bas).
 *      v1.2.53 : reset complet — display:block sur le form-group
 *      + reconstruction explicite du flex sur le label + son
 *      span avec flex:1 1 0 et min-width:0 partout pour forcer
 *      le span à occuper toute la largeur disponible et wrapper
 *      proprement le texte de consentement.
 *
 *   4) Bouton "Confirmer mon rendez-vous" : padding réduit +
 *      autorisation du wrap sur 2 lignes.
 *
 * Desktop (> 600px) : aucun changement.
 * ====================================================== */
@media (max-width: 600px) {
    /* --- Container : on contraint au viewport quoi qu'il arrive --- */
    .ebrtk-booking {
        max-width: 100vw !important;
        overflow-x: hidden;
    }

    /* --- Card wrapper : padding réduit --- */
    .ebrtk-booking .ebrtk-card {
        padding: 18px 14px;
        max-width: 100%;
    }

    /* --- Cards de choix (type / agent / agence) --- */
    body .ebrtk-booking .ebrtk-choice,
    body .ebrtk-manage .ebrtk-choice {
        padding: 14px !important;
        min-width: 0;
        max-width: 100%;
    }
    .ebrtk-booking .ebrtk-choice-title,
    .ebrtk-manage .ebrtk-choice-title {
        font-size: 15px;
        white-space: normal !important;
        overflow-wrap: break-word;
        word-break: break-word;
    }
    .ebrtk-booking .ebrtk-choice-meta,
    .ebrtk-booking .ebrtk-choice-desc,
    .ebrtk-manage .ebrtk-choice-meta,
    .ebrtk-manage .ebrtk-choice-desc {
        font-size: 12.5px;
        white-space: normal !important;
        overflow-wrap: break-word;
        word-break: break-word;
    }
    .ebrtk-booking .ebrtk-choice-avatar {
        width: 44px;
        height: 44px;
    }
    .ebrtk-booking .ebrtk-choice-avatar svg {
        width: 22px;
        height: 22px;
    }

    /* --- Bloc RGPD : reset agressif (display:block + flex rebuild) --- */
    .ebrtk-booking .ebrtk-form-group-checkbox,
    .ebrtk-manage .ebrtk-form-group-checkbox {
        display: block !important;
        flex-direction: initial !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .ebrtk-booking .ebrtk-form-group-checkbox > .ebrtk-checkbox-label,
    .ebrtk-manage .ebrtk-form-group-checkbox > .ebrtk-checkbox-label {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .ebrtk-booking .ebrtk-form-group-checkbox > .ebrtk-checkbox-label > input,
    .ebrtk-manage .ebrtk-form-group-checkbox > .ebrtk-checkbox-label > input {
        flex: 0 0 18px !important;
        width: 18px !important;
        height: 18px !important;
        margin: 2px 0 0 !important;
    }
    .ebrtk-booking .ebrtk-form-group-checkbox > .ebrtk-checkbox-label > span,
    .ebrtk-manage .ebrtk-form-group-checkbox > .ebrtk-checkbox-label > span {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
    }

    /* --- Boutons nav : taille réduite + wrap autorisé --- */
    body .ebrtk-booking .ebrtk-btn,
    body .ebrtk-manage .ebrtk-btn,
    html .ebrtk-manage-body .ebrtk-manage .ebrtk-btn {
        padding: 10px 12px !important;
        font-size: 13.5px !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        text-align: center;
        min-height: 40px !important;
    }
    .ebrtk-booking .ebrtk-nav,
    .ebrtk-manage .ebrtk-manage-actions {
        gap: 8px;
    }
}
