/**
 * USMS-GH OTP Verification Styles
 */

/* OTP Modal */
.usmsgh-otp-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.usmsgh-otp-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.usmsgh-otp-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.usmsgh-otp-close:hover,
.usmsgh-otp-close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.usmsgh-otp-modal h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.4em;
}

.usmsgh-otp-modal p {
    margin-bottom: 20px;
    color: #666;
}

/* OTP Input Groups */
.usmsgh-otp-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.usmsgh-otp-input-group input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.usmsgh-otp-input-group .button {
    padding: 12px 20px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.usmsgh-otp-input-group .button:hover {
    background-color: #005a87;
}

.usmsgh-otp-input-group .button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.usmsgh-otp-verify-section {
    display: none;
}

.usmsgh-otp-verify-section.active {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* OTP Status Messages */
.usmsgh-otp-status {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    min-height: 20px;
}

.usmsgh-otp-status.success {
    color: #28a745;
}

.usmsgh-otp-status.error {
    color: #dc3545;
}

.usmsgh-otp-status.info {
    color: #007cba;
}

.usmsgh-otp-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.usmsgh-otp-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.usmsgh-otp-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.usmsgh-otp-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Login Page OTP Styles */
.usmsgh-otp-verify-field {
    margin-top: 15px;
}

.usmsgh-otp-verify-field input {
    width: 150px;
    display: inline-block;
    margin-right: 10px;
}

.usmsgh-otp-verify-field .button {
    margin-right: 10px;
    margin-top: 5px;
}

#usmsgh_send_otp_btn,
#usmsgh_verify_otp_btn,
#usmsgh_resend_otp_btn {
    padding: 10px 20px;
    font-size: 14px;
}

#usmsgh_resend_otp_btn:disabled {
    background-color: #ccc;
}

/* Checkout OTP Section */
.usmsgh-checkout-otp-section {
    background: #f8f8f8;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.usmsgh-checkout-otp-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.usmsgh-otp-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.usmsgh-otp-form {
    margin-top: 20px;
}

.usmsgh-otp-form .form-row {
    margin-bottom: 15px;
}

.usmsgh-otp-form input[type="tel"],
.usmsgh-otp-form input[type="text"] {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.usmsgh-otp-form .button {
    padding: 12px 25px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
}

.usmsgh-otp-form .button:hover {
    background-color: #005a87;
}

.usmsgh-otp-form .button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.usmsgh-otp-form .button#usmsgh_checkout_resend_otp {
    background-color: #6c757d;
}

.usmsgh-otp-form .button#usmsgh_checkout_resend_otp:hover:not(:disabled) {
    background-color: #5a6268;
}

.usmsgh-otp-verify-row {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* Loading Spinner */
.usmsgh-otp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: usmsgh-spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .usmsgh-otp-modal-content {
        margin: 20% auto;
        padding: 20px;
        width: 95%;
    }

    .usmsgh-otp-input-group {
        flex-direction: column;
    }

    .usmsgh-otp-input-group .button {
        width: 100%;
        margin-top: 10px;
    }

    .usmsgh-otp-verify-section.active {
        flex-direction: column;
    }

    .usmsgh-otp-form .button {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }

    .usmsgh-otp-form input[type="tel"],
    .usmsgh-otp-form input[type="text"] {
        width: 100%;
    }
}

/* Verified State */
.usmsgh-otp-verified {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.usmsgh-otp-verified::before {
    content: "✓ ";
    font-weight: bold;
}

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

.usmsgh-otp-error-shake {
    animation: usmsgh-shake 0.5s;
}
