/* =============================================================================
   WooCommerce Clover Elements Payment Gateway Styling
   ============================================================================= */

.clover-payment-fields {
    max-width: 100%;
    margin: 15px 0;
    padding: 20px;
    border-radius: 12px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.clover-form-row {
    margin-bottom: 20px;
    position: relative;
}

.clover-form-row:last-child {
    margin-bottom: 0;
}

.clover-form-row.clover-half-row {
    display: inline-block;
    width: 48%;
    box-sizing: border-box;
}

.clover-form-row.clover-half-row-left {
    margin-right: 4%;
}

.clover-form-row.clover-third-row {
    display: inline-block;
    width: 30.6%;
    margin-right: 4%;
    box-sizing: border-box;
}

.clover-form-row.clover-third-row-last {
    margin-right: 0;
}

.clover-payment-fields label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.clover-input-container {
    padding: 0 12px;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    height: 46px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}

/* Active focus states */
.clover-input-container.focus {
    border-color: #6366f1;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Invalid states */
.clover-input-container.invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Loading container overlay styles */
.clover-payment-fields-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.clover-payment-fields-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    margin-left: -12px;
    border: 2px solid #6366f1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: clover-spinner 0.6s linear infinite;
}

@keyframes clover-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Field inside the Clover Elements SDK containers */
#card-number, #card-date, #card-cvv, #card-postal-code {
    width: 100%;
    height: 100%;
}

/* Secure Card Brand Badge Container */
.clover-card-brand-indicator {
    position: absolute;
    right: 12px;
    top: 36px;
    height: 24px;
    width: 36px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

/* Help text styling */
.clover-help-text {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.4;
}

/* Responsive adjustment for mobiles */
@media (max-width: 480px) {
    .clover-form-row.clover-half-row,
    .clover-form-row.clover-third-row {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }
    .clover-form-row.clover-half-row:last-child,
    .clover-form-row.clover-third-row-last {
        margin-bottom: 0;
    }
}
