/* ══════════════════════════════════════════════════════════════
   MODAL UNIQUE (paiement et formulaires d'opération)
   Utilisé par : paiement-modal, reabonnement-vehicule, transfert-vehicule
   ══════════════════════════════════════════════════════════════ */

.pm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    animation: pm-fondu 0.15s ease-out;
}

.pm-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 28px 24px 24px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.3);
    text-align: center;
    animation: pm-entree 0.18s ease-out;
}

.pm-fermer {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.pm-fermer:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.pm-titre {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
}

.pm-sous {
    margin: 4px 0 20px;
    font-size: 13px;
    color: #64748b;
}

/* ── Icône 2D : pastille ronde teintée ── */
.pm-icone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    font-size: 28px;
}

.pm-icone--teal {
    background: #f0fdfa;
    color: #0d9488;
}

.pm-icone--danger {
    background: #fef2f2;
    color: #dc2626;
}

/* Attente : un arc tourne autour de l'icône pendant qu'un halo pulse */
.pm-icone--attente::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(37, 99, 235, 0) 0deg, rgba(37, 99, 235, 0) 70deg, #2563eb 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    animation: pm-tourne 0.9s linear infinite;
}

.pm-icone--attente::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.22);
    animation: pm-halo 1.8s ease-out infinite;
}

/* Trois points animés */
.pm-points {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.pm-points span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2563eb;
    animation: pm-point 1.2s ease-in-out infinite;
}

.pm-points span:nth-child(2) {
    animation-delay: 0.15s;
}

.pm-points span:nth-child(3) {
    animation-delay: 0.3s;
}

.pm-attente-sous {
    margin: 0;
    font-size: 13px;
    color: #475569;
}

/* ── Champs ── */
.pm-champ {
    margin-bottom: 14px;
    text-align: left;
}

.pm-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    text-align: left;
}

.pm-aide {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #b91c1c;
    text-align: left;
}

/* Les navigateurs n'appliquent pas la police de la page aux boutons */
.pm-btn {
    font-family: inherit;
}

/* Police à chasse fixe pour les champs, comme le numéro de châssis */
.pm-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.pm-input {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    font-size: 15px;
    color: #0f172a;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pm-input::placeholder {
    color: #94a3b8;
}

.pm-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.pm-input[aria-invalid="true"] {
    border-color: #dc2626;
}

.pm-input-groupe {
    position: relative;
}

.pm-input-groupe i {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    font-size: 18px;
    color: #94a3b8;
    pointer-events: none;
}

.pm-input-groupe .pm-input {
    padding-left: 42px;
    letter-spacing: 0.5px;
}

.pm-input-groupe:focus-within i {
    color: #2563eb;
}

/* ── Champ téléphone : un seul bloc, indicatif +243 intégré à gauche ── */
.tel-groupe {
    display: flex;
    align-items: stretch;
    height: 46px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tel-groupe:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.tel-groupe:has(.tel-input[aria-invalid="true"]) {
    border-color: #dc2626;
}

.tel-indicatif {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    padding: 0 12px 0 14px;
    border-right: 1px solid #e2e8f0;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    user-select: none;
}

.tel-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 14px;
    border: none;
    background: transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}

.tel-input:focus {
    outline: none;
}

.tel-input::placeholder {
    color: #94a3b8;
}

/* ── Choix de la devise (USD / CDF) ── */
.pm-devises {
    min-width: 0;
    margin-inline: 0;
    padding: 0;
    border: 0;
}

.pm-devises-choix {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pm-devise {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    text-align: center;
    cursor: pointer;
}

.pm-devise input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pm-devise-code {
    font-size: 12px;
    color: #64748b;
}

.pm-devise-montant {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.pm-devise:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #2563eb;
}

.pm-devise:has(input:focus-visible) {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ── Choix de durée ── */
.pm-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.pm-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
}

.pm-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pm-option-duree {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.pm-option-prix {
    font-size: 12px;
    color: #64748b;
}

.pm-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #2563eb;
}

.pm-option:has(input:focus-visible) {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.pm-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #334155;
    text-align: left;
    cursor: pointer;
}

.pm-check input {
    margin-top: 2px;
}

/* ── Messages ── */
.pm-erreur {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    font-size: 13px;
    color: #b91c1c;
    text-align: left;
}

/* ── Boutons ── */
.pm-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.pm-btn {
    flex: 1;
    height: 46px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pm-btn-principal {
    background: #2563eb;
    color: #ffffff;
}

.pm-btn-principal:hover:not(:disabled) {
    background: #1d4ed8;
}

.pm-btn-secondaire {
    background: #f1f5f9;
    color: #334155;
}

.pm-btn-secondaire:hover {
    background: #e2e8f0;
}

/* Bouton unique pleine largeur (modal de paiement) */
.pm-btn-bloc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    margin-top: 6px;
    font-size: 15px;
}

.pm-btn-bloc i {
    font-size: 18px;
}

/* ── Mention sous le modal ── */
.pm-mention {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 400px;
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.92);
    text-align: center;
}

.pm-mention i {
    font-size: 14px;
}

/* ── Animations ── */
@keyframes pm-tourne {
    to { transform: rotate(360deg); }
}

@keyframes pm-halo {
    0%   { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.7); opacity: 0; }
}

@keyframes pm-point {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1); opacity: 1; }
}

@keyframes pm-fondu {
    from { opacity: 0; }
}

@keyframes pm-entree {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
}

/* ── Responsive : pleine largeur, boutons empilés, champs en 16 px (pas de zoom sur iPhone) ── */
@media (max-width: 560px) {
    .pm-overlay {
        padding: 12px;
    }

    .pm-card {
        max-height: calc(100vh - 64px);
        padding: 24px 18px 18px;
        border-radius: 14px;
    }

    .pm-titre {
        font-size: 17px;
    }

    .pm-input,
    .tel-input,
    .tel-indicatif {
        font-size: 16px;
    }

    .pm-actions {
        flex-direction: column-reverse;
    }

    .pm-btn {
        flex: none;
        width: 100%;
    }

    .pm-option {
        padding: 10px 4px;
    }

}

/* Écrans peu hauts (téléphone à l'horizontale) */
@media (max-height: 640px) {
    .pm-icone {
        width: 52px;
        height: 52px;
        margin-bottom: 10px;
        font-size: 24px;
    }

    .pm-sous {
        margin-bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pm-overlay,
    .pm-card,
    .pm-icone--attente::before,
    .pm-icone--attente::after,
    .pm-points span {
        animation: none;
    }
}
