/**
 * AutoQM Phone Verification Styles
 */

/* Phone input wrapper */
.autoqm-phone-input-wrapper,
.autoqm-code-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.autoqm-phone-input-wrapper input,
.autoqm-code-input-wrapper input {
    flex: 1;
    min-width: 0;
}

/* Verify button */
.autoqm-verify-btn {
    padding: 10px 16px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    min-width: 100px;
    text-align: center;
}

.autoqm-verify-btn:hover {
    background: #2563eb;
}

.autoqm-verify-btn:active {
    transform: scale(0.98);
}

.autoqm-verify-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.autoqm-verify-btn.success {
    background: #22c55e;
}

.autoqm-verify-btn.success:hover {
    background: #16a34a;
}

/* Status messages */
.autoqm-status-message {
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}

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

.autoqm-status-message.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.autoqm-status-message.info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Timer */
.autoqm-timer {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.autoqm-timer.warning {
    color: #dc2626;
    font-weight: 500;
}

/* Verification code wrapper */
#autoqm-verification-code-wrapper {
    margin-top: 12px;
}

/* Verified state */
.autoqm-phone-verified .autoqm-phone-input-wrapper input,
.autoqm-phone-verified .autoqm-code-input-wrapper input {
    background: #f0fdf4 !important;
    border-color: #22c55e !important;
}

.autoqm-phone-verified #phone_number {
    color: #16a34a;
}

/* Ultimate Member form adjustments */
.um-form .um-field-phone_verification {
    margin-bottom: 20px;
}

.um-form .um-field-phone_verification .um-field-label {
    margin-bottom: 8px;
}

.um-form .um-field-phone_verification .um-field-area {
    position: relative;
}

/* WooCommerce form adjustments */
.woocommerce-form .autoqm-phone-input-wrapper,
.woocommerce-form .autoqm-code-input-wrapper {
    margin-bottom: 0;
}

/* WordPress default form adjustments */
.login .autoqm-phone-input-wrapper input,
.login .autoqm-code-input-wrapper input {
    font-size: 14px;
    padding: 8px 12px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .autoqm-phone-input-wrapper,
    .autoqm-code-input-wrapper {
        flex-direction: column;
    }

    .autoqm-verify-btn {
        width: 100%;
        min-width: auto;
        padding: 12px 16px;
    }
}

/* Animation for showing code input */
#autoqm-verification-code-wrapper {
    animation: slideDown 0.2s ease-out;
}

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

/* Loading state */
.autoqm-verify-btn.loading {
    position: relative;
    color: transparent;
}

.autoqm-verify-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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