/* TagadaPay Native Gateway — Checkout Styles v1.5.3 */

/* ============================================================================
   Header icons in the payment method list row (like Stripe plugin)
   ============================================================================ */
.tgdgw-header-icons {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    vertical-align: middle;
    margin-left: 6px;
}

.tgdgw-header-card-icon {
    height: 24px;
    width: auto;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
    background: #fff;
    display: block;
}

/* ============================================================================
   Test mode banner
   ============================================================================ */
.tgdgw-test-banner {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 0.85em;
    color: #856404;
}

/* ============================================================================
   Configuration error
   ============================================================================ */
.tgdgw-config-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px 14px;
    color: #721c24;
    font-size: 0.85em;
}

/* ============================================================================
   Description
   ============================================================================ */
.tgdgw-description {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #555;
}

/* ============================================================================
   Form container — no outer border (like the Stripe screenshot)
   ============================================================================ */
#tgdgw-card-form {
    margin-top: 10px;
}

/* ============================================================================
   Field groups
   ============================================================================ */
.tgdgw-field-group {
    margin-bottom: 10px;
}

.tgdgw-field-group label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #32325d;
    margin-bottom: 5px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tgdgw-field-row {
    display: flex;
    gap: 10px;
}

.tgdgw-half {
    flex: 1;
    margin-bottom: 0;
}

/* ============================================================================
   Input box — individual white card per field (matches Stripe screenshot)
   ============================================================================ */
.tgdgw-input-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tgdgw-input-box:focus-within {
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* ============================================================================
   Inputs (inside the box)
   ============================================================================ */
.tgdgw-input {
    flex: 1;
    padding: 10px 12px;
    border: none !important;
    border-radius: 0;
    font-size: 15px;
    color: #495057;
    background: transparent;
    box-sizing: border-box;
    box-shadow: none !important;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
    min-width: 0;
}

.tgdgw-input::placeholder {
    color: #adb5bd;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tgdgw-input.tgdgw-input-error {
    color: #dc3545;
}

/* ============================================================================
   Card brand icons inside the card number field
   ============================================================================ */
.tgdgw-brand-icons {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-right: 10px;
    flex-shrink: 0;
}

/* Icons are HIDDEN until a brand is detected */
.tgdgw-brand-icon {
    height: 24px;
    width: 0;
    max-width: 38px;
    border-radius: 3px;
    display: block;
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.2s ease;
    background: #fff;
    border: none;
}

/* Only the active (detected) brand icon is visible */
.tgdgw-brand-icon.active {
    opacity: 1;
    width: 38px;
    border: 1px solid #e2e8f0;
}

/* ============================================================================
   CVC icon — inline SVG rendered directly in the PHP template
   ============================================================================ */
.tgdgw-cvc-icon {
    display: block;
    flex-shrink: 0;
    width: 38px;
    height: 26px;
    margin-right: 10px;
    opacity: 0.65;
}

/* ============================================================================
   Visual feedback when cart totals update (order bump / coupon)
   ============================================================================ */
@keyframes tgdgw-pulse {
    0% {
        opacity: 1;
    }

    30% {
        opacity: 0.35;
        background-color: #f0f4ff;
    }

    60% {
        opacity: 0.35;
        background-color: #f0f4ff;
    }

    100% {
        opacity: 1;
    }
}

#tgdgw-card-form.tgdgw-refreshing {
    animation: tgdgw-pulse 0.5s ease-in-out;
}

/* ============================================================================
   Error message
   ============================================================================ */
.tgdgw-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    padding: 9px 12px;
    color: #991b1b;
    font-size: 0.88em;
    margin-top: 8px;
}

/* ============================================================================
   3DS status / loading
   ============================================================================ */
.tgdgw-threeds-status {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    padding: 9px 12px;
    color: #1e40af;
    font-size: 0.88em;
    margin-top: 8px;
    text-align: center;
}

/* ============================================================================
   Loading state on Place Order button
   ============================================================================ */
#place_order.tgdgw-loading {
    opacity: 0.7;
    cursor: wait;
}

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 480px) {
    .tgdgw-field-row {
        flex-direction: column;
        gap: 10px;
    }
}