/* Sugee Marina Bay - Premium Email OTP Verification Modal */

.otp-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 32, 54, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.otp-modal-backdrop.is-active {
    opacity: 1;
    visibility: visible;
}

.otp-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 16px;
    box-shadow: 0 25px 60px -10px rgba(9, 32, 54, 0.35), 0 0 0 1px rgba(8, 110, 180, 0.15);
    overflow: hidden;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.otp-modal-top-accent {
    height: 4px;
    background: linear-gradient(90deg, #086EB4 0%, #38bdf8 50%, #C5A880 100%);
}

.otp-modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
    z-index: 10;
}

.otp-modal-close-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: rotate(90deg);
}

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

.otp-modal-icon-wrap {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(8, 110, 180, 0.12) 0%, rgba(8, 110, 180, 0.24) 100%);
    border: 1px solid rgba(8, 110, 180, 0.3);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #086EB4;
    box-shadow: 0 8px 20px rgba(8, 110, 180, 0.15);
}

.otp-modal-icon-wrap svg {
    width: 28px;
    height: 28px;
}

.otp-modal-title {
    font-family: var(--freight, Georgia, serif);
    font-size: 26px;
    font-weight: 600;
    color: #092036;
    margin: 0 0 6px;
    letter-spacing: 0.5px;
}

.otp-modal-subtitle {
    font-family: var(--montserrat, sans-serif);
    font-size: 13px;
    color: #64748b;
    margin: 0 0 14px;
    line-height: 1.5;
}

.otp-email-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f5f8;
    border: 1px solid rgba(8, 110, 180, 0.25);
    border-radius: 20px;
    padding: 5px 14px 5px 16px;
    margin-bottom: 22px;
    max-width: 100%;
}

.otp-target-email {
    font-family: var(--montserrat, sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: #086EB4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}

.otp-edit-email-btn {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: color 0.15s ease;
}

.otp-edit-email-btn:hover {
    color: #086EB4;
}

/* Edit email inline form if user needs to fix email */
.otp-change-email-box {
    display: none;
    margin-bottom: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.otp-change-email-box.is-open {
    display: block;
}

.otp-change-email-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 8px;
    font-family: var(--montserrat, sans-serif);
}

.otp-change-email-input:focus {
    border-color: #086EB4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(8, 110, 180, 0.2);
}

.otp-change-email-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.otp-change-email-actions button {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.otp-save-email-btn {
    background: #086EB4;
    color: #fff;
    border: none;
}

.otp-cancel-email-btn {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #64748b;
}

/* 6-digit input boxes */
.otp-digit-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0 0 20px;
}

.otp-digit-input {
    width: 50px;
    height: 56px;
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: #086EB4;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    font-family: var(--montserrat, sans-serif);
    -moz-appearance: textfield;
}

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

.otp-digit-input:focus {
    background: #ffffff;
    border-color: #086EB4;
    box-shadow: 0 0 0 3px rgba(8, 110, 180, 0.2);
    transform: translateY(-2px);
}

.otp-digit-input.is-filled {
    border-color: #086EB4;
    background: #ffffff;
}

.otp-digit-group.is-invalid .otp-digit-input {
    border-color: #ef4444;
    background: #fef2f2;
    color: #b91c1c;
}

/* Shake animation on invalid input */
.otp-digit-group.shake {
    animation: otpShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes otpShake {
    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); }
}

/* Alert messages */
.otp-alert {
    display: none;
    font-family: var(--montserrat, sans-serif);
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    text-align: left;
    line-height: 1.4;
}

.otp-alert.is-visible {
    display: flex;
    align-items: center;
    gap: 8px;
}

.otp-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.otp-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.otp-alert-info {
    background: #f0f9ff;
    color: #075985;
    border: 1px solid #bae6fd;
}

/* Action button */
.otp-verify-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 8px;
    background: #086EB4;
    color: #ffffff;
    font-family: var(--montserrat, sans-serif);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(8, 110, 180, 0.3);
    transition: all 0.2s ease;
}

.otp-verify-btn:hover:not(:disabled) {
    background: #06548a;
    box-shadow: 0 6px 20px rgba(8, 110, 180, 0.4);
    transform: translateY(-1px);
}

.otp-verify-btn:active:not(:disabled) {
    transform: translateY(0);
}

.otp-verify-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

/* Spinner inside button */
.otp-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: otpSpin 0.7s linear infinite;
    display: none;
}

.otp-verify-btn.is-loading .otp-spinner {
    display: inline-block;
}

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

/* Resend section */
.otp-resend-row {
    font-family: var(--montserrat, sans-serif);
    font-size: 13px;
    color: #64748b;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.otp-resend-link {
    color: #086EB4;
    font-weight: 600;
    text-decoration: underline;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
    font-family: inherit;
}

.otp-resend-link:hover:not(:disabled) {
    color: #05406b;
}

.otp-resend-link:disabled {
    color: #94a3b8;
    text-decoration: none;
    cursor: not-allowed;
}

.otp-countdown-text {
    font-weight: 600;
    color: #086EB4;
}

/* Bottom hint */
.otp-security-note {
    font-family: var(--montserrat, sans-serif);
    font-size: 11px;
    color: #94a3b8;
    margin-top: 16px;
    line-height: 1.4;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .otp-modal-card {
        border-radius: 12px;
    }

    .otp-modal-body {
        padding: 24px 18px 20px;
    }

    .otp-modal-title {
        font-size: 22px;
    }

    .otp-digit-group {
        gap: 6px;
    }

    .otp-digit-input {
        width: 42px;
        height: 50px;
        font-size: 22px;
        border-radius: 8px;
    }

    .otp-target-email {
        max-width: 180px;
    }
}

@media (max-width: 360px) {
    .otp-digit-group {
        gap: 4px;
    }

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