/**
 * OTP Modal Styles
 * Beautiful, modern modal design with glassmorphism effects
 */

/* OTP Modal Overlay */
.otp-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 20000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.otp-modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* OTP Modal Container */
.otp-modal-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    max-width: 450px;
    width: 90%;
    box-shadow: 
        0 20px 60px rgba(102, 126, 234, 0.3),
        0 0 0 1px rgba(102, 126, 234, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

@keyframes modalSlideIn {
    0% {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Decorative gradient top border */
.otp-modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 30%, #f093fb 60%, #4facfe 100%);
    background-size: 300% 100%;
    animation: gradientShift 4s ease infinite;
    z-index: 1;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Modal Header */
.otp-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 3px solid rgba(118, 75, 162, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.otp-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
}

.otp-modal-icon {
    font-size: 2.5em;
    animation: iconBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    z-index: 1;
    position: relative;
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.1);
    }
}

.otp-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.6em;
    font-weight: bold;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
    flex: 1;
    z-index: 1;
    position: relative;
}

/* Modal Body */
.otp-modal-body {
    padding: 30px;
    background: white;
    position: relative;
}

.otp-modal-message {
    text-align: center;
    color: #555;
    font-size: 1.05em;
    line-height: 1.6;
    margin-bottom: 25px;
}

.otp-modal-message strong {
    color: #667eea;
    font-weight: 600;
}

.otp-resend-button.disabled {
    opacity: 0.6;
    filter: grayscale(100%);
    cursor: not-allowed;
}

.otp-neutral-message {
    margin: 8px 0 12px;
    color: #374151;
    font-weight: 600;
    font-size: 0.95em;
    text-align: center;
}

/* OTP Input Container */
.otp-input-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.otp-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.otp-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 
        0 0 0 5px rgba(102, 126, 234, 0.12),
        0 6px 20px rgba(102, 126, 234, 0.2);
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
}

.otp-input.filled {
    border-color: #4caf50;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

/* Error Message */
.otp-error-message {
    display: none;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95em;
    text-align: left;
    border-left: 4px solid #c62828;
    animation: slideDown 0.3s ease;
    line-height: 1.6;
}

.otp-error-message strong {
    font-weight: 600;
    color: #b71c1c;
}

.otp-error-message.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success Message */
.otp-success-message {
    display: none;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95em;
    text-align: center;
    border-left: 4px solid #4caf50;
    animation: slideDown 0.3s ease;
}

.otp-success-message.show {
    display: block;
}

/* Resend OTP Section */
.otp-resend-container {
    text-align: center;
    margin-bottom: 20px;
}

.otp-resend-timer {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 10px;
}

.otp-resend-timer .timer-value {
    color: #667eea;
    font-weight: bold;
    font-size: 1.1em;
}

.otp-resend-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.otp-resend-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.otp-resend-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Footer */
.otp-modal-footer {
    padding: 20px 30px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-top: 2px solid #bdbdbd;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Buttons */
.otp-button {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.otp-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.otp-button:hover::before {
    width: 300px;
    height: 300px;
}

.otp-button-verify {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.otp-button-verify:hover:not(:disabled) {
    background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.otp-button-cancel {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.otp-button-cancel:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.6);
}

.otp-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading Spinner */
.otp-loading-spinner {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.otp-loading-spinner.show {
    display: block;
}

.spinner {
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Success Checkmark Animation */
.otp-success-checkmark {
    display: none;
    text-align: center;
    margin: 20px 0;
    font-size: 3em;
    animation: checkmarkBounce 0.6s ease;
}

.otp-success-checkmark.show {
    display: block;
}

@keyframes checkmarkBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .otp-modal-container {
        max-width: 95%;
        width: 95%;
    }
    
    .otp-modal-header {
        padding: 20px 25px;
    }
    
    .otp-modal-header h3 {
        font-size: 1.3em;
    }
    
    .otp-modal-icon {
        font-size: 2em;
    }
    
    .otp-modal-body {
        padding: 25px 20px;
    }
    
    .otp-input {
        width: 45px;
        height: 55px;
        font-size: 20px;
    }
    
    .otp-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .otp-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .otp-input-container {
        gap: 8px;
    }
    
    .otp-input {
        width: 40px;
        height: 50px;
        font-size: 18px;
    }
    
    .otp-modal-header h3 {
        font-size: 1.1em;
    }
}

/* Accessibility */
.otp-modal-container:focus {
    outline: none;
}

.otp-input:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

