/**
 * OVIX Email OTP Verification Styles
 * 
 * Styles for the OTP verification section on checkout page
 */

#ovix-otp-verification-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
}

#ovix-otp-verification-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

#ovix-otp-verification-section p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

#ovix-otp-verification-section .form-row {
    margin-bottom: 15px;
}

#ovix-otp-verification-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

#ovix-otp-verification-section label .required {
    color: #e2401c;
}

#ovix-otp-verification-section input[type="email"],
#ovix-otp-verification-section input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#ovix-otp-verification-section input[type="email"]:focus,
#ovix-otp-verification-section input[type="text"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

#ovix-otp-verification-section input[type="text"]#ovix_otp_code {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
    max-width: 200px;
}

#ovix-otp-verification-section button {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-right: 10px;
}

#ovix-otp-verification-section button:hover {
    background: #005a87;
}

#ovix-otp-verification-section button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#ovix_otp_status {
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;
    font-weight: 500;
}

#ovix_otp_status.success {
    color: #28a745;
}

#ovix_otp_status.error {
    color: #dc3545;
}

#ovix_otp_input_section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

/* Email verified state */
#ovix-otp-verification-section.email-verified {
    background: #d4edda;
    border-color: #c3e6cb;
}

#ovix-otp-verification-section.email-verified h3 {
    color: #155724;
}

#ovix-otp-verification-section.email-verified p {
    color: #155724;
}

/* Loading state */
#ovix-otp-verification-section.loading button {
    position: relative;
    color: transparent;
}

#ovix-otp-verification-section.loading button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
    #ovix-otp-verification-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    #ovix-otp-verification-section h3 {
        font-size: 16px;
    }
    
    #ovix-otp-verification-section input[type="email"],
    #ovix-otp-verification-section input[type="text"] {
        padding: 10px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    #ovix-otp-verification-section button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    #ovix_otp_status {
        display: block;
        margin-left: 0;
        margin-top: 10px;
    }
}

/* WooCommerce compatibility */
.woocommerce-checkout #ovix-otp-verification-section {
    margin: 20px 0;
}

.woocommerce-checkout #ovix-otp-verification-section .form-row {
    margin-bottom: 15px;
}

.woocommerce-checkout #ovix-otp-verification-section input[type="email"],
.woocommerce-checkout #ovix-otp-verification-section input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}

/* Accessibility improvements */
#ovix-otp-verification-section input[type="email"]:focus,
#ovix-otp-verification-section input[type="text"]:focus,
#ovix-otp-verification-section button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #ovix-otp-verification-section {
        border-width: 2px;
    }
    
    #ovix-otp-verification-section input[type="email"],
    #ovix-otp-verification-section input[type="text"] {
        border-width: 2px;
    }
    
    #ovix-otp-verification-section button {
        border: 2px solid #007cba;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #ovix-otp-verification-section button::after {
        animation: none;
    }
    
    #ovix-otp-verification-section input[type="email"],
    #ovix-otp-verification-section input[type="text"],
    #ovix-otp-verification-section button {
        transition: none;
    }
} 

/* custom css */
#additional-information > div,
#order .wc-block-components-address-form__ovix-email-verify-otp{
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    background: #f9f9f9;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid #f2f2f2;
    
}

#additional-information > div button,
#order .wc-block-components-address-form__ovix-email-verify-otp button{
    margin-bottom: 40px;
    padding: 10px 25px;
    border-radius: 10px;
    background: #167fca;
    border: 4px solid #81beff;
    color: #fff;
    font-weight: 600;
}

#additional-information > div label,
#order .wc-block-components-address-form__ovix-email-verify-otp label{
    transform: translatey(252px);
    margin-left: 20px;

}

#additional-information .is-active label{
    transform: translatey(220px)
}

#order .wc-block-components-address-form__ovix-email-verify-otp.is-active label{
    transform: translatey(235px)
}

#additional-information input,
#order .wc-block-components-address-form__ovix-email-verify-otp input{
    padding-top: 10px;
}
#order .ovix-otp-message-box{
    white-space: pre-wrap;
    background: #fff !important;
}

#order .ovix-otp-status{
    /* order: -1; */
}

#order .wc-block-components-address-form__ovix-email-verify-otp.has-error label{
    transform: translatey(275px)
}

#order .wc-block-components-address-form__ovix-email-verify-otp.has-error.is-active label{
    transform: translatey(260px)
}

#order .ovix-verify-otp-btn{
    background: rgb(107,192,129) !important;
    border-color: rgb(162,224,163) !important;
}