/* OTP Input Fields - Custom Styling for Forgot Password Feature */

/* Main OTP Container */
.otp-input-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 0 5px;
}

/* Individual OTP Input Fields */
.otp-input {
    width: 45px;
    height: 55px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: #fff;
    color: #495057;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Remove number input arrows */
.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Focus State */
.otp-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background-color: #fff;
    transform: scale(1.05);
}

/* Hover State */
.otp-input:hover:not(:focus):not(.error):not(.success) {
    border-color: #c6d0dd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Error State */
.otp-input.error {
    border-color: #dc3545;
    background-color: #fff5f5;
    color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    animation: shake 0.5s ease-in-out;
}

/* Success State - Visual feedback for completed input */
.otp-input.success {
    border-color: #28a745;
    background-color: #f8fff9;
    color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
}

/* Filled State - When input has value */
.otp-input.filled {
    border-color: #6c757d;
    background-color: #f8f9fa;
    font-weight: 900;
}

/* Disabled State */
.otp-input:disabled {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Shake Animation for Error State */
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Pulse Animation for Success */
@keyframes pulse-success {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.otp-input.success {
    animation: pulse-success 0.3s ease-in-out;
}

/* OTP Container Helper Text */
.otp-helper-text {
    text-align: center;
    font-size: 14px;
    color: #6c757d;
    margin-top: 10px;
}

.otp-helper-text.error {
    color: #dc3545;
    font-weight: 500;
}

.otp-helper-text.success {
    color: #28a745;
    font-weight: 500;
}

/* Countdown Timer Styling */
.otp-countdown {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #6c757d;
}

.otp-countdown.warning {
    color: #ffc107;
    font-weight: 500;
}

.otp-countdown.danger {
    color: #dc3545;
    font-weight: 600;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%,
    50% {
        opacity: 1;
    }
    51%,
    100% {
        opacity: 0.5;
    }
}

/* Resend OTP Button */
.otp-resend-btn {
    background: none;
    border: none;
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    margin-top: 10px;
}

.otp-resend-btn:hover {
    color: #0056b3;
    text-decoration: none;
}

.otp-resend-btn:disabled {
    color: #6c757d;
    cursor: not-allowed;
    text-decoration: none;
}

/* Mobile Responsive Design */
@media (max-width: 767.98px) {
    .otp-input-container {
        gap: 8px;
        margin: 15px 0;
        padding: 0;
    }

    .otp-input {
        width: 40px;
        height: 50px;
        font-size: 20px;
        border-radius: 6px;
    }

    .otp-helper-text {
        font-size: 13px;
        margin-top: 8px;
    }

    .otp-countdown {
        font-size: 13px;
        margin-top: 12px;
    }
}

@media (max-width: 575.98px) {
    .otp-input-container {
        gap: 6px;
        margin: 12px 0;
    }

    .otp-input {
        width: 35px;
        height: 45px;
        font-size: 18px;
        border-radius: 5px;
    }
}

/* Extra small devices (portrait phones, less than 375px) */
@media (max-width: 374.98px) {
    .otp-input-container {
        gap: 4px;
        margin: 10px 0;
    }

    .otp-input {
        width: 32px;
        height: 42px;
        font-size: 16px;
        border-radius: 4px;
    }
}

/* High DPI / Retina Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .otp-input {
        border-width: 1.5px;
    }

    .otp-input:focus {
        border-width: 2px;
    }
}

/* Force Light Mode for OTP Inputs - Override any dark mode styles */
.otp-input {
    background-color: #fff !important;
    color: #495057 !important;
    border-color: #e1e5e9 !important;
}

.otp-input:focus {
    background-color: #fff !important;
    border-color: #007bff !important;
    color: #495057 !important;
}

.otp-input.success {
    background-color: #f8fff9 !important;
    color: #28a745 !important;
    border-color: #28a745 !important;
}

.otp-input.error {
    background-color: #fff5f5 !important;
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Dark Mode Support (disabled for OTP inputs) */
@media (prefers-color-scheme: dark) {
    .otp-input {
        background-color: #fff !important;
        border-color: #e1e5e9 !important;
        color: #495057 !important;
    }

    .otp-input:focus {
        border-color: #007bff !important;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
        background-color: #fff !important;
        color: #495057 !important;
    }

    .otp-input.error {
        background-color: #fff5f5 !important;
        border-color: #dc3545 !important;
        color: #dc3545 !important;
    }

    .otp-input.success {
        background-color: #1e4a1e;
        border-color: #38a169;
        color: #9ae6b4;
    }
}

/* Loading State for OTP Verification */
.otp-loading {
    position: relative;
    pointer-events: none;
}

.otp-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Accessibility Improvements */
.otp-input:focus {
    /* Enhanced focus for screen readers */
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .otp-input {
        border-width: 3px;
        border-color: #000;
    }

    .otp-input:focus {
        border-color: #0066cc;
        box-shadow: 0 0 0 3px #0066cc;
    }

    .otp-input.error {
        border-color: #cc0000;
    }

    .otp-input.success {
        border-color: #006600;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .otp-input {
        transition: none;
    }

    .otp-input:focus {
        transform: none;
    }

    .otp-input.error {
        animation: none;
    }

    .otp-input.success {
        animation: none;
    }

    .otp-countdown.danger {
        animation: none;
    }
}
