/* ==========================================================================
   review-otp.css
   Bottom sheet OTP — mobile-first, desktop-compatible
   ========================================================================== */

/* ── Backdrop ─────────────────────────────────────────────────────────── */
#otp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.otp-sheet--open ~ #otp-backdrop,
#otp-backdrop.otp-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Bottom sheet container ───────────────────────────────────────────── */
#otp-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);

    /* État fermé — glissé hors écran */
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Hauteur max sur mobile */
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── État ouvert ── */
#otp-bottom-sheet.otp-sheet--open {
    transform: translateY(0);
}

/* ── Handle (drag indicator) ── */
.otp-sheet-handle {
    display: flex;
    justify-content: center;
    padding: 14px 0 8px;
}

.otp-sheet-handle::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
}

/* ── Contenu ── */
.otp-sheet-content {
    padding: 8px 28px 40px;
}

/* ── Header ── */
.otp-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.otp-sheet-title {
    font-size: 20px;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 6px;
}

.otp-sheet-subtitle {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
    max-width: 280px;
}

.otp-close-btn {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #6b7280;
    flex-shrink: 0;
    margin-left: 12px;
    transition: background 0.2s;
}

.otp-close-btn:hover {
    background: #e5e7eb;
}

/* ── Message info (email envoyé à…) ── */
.otp-info-message {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #1e40af;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* ── Cases OTP ── */
.otp-inputs-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

.otp-input {
    width: 46px;
    height: 56px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    font-size: 26px;
    font-weight: 800;
    text-align: center;
    color: #1f2937;
    background: #f9fafb;
    transition: border-color 0.2s, background 0.2s, transform 0.1s;
    caret-color: transparent;
    outline: none;

    /* Pavé numérique natif sur mobile */
    inputmode: numeric;
}

.otp-input:focus {
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    transform: scale(1.05);
}

.otp-input:not(:placeholder-shown) {
    border-color: #6366f1;
    background: #eef2ff;
}

/* ── Animation shake (code incorrect) ── */
@keyframes otp-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.otp-shake {
    animation: otp-shake 0.45s ease;
}

/* ── Messages erreur / succès ── */
#otp-error {
    display: none;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: #991b1b;
    text-align: center;
    margin-bottom: 16px;
}

#otp-success {
    display: none;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: #065f46;
    text-align: center;
    margin-bottom: 16px;
}

/* ── Bouton Vérifier ── */
#otp-submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    margin-bottom: 16px;
}

#otp-submit-btn:hover {
    opacity: 0.92;
}

#otp-submit-btn:active {
    transform: scale(0.98);
}

#otp-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Lien renvoi ── */
#otp-resend-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #6366f1;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

#otp-resend-btn:hover:not(:disabled) {
    background: #f5f3ff;
    border-color: #c4b5fd;
}

#otp-resend-btn:disabled {
    color: #9ca3af;
    border-color: #f3f4f6;
    cursor: not-allowed;
}

/* ── Expiration info ── */
.otp-expiry-info {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 14px;
}

/* ── Messages formulaire (erreurs + succès) ── */
#review-form-errors {
    display: none;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    color: #991b1b;
    margin-bottom: 20px;
}

#review-success-message {
    display: none;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-left: 4px solid #10b981;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    color: #065f46;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ── Badge avis vérifié (dans les cards) ── */
.rv-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #d1fae5;
    color: #065f46;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-left: auto;
}

/* ── Desktop — modale centrée ── */
@media (min-width: 640px) {
    #otp-bottom-sheet {
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -60%);
        width: 480px;
        border-radius: 20px;
        max-height: 90vh;
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    

    #otp-bottom-sheet.otp-sheet--open {
        transform: translate(-50%, -50%);
        opacity: 1;
        pointer-events: auto;
    }

    .otp-sheet-handle {
        display: none; /* Pas de handle sur desktop */
    }

    .otp-sheet-content {
        padding: 24px 36px 36px;
    }

    .otp-input {
        width: 52px;
        height: 62px;
        font-size: 28px;
    }
}

/* ── Animation entrée card avis ── */
.review-card--new {
    border: 2px solid #d1fae5 !important;
}