:root {
    --wctpg-accent: #4f46e5;
    --wctpg-accent-hover: #4338ca;
    --wctpg-bg-overlay: rgba(15, 23, 42, 0.65);
    --wctpg-modal-bg: #ffffff;
    --wctpg-text-main: #0f172a;
    --wctpg-text-muted: #64748b;
    --wctpg-border: #e2e8f0;
    --wctpg-radius: 16px;
    --wctpg-danger: #ef4444;
    --wctpg-danger-bg: #fef2f2;
}

.wctpg-checkout-inline-info {
    margin-top: 10px;
}

.wctpg-test-badge {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #15803d;
}

.wctpg-test-badge strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.wctpg-test-badge p {
    margin: 0 0 10px 0;
}

.wctpg-btn-trigger {
    background: #16a34a;
    color: #ffffff !important;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    display: inline-block;
}

.wctpg-btn-trigger:hover {
    background: #15803d;
}

/* Modal Popup Overlay */
.wctpg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--wctpg-bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: wctpgFadeIn 0.25s ease-out;
}

@keyframes wctpgFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Box */
.wctpg-modal-container {
    background: var(--wctpg-modal-bg);
    width: 100%;
    max-width: 440px;
    border-radius: var(--wctpg-radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 32px;
    position: relative;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--wctpg-text-main);
    animation: wctpgSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wctpgSlideUp {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.wctpg-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wctpg-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.wctpg-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--wctpg-border);
}

.wctpg-modal-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wctpg-modal-logo h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--wctpg-text-main);
}

.wctpg-brand-icons {
    display: flex;
    gap: 6px;
}

.wctpg-brand {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

.wctpg-brand.visa { color: #1d4ed8; }
.wctpg-brand.mastercard { color: #b91c1c; }

/* Form Layout */
.wctpg-form-group {
    margin-bottom: 18px;
}

.wctpg-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #334155;
}

.wctpg-input-wrapper {
    position: relative;
}

.wctpg-input-wrapper input {
    padding-right: 40px !important;
}

.wctpg-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    pointer-events: none;
}

.wctpg-form-group input[type="text"] {
    width: 100% !important;
    padding: 12px 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    background: #f8fafc !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
    outline: none !important;
}

.wctpg-form-group input[type="text"]:focus {
    border-color: var(--wctpg-accent) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15) !important;
}

.wctpg-form-row {
    display: flex;
    gap: 14px;
}

.wctpg-col-half {
    flex: 1;
}

/* Button */
.wctpg-btn-pay {
    width: 100%;
    padding: 14px;
    background: var(--wctpg-accent);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wctpg-btn-pay:hover {
    background: var(--wctpg-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.wctpg-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: wctpgSpin 0.8s infinite linear;
}

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

.wctpg-modal-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--wctpg-text-muted);
}

/* Error Banner inside Modal */
.wctpg-error-banner {
    background: var(--wctpg-danger-bg);
    border: 1px solid #fca5a5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: wctpgShake 0.4s ease;
}

@keyframes wctpgShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.wctpg-error-icon {
    font-size: 20px;
}

.wctpg-error-content {
    font-size: 13px;
    color: #991b1b;
    line-height: 1.4;
}

.wctpg-error-content strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.wctpg-error-content p {
    margin: 4px 0;
}

.wctpg-error-advice {
    font-weight: 600;
    color: #7f1d1d;
    margin-top: 8px !important;
    padding-top: 8px;
    border-top: 1px dashed #f87171;
}
