/*
 * Parcours de réservation en mode sombre (data-bs-theme="dark", posé par
 * dark-mode.js). Chargé par templates/base.html sur toutes les pages : les
 * gabarits du parcours existent en plusieurs copies (index/, admin/location/,
 * profil/), corriger ici évite de les retoucher une par une.
 * Toutes les règles sont préfixées par [data-bs-theme="dark"] : le mode clair
 * ne change pas.
 */

/* Fenêtres SweetAlert2 (dates manquantes, navette...) : blanches par défaut. */
[data-bs-theme="dark"] .swal2-popup {
    background: #212529 !important;
    color: #dee2e6 !important;
}
[data-bs-theme="dark"] .swal2-title {
    color: #f8f9fa !important;
}
[data-bs-theme="dark"] .swal2-html-container {
    color: #dee2e6 !important;
}

/* Choix de l'assurance (static/css/assurance.css, cartes blanches). */
[data-bs-theme="dark"] .insurance-card,
[data-bs-theme="dark"] .insurance-card-footer {
    background-color: #2b3035;
    border-color: #495057;
}
[data-bs-theme="dark"] .insurance-card.selected {
    background-color: #2b3035;
    border-color: #dc3545;
}
[data-bs-theme="dark"] .insurance-card-header,
[data-bs-theme="dark"] .insurance-card-header-yellow,
[data-bs-theme="dark"] .insurance-card-header-blue {
    border-bottom-color: #495057;
}
[data-bs-theme="dark"] .feature-item,
[data-bs-theme="dark"] .insurance-subtitle {
    color: #dee2e6;
}
[data-bs-theme="dark"] .insurance-description,
[data-bs-theme="dark"] .insurance-details .detail-item {
    color: #adb5bd;
}
[data-bs-theme="dark"] .btn-details,
[data-bs-theme="dark"] .more-details-link {
    color: #6ea8fe;
}
[data-bs-theme="dark"] .btn-details:hover,
[data-bs-theme="dark"] .more-details-link:hover {
    color: #9ec5fe;
}

/* Récapitulatif de la location (carte bleue à droite) : text-dark et
 * `#selected-options > li { color: black }` (option.css) le rendaient
 * illisible. La pastille jaune « Durée » garde son texte foncé. */
[data-bs-theme="dark"] .resume_car .text-dark:not(.bg-warning) {
    color: var(--bs-emphasis-color) !important;
}
[data-bs-theme="dark"] #selected-options > li,
[data-bs-theme="dark"] #selected-options .list-group-item {
    color: var(--bs-emphasis-color);
}

/* Formulaire de carte Systempay (krypton, no-theme) : le texte saisi restait
 * noir sur fond sombre. Les champs carte sont dans des iframes ; krypton y
 * recopie le style des champs .kr-input-field de la page (le titulaire de la
 * carte, lui, est un vrai champ de la page). Le style est lu au chargement du
 * formulaire : changer de thème demande de recharger la page. */
[data-bs-theme="dark"] .kr-embedded .kr-input-field,
[data-bs-theme="dark"] .kr-embedded input[kr-field],
[data-bs-theme="dark"] .kr-embedded .kr-pan,
[data-bs-theme="dark"] .kr-embedded .kr-expiry,
[data-bs-theme="dark"] .kr-embedded .kr-security-code {
    color: #f8f9fa !important;
}
[data-bs-theme="dark"] .kr-embedded .kr-input-field::placeholder,
[data-bs-theme="dark"] .kr-embedded input[kr-field]::placeholder {
    color: #adb5bd !important;
}
