/**
 * Popup OTP candidat — style maquette (RTL), compteur circulaire, cases chiffres.
 */
.otp-modal-dialog {
    width: 92%;
    max-width: 380px;
    margin: 40px auto;
}

.otp-modal-content {
    position: relative;
    border: 2px solid #1a365d;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(26, 54, 93, 0.18);
    overflow: hidden;
}

.otp-modal-content .otp-modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    border: none;
    padding: 8px 12px;
    min-height: 0;
    /* Le header ne doit pas bloquer les clics hors du bouton × */
    pointer-events: none;
}

.otp-modal-content .otp-modal-header .close {
    pointer-events: auto;
    float: left; /* coin physique gauche (visible en RTL) */
    position: relative;
    z-index: 6;
    margin: 0;
    padding: 0 6px;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    color: #1a365d;
    opacity: 0.7;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.otp-modal-content .otp-modal-header .close:hover {
    opacity: 1;
}

.otp-modal-body {
    padding: 36px 28px 28px;
    text-align: center;
}

.otp-modal-title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    color: #1a365d;
    text-align: right;
}

.otp-modal-hint {
    margin: 0 0 10px;
    font-size: 14px;
    color: #8a93a2;
    text-align: right;
}

.otp-phone-reminder {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1a365d;
    text-align: right;
    direction: rtl;
}

.otp-channel-msg {
    display: none;
}

.otp-patience {
    margin: 0 0 16px;
    font-size: 12px;
    line-height: 1.5;
    color: #6b7280;
    text-align: right;
}

.otp-timer {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 8px auto 22px;
}

.otp-timer svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.otp-timer-track {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 8;
}

.otp-timer-progress {
    fill: none;
    stroke: #1a365d;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.35s linear;
}

.otp-timer-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: #1a365d;
    font-variant-numeric: tabular-nums;
    direction: ltr;
}

.otp-digits {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 0 18px;
    direction: ltr;
}

.otp-digit {
    width: 42px;
    height: 48px;
    border: 1.5px solid #cfd5de;
    border-radius: 8px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: #1a365d;
    outline: none;
    box-shadow: none;
    -moz-appearance: textfield;
}

.otp-digit::-webkit-outer-spin-button,
.otp-digit::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-digit:focus,
.otp-digit.otp-digit-active {
    border-color: #1a365d;
    box-shadow: 0 0 0 2px rgba(26, 54, 93, 0.12);
}

#otpInput.otp-input-hidden {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.otp-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.otp-btn-primary,
.otp-btn-resend {
    display: block;
    width: 100%;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    line-height: 1.3;
}

.otp-btn-primary {
    background: #1a365d;
    color: #fff;
}

.otp-btn-primary:hover,
.otp-btn-primary:focus {
    background: #152a4a;
    color: #fff;
}

.otp-btn-resend {
    background: #f5a623;
    color: #1a365d;
}

.otp-btn-resend:hover,
.otp-btn-resend:focus {
    background: #e89510;
    color: #1a365d;
}

.otp-btn-resend[disabled],
.otp-btn-resend.disabled {
    background: #f3d9a8;
    color: #8a93a2;
    cursor: not-allowed;
    opacity: 1;
}

#otpError.otp-error {
    margin: 0 0 12px;
    text-align: right;
}

#otpDebugBox.otp-debug {
    margin-bottom: 14px;
    text-align: center;
}

/* Reset MDP : même langage bouton renvoi */
.otp-resend-inline {
    display: inline-block;
    margin-top: 4px;
}

.otp-phone-reminder-page {
    margin: 8px 0 12px;
    font-weight: 600;
    color: #1a365d;
}

.otp-patience-page {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 10px;
}

@media (max-width: 400px) {
    .otp-modal-body {
        padding: 4px 18px 22px;
    }

    .otp-digit {
        width: 36px;
        height: 44px;
        font-size: 20px;
    }

    .otp-digits {
        gap: 6px;
    }
}

/* Bannière verrouillage formulaire pendant attente OTP */
.otp-form-lock-banner {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid #93c5fd;
    background: #eff6ff;
    color: #1e3a5f;
    border-radius: 8px;
    line-height: 1.6;
}

.otp-form-lock-banner .otp-form-lock-msg {
    margin: 0 0 10px;
    font-weight: 600;
}

.otp-form-lock-banner .otp-form-lock-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.otp-form-lock-banner .otp-form-lock-actions .btn {
    margin: 0;
}

form.otp-form-locked {
    opacity: 0.92;
}

