/* Wrapper główny */
.tpay-modern-box-wrapper {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    max-width: 500px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

/* Nagłówek */
.tpay-modern-header {
    text-align: center;
    margin-bottom: 25px;
}

.tpay-modern-header h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.5rem;
    color: #333;
    line-height: 1.3;
}

.tpay-target-highlight {
    color: #7c3aed;
    font-weight: 700;
}

.tpay-gratitude-accent {
    font-size: 0.95rem;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 5px;
}

.tpay-heart-icon {
    display: inline-block;
    color: #ef4444;
    font-size: 1.2rem;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

/* Siatka kwot */
.tpay-amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.tpay-amount-option {
    position: relative;
    cursor: pointer;
}

.tpay-amount-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tpay-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    color: #555;
    transition: all 0.2s ease;
    background: #fafafa;
    box-sizing: border-box;
}

.tpay-amount-option input[type="radio"]:checked + .tpay-box {
    border-color: #7c3aed;
    background: #f5f0ff;
    color: #7c3aed;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

/* Pole "Inna kwota" */
.tpay-amount-custom {
    grid-column: span 3;
}

.tpay-box-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    background: #fff;
    cursor: text;
}

.tpay-box-input input {
    border: none !important;
    background: transparent !important;
    width: 100%;
    height: 100%;
    font-size: 16px;
    font-weight: 500;
    outline: none !important;
    color: #333;
    padding: 0;
    margin: 0;
    box-shadow: none !important;
    font-family: inherit;
}

.tpay-box-input input:focus {
    box-shadow: none;
    border: none;
    outline: none;
}

/* --- ANIMACJA BŁĘDU (SHAKE) --- */
.tpay-input-error {
    border-color: #ef4444 !important; /* Czerwona ramka */
    background-color: #fef2f2 !important; /* Lekko czerwone tło */
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.currency-label {
    color: #999;
    font-weight: 400;
    margin-left: 5px;
    pointer-events: none;
}

/* Dane darczyńcy */
.tpay-donor-details {
    margin-bottom: 20px;
}

.tpay-input-group {
    margin-bottom: 12px;
}

.tpay-input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    background: #fff;
    outline: none;
}

.tpay-input-group input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* --- NOWOCZESNY PRZYCISK (SHIMMER) --- */
.tpay-btn-pay {
    width: 100%;
    position: relative;
    overflow: hidden; /* Ważne dla efektu shimmer */
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    border: none;
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
    z-index: 1;
}

/* Efekt "Błysku" (Shimmer) */
.tpay-btn-pay::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
    z-index: 2;
}

/* Animacja błysku co kilka sekund (opcjonalne, fajne) */
.tpay-btn-pay {
    animation: pulse-shadow 3s infinite;
}

.tpay-btn-pay:hover::after {
    left: 100%; /* Przesuń błysk */
    transition: 0.7s ease-in-out;
}

.tpay-btn-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.tpay-btn-pay:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.tpay-btn-pay:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    animation: none;
}

@keyframes pulse-shadow {
    0% { box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5); }
    100% { box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3); }
}

.tpay-secure-info {
    text-align: center;
    margin-top: 12px;
    color: #888;
    font-size: 0.85em;
}

/* Komunikaty błędów */
.tpay-error-msg {
    color: #b91c1c;
    background: #fef2f2;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.95em;
    text-align: center;
    border: 1px solid #fecaca;
}

.tpay-spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 3px solid #fff;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .tpay-amount-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .tpay-modern-box-wrapper {
        padding: 20px;
    }
    .tpay-box {
        height: 45px;
        font-size: 0.9rem;
    }
}