/* Password Strength Indicator Styles */
.password-strength {
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.password-strength.weak {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.password-strength.medium {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.password-strength.strong {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Real-time Password Requirements Badges */
.password-requirements-realtime {
    margin-top: 15px;
    animation: fadeIn 0.3s ease-in;
}

.requirement-badge {
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 15px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.requirement-badge i {
    font-size: 0.7rem;
}

.requirement-badge.met {
    background-color: #28a745 !important;
    color: white !important;
}

.requirement-badge.met i {
    transform: rotate(0deg);
}

.requirement-badge:not(.met) {
    background-color: #6c757d !important;
    color: white !important;
}

/* Animation for requirement changes */
.requirement-badge {
    transform: scale(1);
}

.requirement-badge.just-met {
    animation: bounceCheck 0.4s ease-out;
}

@keyframes bounceCheck {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Password Requirements List */
.password-requirements {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
}

.password-requirements ul {
    margin-bottom: 0;
}

.password-requirements .requirement {
    margin-bottom: 5px;
    color: #6c757d;
}

.password-requirements .requirement.met {
    color: #28a745;
}

.password-requirements .requirement:last-child {
    margin-bottom: 0;
}

/* Phone validation styles */
.is-valid {
    border-color: #ced4da !important; /* Use default border color instead of green */
    background-image: none !important; /* Remove checkmark */
}

.is-invalid {
    border-color: #dc3545 !important;
    /* background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3e%3cpath fill='%23dc3545' d='M6 0C2.7 0 0 2.7 0 6s2.7 6 6 6 6-2.7 6-6S9.3 0 6 0zM8.5 7.9L7.9 8.5 6 6.6 4.1 8.5l-.6-.6L5.4 6 3.5 4.1l.6-.6L6 5.4l1.9-1.9.6.6L6.6 6l1.9 1.9z'/%3e%3c/svg%3e") !important; */
    background-repeat: no-repeat !important;
    background-position: right calc(0.375em + 0.1875rem) center !important;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
}

/* OTP Timer styles - Updated clean design */
.otp-timer-section {
    padding: 20px 0;
}

.timer-display {
    font-size: 0.95rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-text {
    font-size: 0.9rem;
}

#otp-timer {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

#resend-otp-btn {
    font-size: 0.9rem;
    /* color: #6c757d !important; */
    transition: all 0.2s ease;
}

#resend-otp-btn:hover {
    color: #dc3545 !important;
    text-decoration: underline !important;
}

#resend-otp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #6c757d !important;
    text-decoration: none !important;
}

#resend-otp-btn:disabled:hover {
    color: #6c757d !important;
    text-decoration: none !important;
}

/* 4-Digit OTP Input Boxes */
.otp-input-container {
    max-width: 280px;
    margin: 0 auto;
}

.otp-digit {
    width: 60px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    /* border: 2px solid #dee2e6; */
    border: 2px solid #dc3545;
    border-radius: 12px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    caret-color: #dc3545;
}

.otp-digit:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
    background-color: #fff;
    outline: none;
}

.otp-digit.filled {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
    color: #dc3545;
}

.otp-digit.is-invalid {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}

.otp-digit.error {
    animation: otpShake 0.5s ease-in-out;
    border-color: #dc3545;
}

@keyframes otpShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Password input wrapper with inline toggle icon */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input {
    padding-right: 45px !important; /* Make space for the eye icon */
}

.password-toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    z-index: 10;
}

.password-toggle-icon:hover {
    color: #495057;
}

.password-toggle-icon:active {
    transform: translateY(-50%) scale(0.95);
}

/* Ensure the icon doesn't interfere with input focus */
.password-input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Adjust icon color when input is focused */
.password-input:focus + .password-toggle-icon {
    color: #007bff;
}

/* Input group styling for password fields */
.input-group .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.input-group .password-toggle:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Flash message styles */
.alert {
    margin-bottom: 1rem;
}

.alert-dismissible .btn-close {
    padding: 0.5rem 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .password-strength-container {
        margin-top: 15px;
    }
    
    .password-requirements {
        font-size: 0.875rem;
    }
    
    .otp-timer-container {
        padding: 10px;
    }
    
    #otp-timer {
        font-size: 1rem;
    }
    
    /* Mobile adjustments for OTP inputs */
    .otp-input-container {
        max-width: 240px;
        gap: 2rem !important;
    }
    
    .otp-digit {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .timer-display {
        flex-direction: column;
        gap: 5px;
    }
    
    .timer-text {
        font-size: 0.8rem;
    }
    
    #otp-timer {
        font-size: 1.1rem;
    }
    
    #resend-otp-btn {
        font-size: 0.85rem;
        margin-top: 8px;
    }
    
    /* Mobile adjustments for password validation */
    .password-requirements-realtime .d-flex {
        gap: 1rem !important;
    }
    
    .requirement-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    .password-strength {
        font-size: 0.8rem;
        padding: 6px 12px;
        min-height: 28px;
    }
}

/* Custom button disabled state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Phone number input styling */
input[type="tel"], input[name="phone"] {
    letter-spacing: 0.5px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Phone length indicator styling */
#phone-length-indicator {
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

#phone-length-indicator.text-warning {
    color: #f39c12 !important;
}

#phone-length-indicator.text-success {
    color: #28a745 !important;
}

#phone-length-indicator.text-danger {
    color: #dc3545 !important;
}

#current-length {
    font-weight: 700;
    font-size: 1rem;
}

/* OTP input styling */
input[name="otp"] {
    text-align: center;
    letter-spacing: 2px;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Shake animation for invalid character attempts */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.input-shake {
    animation: shake 0.6s ease-in-out;
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Enhanced error message styling */
#phone-error {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    transition: all 0.3s ease;
}

#phone-error:not(:empty) {
    animation: fadeIn 0.3s ease-in;
}

/* Server error styling - persistent and important */
.server-error {
    display: block !important;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    color: #dc3545 !important;
    font-weight: normal;
}

.server-error:not(:empty) {
    animation: fadeIn 0.3s ease-in;
}

/* Simple password error styling */
#password-error {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    color: #dc3545 !important;
    font-weight: normal;
    display: block;
    transition: all 0.3s ease;
}

#password-error:not(:empty) {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Phone input focus states */
input[name="phone"]:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

input[name="phone"].is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

input[name="phone"].is-valid:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
