/**
 * OTP Styling - CSS classes for OTP verification components
 */

/* OTP Input Container */
.otp-input-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

/* Individual OTP Digit Input */
.otp-digit-input {
    width: 3rem;
    height: 3rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: bold;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: white;
    color: #1f2937; /* Dark gray text color for better visibility */
    transition: all 0.2s ease-in-out;
    outline: none;
}

.otp-digit-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
    color: #1f2937; /* Ensure text remains visible when focused */
}

.otp-digit-input:invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
    color: #991b1b; /* Dark red text for invalid state */
}

.otp-digit-input:valid {
    border-color: #10b981;
    background-color: #f0fdf4;
    color: #065f46; /* Dark green text for valid state */
}

/* OTP Countdown Timer */
.otp-countdown-timer {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.otp-countdown-timer.active {
    color: #3b82f6;
    font-weight: 600;
}

.otp-countdown-timer.expired {
    color: #ef4444;
}

/* OTP Success State */
.otp-success-state {
    background-color: #f0fdf4;
    border-color: #10b981;
    color: #065f46;
}

.otp-success-state .otp-digit-input {
    border-color: #10b981;
    background-color: #f0fdf4;
    color: #065f46;
}

/* OTP Error State */
.otp-error-state {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.otp-error-state .otp-digit-input {
    border-color: #ef4444;
    background-color: #fef2f2;
    color: #991b1b;
    animation: shake 0.5s ease-in-out;
}

/* Shake animation for error state */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: bold;
    transition: all 0.3s ease-in-out;
}

.progress-step-number.active {
    background-color: #3b82f6;
    color: white;
}

.progress-step-number.completed {
    background-color: #10b981;
    color: white;
}

.progress-step-number.pending {
    background-color: #d1d5db;
    color: #6b7280;
}

.progress-step-label {
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease-in-out;
}

.progress-step-label.active {
    color: #1f2937;
}

.progress-step-label.completed {
    color: #10b981;
}

.progress-step-label.pending {
    color: #6b7280;
}

.progress-line {
    width: 2rem;
    height: 0.125rem;
    background-color: #d1d5db;
    transition: all 0.3s ease-in-out;
}

.progress-line.completed {
    background-color: #10b981;
}

/* OTP Info Section */
.otp-info-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.otp-info-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background-color: #dbeafe;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
}

.otp-info-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.otp-info-description {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.otp-info-phone {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 0.25rem;
}

/* Resend OTP Button */
.resend-otp-btn {
    color: #3b82f6;
    font-size: 0.875rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.resend-otp-btn:hover:not(:disabled) {
    color: #1d4ed8;
    text-decoration: underline;
}

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

/* Verify OTP Button */
.verify-otp-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #10b981, #059669, #047857);
    color: white;
    font-weight: bold;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.verify-otp-btn:hover:not(:disabled) {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.4);
}

.verify-otp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

/* Send OTP Button */
.send-otp-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #3b82f6, #6366f1, #8b5cf6);
    color: white;
    font-weight: bold;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.send-otp-btn:hover:not(:disabled) {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.4);
}

.send-otp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

/* Loading States */
.loading-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 640px) {
    .otp-digit-input {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.125rem;
    }
    
    .otp-input-container {
        gap: 0.25rem;
    }
    
    .progress-indicator {
        gap: 0.5rem;
    }
    
    .progress-step-number {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.75rem;
    }
    
    .progress-line {
        width: 1.5rem;
    }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    .otp-digit-input {
        background-color: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .otp-digit-input:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
    }
    
    .otp-info-title {
        color: #f9fafb;
    }
    
    .otp-info-phone {
        color: #f9fafb;
    }
}
