/**
 * One Marketplace Checkout Styles
 * Styles for the checkout page invite code validation - ONLY for the invite code field
 */

/* Target ONLY the invite code field, not other checkout fields */
input[name="guest_checkout_billing_invite_code"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-image 0.2s ease;
    position: relative;
}

/* Invite code field validation states - matching signup form styling */
input[name="guest_checkout_billing_invite_code"].woocommerce-validated {
    border-color: #28a745 !important;
    /* background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.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.1z'/%3e%3c/svg%3e") !important; */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.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.1z'/%3e%3c/svg%3e");

    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 18px !important;
    padding-right: 45px !important;
    box-shadow: 0 0 0 1px rgba(40, 167, 69, 0.2) !important;
}

input[name="guest_checkout_billing_invite_code"].woocommerce-invalid {
    border-color: #dc3545 !important;
    /* background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath d='M2 2L14 14M14 2L2 14' stroke='%23dc3545' stroke-width='2' stroke-linecap='round'/%3e%3c/svg%3e") !important; */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23dc3545' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E");
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 18px !important;
    padding-right: 45px !important;
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.2) !important;
}

/* Invite code validation messages - styled like signup form feedback */
.invite-code-validation-message {
    margin: 5px 0 0 0;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.875em;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease-in;
    display: block;
    text-align: left;
}

.invite-code-validation-message.woocommerce-message {
    color: #28a745;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.invite-code-validation-message.woocommerce-error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Remove WooCommerce default error icon for invite code validation messages */
.invite-code-validation-message.woocommerce-error::before {
    content: none !important;
    display: none !important;
}
/* Remove WooCommerce default message icon for invite code validation messages */
.invite-code-validation-message.woocommerce-message::before {
    content: none !important;
    display: none !important;
}
.invite-code-validation-message.woocommerce-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
}

/* Animation for messages */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .invite-code-validation-message {
        font-size: 0.8em;
        padding: 8px 10px;
    }
}

/* Hover effects for better UX */
.invite-code-validation-message:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

/* Ensure validation messages only appear after the invite code field */
input[name="guest_checkout_billing_invite_code"] + .invite-code-validation-message {
    margin-top: 5px;
    margin-bottom: 15px;
}

/* ============================================================================
   EMAIL VALIDATION MESSAGES
   ============================================================================ */

/* Email validation messages - styled similar to invite code messages */
.email-validation-message {
    margin: 5px 0 0 0;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.875em;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease-in;
    display: block;
    text-align: left;
}

.email-validation-message.woocommerce-message {
    color: #28a745;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.email-validation-message.woocommerce-error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.email-validation-message.woocommerce-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
}

/* Email typo warning - yellow/orange styling to distinguish from errors */
.email-validation-message.email-typo-warning {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
}

/* Remove WooCommerce default icons for email validation messages */
.email-validation-message.woocommerce-error::before,
.email-validation-message.woocommerce-message::before,
.email-validation-message.woocommerce-info::before {
    content: none !important;
    display: none !important;
}

/* Style the typo fix link */
.email-typo-fix {
    color: #856404;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    margin-left: 5px;
}

.email-typo-fix:hover {
    color: #6c5500;
    text-decoration: none;
}

/* Ensure validation messages only appear after the email field */
#billing_email + .email-validation-message {
    margin-top: 5px;
    margin-bottom: 15px;
}

/* Responsive adjustments for email messages */
@media (max-width: 768px) {
    .email-validation-message {
        font-size: 0.8em;
        padding: 8px 10px;
    }
}
