/* ==========================================================================
   Realtime 3D Secure 2.0 Overlay Modal — Aquarabia Qiddiya Water Theme Park
   Supports LTR (English) and RTL (Arabic) with deep aquatic branding.
   ========================================================================== */

.cr-overlay-backdrop {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 14, 40, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Tajawal", "Cairo", Helvetica, Arial, sans-serif;
    color: #FFFFFF;
}

.cr-overlay-backdrop.is-active {
    opacity: 1;
    pointer-events: auto;
}

.cr-overlay-backdrop[hidden] {
    display: none !important;
}

/* RTL Support */
.cr-overlay-backdrop.is-rtl {
    direction: rtl;
    text-align: right;
}

.cr-overlay-backdrop.is-rtl .cr-modal-badges {
    flex-direction: row-reverse;
}

.cr-overlay-backdrop.is-rtl .cr-timer-row {
    flex-direction: row-reverse;
}

.cr-overlay-backdrop.is-rtl .cr-modal-close {
    margin-right: 0;
    margin-left: 0;
}

/* Modal Card */
.cr-modal-card {
    background: #111A42;
    border: 1px solid rgba(0, 196, 204, 0.35);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    padding: 28px 24px;
    box-sizing: border-box;
    color: #FFFFFF;
    position: relative;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.75), 0 0 30px rgba(0, 196, 204, 0.12);
    transform: scale(0.95) translateY(16px);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.cr-overlay-backdrop.is-active .cr-modal-card {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.cr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cr-modal-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cr-badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #A5B0D6;
}

.cr-badge-chip svg {
    width: 12px;
    height: 12px;
}

.cr-badge-chip.aquarabia {
    background: rgba(0, 196, 204, 0.15);
    color: #00E5FF;
    border: 1px solid rgba(0, 196, 204, 0.3);
}

.cr-modal-close {
    background: transparent;
    border: 0;
    color: #A5B0D6;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.cr-modal-close:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.1);
}

/* Typography */
.cr-modal-title {
    font-size: 21px;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 8px 0;
    letter-spacing: -0.2px;
    text-align: center;
}

.cr-modal-sub {
    font-size: 13.5px;
    color: #A5B0D6;
    line-height: 1.5;
    margin: 0 0 22px 0;
    text-align: center;
}

/* OTP Digits Input */
.cr-otp-inputs {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 18px;
    direction: ltr !important; /* OTP digits always flow LTR */
}

.cr-otp-digit {
    width: 48px;
    height: 56px;
    background: #182352;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: #FFFFFF;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    box-sizing: border-box;
}

.cr-otp-digit:focus {
    border-color: #00E5FF;
    background: #1F2C66;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.25);
}

.cr-otp-digit.is-error {
    border-color: #FF453A !important;
    background: rgba(255, 69, 58, 0.12);
    animation: crShake 0.4s ease;
}

@keyframes crShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* Timer and Resend Row */
.cr-timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: #8C98C2;
    margin-bottom: 22px;
    padding: 0 2px;
}

.cr-timer-clock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cr-resend-btn {
    background: transparent;
    border: 0;
    color: #FF7919;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: opacity 0.15s;
}

.cr-resend-btn:disabled {
    color: #5A648C;
    cursor: not-allowed;
    text-decoration: none;
}

/* Push Visual Animation */
.cr-push-visual {
    position: relative;
    width: 104px;
    height: 104px;
    margin: 10px auto 22px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cr-pulse-ring {
    position: absolute;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 2px solid rgba(0, 229, 255, 0.5);
    animation: crPulse 2.2s infinite ease-out;
}

.cr-pulse-ring:nth-child(2) {
    animation-delay: 0.7s;
}

@keyframes crPulse {
    0% { transform: scale(0.7); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}

.cr-push-icon-box {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    background: linear-gradient(135deg, #00C4CC 0%, #111D5E 100%);
    box-shadow: 0 10px 25px rgba(0, 196, 204, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    z-index: 2;
    border: 1px solid rgba(0, 229, 255, 0.4);
}

.cr-push-icon-box svg {
    width: 36px;
    height: 36px;
}

.cr-amount-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 22px;
    font-size: 14px;
    color: #FFFFFF;
}

.cr-amount-val {
    font-weight: 800;
    color: #FF7919;
    font-size: 16px;
}

/* Alert Notification Banner */
.cr-alert-banner {
    background: rgba(255, 69, 58, 0.15);
    border: 1px solid rgba(255, 69, 58, 0.4);
    color: #FF6961;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cr-alert-banner[hidden] {
    display: none !important;
}

.cr-success-banner {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ADE80;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cr-success-banner[hidden] {
    display: none !important;
}

/* Action Buttons */
.cr-btn-primary {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, #FF7919 0%, #FF5500 100%);
    color: #FFFFFF;
    border: 0;
    border-radius: 14px;
    font-size: 15.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 22px rgba(255, 121, 25, 0.35);
    transition: transform 0.12s, box-shadow 0.18s, filter 0.18s;
}

.cr-btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 8px 28px rgba(255, 121, 25, 0.45);
}

.cr-btn-primary:active {
    transform: scale(0.98);
}

.cr-btn-primary:disabled {
    background: #2A335E;
    color: #6C78A8;
    cursor: not-allowed;
    box-shadow: none;
}

.cr-btn-secondary {
    width: 100%;
    height: 44px;
    background: transparent;
    color: #A5B0D6;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.cr-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Security Footer Note */
.cr-modal-footer-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11.5px;
    color: #8C98C2;
    margin-top: 20px;
    text-align: center;
}

.cr-modal-footer-note svg {
    width: 13px;
    height: 13px;
    color: #22C55E;
}

@keyframes crSpin {
    to { transform: rotate(360deg); }
}

.cr-spinner {
    width: 50px;
    height: 50px;
    border: 3.5px solid rgba(0, 229, 255, 0.2);
    border-top-color: #00E5FF;
    border-radius: 50%;
    animation: crSpin 0.8s linear infinite;
    margin: 0 auto 20px;
}

