.iti {
    position: relative !important;
    display: block !important;
}

.form-control.iti__tel-input {
    height: 3.5rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.iti--inline-dropdown .iti__dropdown-content {
    z-index: 5 !important;
}

.otp-btn {
    position: absolute;
    right: 8px;
    top: 30px;
    transform: translateY(-50%);
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
    min-width: 70px;
    text-align: center;
}

.otp-btn.send {
    background: #3b82f6;
    color: white;
}

.otp-btn.send:hover:not(:disabled) {
    background: #2563eb;
}

.otp-btn.resend {
    background: #10b981;
    color: white;
}

.otp-btn.resend:hover:not(:disabled) {
    background: #059669;
}

.otp-btn.countdown {
    background: #6b7280;
    color: white;
    cursor: not-allowed;
}

.otp-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.otp-container {
    margin-top: 15px;
    display: none;
}

.otp-container.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.otp-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
}

.otp-digit {
    width: 40px;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.otp-digit:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.otp-digit.filled {
    border-color: #10b981;
}
.otp-verified {
    border-color: #10b981 !important;
    background: #f0fdf4 !important;
    color: #059669 !important;
    border-color: var(--bs-form-valid-border-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1'/%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;
}
@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}
/* Thêm vào CSS hiện tại của bạn */

.otp-btn.sending {
    background: #f59e0b;
    color: white;
    cursor: not-allowed;
}

.otp-btn.sending:hover {
    background: #f59e0b;
}

/* Spinner animation */
.otp-btn .fa-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Slide down animation - sửa lại */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

/* Success message styles */
.success-message {
    display: none;
    text-align: center;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.success-message.show {
    display: block;
}

/* OTP container improvements */
.otp-container {
    margin-top: 15px;
    padding: 15px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.otp-container.show {
    display: block;
    opacity: 1;
    animation: slideDown 0.3s ease-out;
}

/* Error state for OTP digits */
.otp-digit.error {
    border-color: #ef4444;
    background-color: #fef2f2;
    animation: shake 0.5s ease-in-out;
}

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

/* Success state for OTP digits */
.otp-digit.success {
    border-color: #10b981;
    background-color: #f0fdf4;
    color: #059669;
}

/* Locked input state */
.form-control.otp-locked {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* Message color variants */
.success-message.success {
    color: #059669;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.success-message.error {
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
}

/* Mobile responsive improvements */
@media (max-width: 576px) {
    .otp-btn {
        right: 6px;
        top: 28px;
        padding: 6px 10px;
        font-size: 11px;
        min-width: 55px;
    }

    .otp-digit {
        width: 30px;
        height: 38px;
        font-size: 14px;
        border-radius: 4px;
        border-width: 1.5px;
    }

    .otp-inputs {
        gap: 5px;
        padding: 0 2px;
    }

    .otp-container {
        padding: 10px;
        margin-top: 10px;
    }

    .otp-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
}

/* Extra small devices (phones in portrait, less than 375px) */
@media (max-width: 374px) {
    .otp-inputs {
        gap: 3px;
        padding: 0 1px;
    }

    .otp-btn {
        padding: 5px 8px;
        font-size: 10px;
        min-width: 50px;
    }

    .otp-container {
        padding: 8px;
        margin-top: 8px;
    }

    .otp-label {
        font-size: 12px;
    }
}

/* Very small screens (iPhone SE, etc) */
@media (max-width: 360px) {
    .otp-inputs {
        gap: 2px;
        padding: 0;
    }

    .otp-btn {
        padding: 4px 6px;
        font-size: 9px;
        min-width: 45px;
    }
}

/* Accessibility improvements */
.otp-digit:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .otp-btn,
    .otp-digit,
    .otp-container,
    .success-message {
        transition: none;
    }

    .otp-container.show {
        animation: none;
    }

    .otp-btn .fa-spin {
        animation: none;
    }

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