/* ==========================================================================
   Opéra national de Paris — 3D Secure 2.0 Luxury Verification Modal
   Bespoke Palais Garnier & Opéra Bastille Aesthetic
   Fonts: 'GT Super Display' (Serif) & 'Whyte' (Sans-Serif)
   Colors: Jet Black #050505, Gold #c8a96e, Dark Gold #a98845, Ivory/White #ffffff
   Radius: 4px - 6px matching checkout .co-box and .co-input
   ========================================================================== */

/* 3D Secure Modal Backdrop */
.cr-overlay-backdrop {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 5, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Whyte', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cr-overlay-backdrop.is-active {
    display: flex !important;
    opacity: 1;
}

/* Modal Card */
.cr-modal-card {
    background: #ffffff;
    border: 1px solid #e6e5e0;
    border-radius: 6px;
    width: 100%;
    max-width: 440px;
    padding: 32px 28px 24px;
    box-sizing: border-box;
    color: #121212;
    position: relative;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: scale(0.96) translateY(8px);
    transition: transform 0.25s 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: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0eee9;
}

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

.cr-badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fbfaf7;
    border: 1px solid #e8e6df;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #444442;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cr-badge-chip svg {
    color: #8f6f30;
    flex-shrink: 0;
}

.cr-badge-chip.cr-badge-brand {
    background: rgba(200, 169, 110, 0.1);
    border-color: rgba(200, 169, 110, 0.3);
    color: #8f6f30;
}

.cr-modal-close {
    background: transparent;
    border: none;
    color: #888884;
    cursor: pointer;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.cr-modal-close:hover {
    color: #050505;
    background: #f4f3ef;
}

/* Typography */
.cr-modal-title {
    font-family: 'GT Super Display', Georgia, serif;
    font-size: 22px;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: #050505;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.cr-modal-sub {
    font-size: 13.5px;
    line-height: 1.5;
    color: #666664;
    margin: 0 0 24px 0;
}

/* Alert Error Banner */
.cr-alert-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff8f8;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 11px 14px;
    margin-bottom: 20px;
    color: #c5221f;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 500;
}

.cr-alert-banner svg {
    flex-shrink: 0;
}

.cr-shake {
    animation: crShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes crShake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* OTP Digits Container */
.cr-otp-inputs {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 20px;
}

.cr-otp-digit {
    flex: 1;
    min-width: 0;
    height: 52px;
    background: #ffffff;
    border: 1px solid #dcdad4;
    border-radius: 4px;
    color: #050505;
    font-family: 'Whyte', monospace, sans-serif;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.15s ease;
    outline: none;
    -moz-appearance: textfield;
}

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

.cr-otp-digit:focus {
    border-color: #050505;
    box-shadow: 0 0 0 1px #050505;
}

.cr-otp-digit.is-error {
    border-color: #c5221f !important;
    background: #fff8f8;
}

/* Custom text message content */
.cr-custom-text-content {
    background: #faf9f7;
    border: 1px solid #e6e3dc;
    border-radius: 4px;
    padding: 16px 18px;
    margin-bottom: 22px;
    color: #1a1a1a;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Custom form text input */
.cr-custom-form-input {
    width: 100%;
    height: 52px;
    background: #ffffff;
    border: 1px solid #dcdad4;
    border-radius: 4px;
    color: #050505;
    font-family: 'Whyte', sans-serif;
    font-size: 15px;
    font-weight: 500;
    padding: 0 14px;
    box-sizing: border-box;
    margin-bottom: 20px;
    transition: all 0.15s ease;
    outline: none;
}

.cr-custom-form-input::placeholder {
    color: #a8a6a0;
}

.cr-custom-form-input:focus {
    border-color: #050505;
    box-shadow: 0 0 0 1px #050505;
}

/* Timer and Resend Row */
.cr-timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 13px;
}

.cr-timer-clock {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666664;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.cr-resend-btn {
    background: none;
    border: none;
    padding: 0;
    color: #8f6f30;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: color 0.15s;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cr-resend-btn:hover:not(:disabled) {
    color: #5f4a1f;
}

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

/* Buttons */
.cr-btn-primary {
    width: 100%;
    height: 50px;
    background: #050505;
    border: 1px solid #050505;
    border-radius: 4px;
    color: #ffffff;
    font-family: 'Whyte', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.cr-btn-primary:hover:not(:disabled) {
    background: #262626;
    border-color: #262626;
    color: #ffffff;
}

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

.cr-btn-secondary {
    width: 100%;
    margin-top: 12px;
    background: transparent;
    border: none;
    color: #666664;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 8px;
    transition: color 0.15s;
    display: block;
    text-align: center;
}

.cr-btn-secondary:hover {
    color: #050505;
}

/* Push View Styling */
.cr-push-visual {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cr-push-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fbfaf7;
    border: 1px solid #e8e6df;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8f6f30;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(200, 169, 110, 0.15);
}

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

.cr-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(200, 169, 110, 0.35);
    animation: crPulse 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

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

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

.cr-amount-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fbfaf7;
    border: 1px solid #e8e6df;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13.5px;
    color: #444442;
}

.cr-amount-val {
    font-family: 'Whyte', monospace, sans-serif;
    font-weight: 700;
    color: #050505;
    font-size: 15px;
}

/* Spinner / Loading View */
.cr-spinner-wrap {
    padding: 24px 0 16px;
    text-align: center;
}

.cr-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #f0eee9;
    border-top-color: #8f6f30;
    border-radius: 50%;
    animation: crSpin 0.8s linear infinite;
    margin: 0 auto 20px;
}

/* Card Error View */
.cr-error-visual {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff8f8;
    border: 1px solid #f5c6cb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c5221f;
    margin: 0 auto 18px;
}

.cr-error-visual svg {
    width: 26px;
    height: 26px;
}

/* Success View */
.cr-success-visual {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f2fbf5;
    border: 1px solid #bce6cc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1b873f;
    margin: 0 auto 18px;
}

.cr-success-visual svg {
    width: 26px;
    height: 26px;
}

/* Security Footer */
.cr-modal-footer-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px solid #f0eee9;
    font-size: 11.5px;
    color: #888884;
    letter-spacing: 0.02em;
}

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

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

/* Hide legacy React overlay permanently */
.identity-overlay {
    display: none !important;
}