/**
 * Tengo Fundraising - Frontend Styles
 * Wersja: Basic
 */

/* Kontener formularza */
.tf-donation-form {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Sekcje formularza */
.tf-form-section {
    background: #f9fafb;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.tf-form-section h3 {
    margin: 0 0 15px 0;
    color: #111827;
    font-size: 18px;
    font-weight: 600;
}

/* Przyciski kwot */
.tf-preset-amounts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.tf-amount-btn {
    background: #fff;
    border: 2px solid #d1d5db;
    color: #374151;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.tf-amount-btn:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.tf-amount-btn.selected {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Wlasna kwota */
.tf-custom-amount {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.tf-custom-amount label {
    font-weight: 500;
    color: #374151;
}

.tf-custom-amount input {
    flex: 1;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
}

.tf-currency {
    font-weight: 500;
    color: #6b7280;
}

/* Pola formularza */
.tf-form-group {
    margin-bottom: 15px;
}

.tf-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.tf-form-group input[type="text"],
.tf-form-group input[type="email"],
.tf-form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.tf-form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Checkboxy zgod */
.tf-consent-item {
    margin-bottom: 16px;
}

.tf-consent-item:last-child {
    margin-bottom: 0;
}

.tf-consent-item label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.tf-consent-item input[type="checkbox"] {
    margin-top: 3px;
    margin-right: 8px;
    min-width: 18px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.tf-consent-text {
    flex: 1;
}

/* Blad walidacji pod checkboxem */
.tf-consent-item .tf-field-error {
    display: block;
    margin-top: 4px;
    margin-left: 26px;
    font-size: 12px;
    color: #dc2626;
}

.tf-required {
    color: #ef4444;
    font-weight: normal;
}

/* Przycisk submit */
.tf-submit-section {
    text-align: center;
}

.tf-submit-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.tf-submit-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tf-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Informacja o bezpieczenstwie */
.tf-secure-info {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
}

.tf-lock-icon {
    font-size: 16px;
}

/* Komunikaty */
.tf-messages {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.tf-messages.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tf-messages.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Loader */
.tf-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f4f6;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: tf-spin 1s linear infinite;
}

@keyframes tf-spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   RESPONSYWNOSC - MOBILE FIRST
   ===================================================== */

/* TABLET (640px - 1024px) */
@media (max-width: 1024px) and (min-width: 641px) {
    .tf-donation-form {
        max-width: 100% !important;
        padding: 0 20px !important;
        box-sizing: border-box !important;
    }
}

/* MOBILE (< 640px) */
@media (max-width: 640px) {
    /* Formularz - pelna szerokosc bez marginesow */
    .tf-donation-form {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    
    /* Sekcje - zmniejszone zaokraglenia i padding */
    .tf-form-section {
        border-radius: 0 !important;
        padding: 16px !important;
        margin-bottom: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
    
    /* Tytuly sekcji */
    .tf-form-section h3,
    .tf-section-title {
        font-size: 16px !important;
        margin-bottom: 16px !important;
    }
    
    /* Przyciski kwot - 2 kolumny */
    .tf-preset-amounts {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    /* Przyciski kwot */
    .tf-amount-btn {
        height: 44px !important;
        font-size: 15px !important;
        padding: 10px 8px !important;
    }
    
    /* Wlasna kwota */
    .tf-custom-amount {
        flex-direction: column !important;
        align-items: stretch !important;
        margin-top: 12px !important;
    }
    
    .tf-custom-amount input {
        width: 100% !important;
        font-size: 16px !important;
        height: 44px !important;
    }
    
    /* Layout pol */
    .tf-form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    /* Pola formularza */
    .tf-form-group {
        width: 100% !important;
        margin-bottom: 12px !important;
    }
    
    .tf-form-group.tf-half {
        flex: none !important;
        width: 100% !important;
    }
    
    /* Inputy - 16px zapobiega zoom na iOS */
    .tf-form-group input[type="text"],
    .tf-form-group input[type="email"],
    .tf-form-group input[type="number"],
    .tf-form-group input[type="tel"],
    .tf-input,
    #tf-custom-amount-input {
        font-size: 16px !important;
        height: 44px !important;
        padding: 10px 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Etykiety */
    .tf-form-group label {
        font-size: 14px !important;
        margin-bottom: 6px !important;
    }
    
    /* Zgody - checkbox i tekst */
    .tf-consent-item {
        margin-bottom: 14px !important;
    }
    
    .tf-consent-item label {
        display: flex !important;
        align-items: flex-start !important;
    }
    
    .tf-consent-item input[type="checkbox"] {
        margin-top: 3px !important;
        margin-right: 10px !important;
        min-width: 20px !important;
        width: 20px !important;
        height: 20px !important;
        flex-shrink: 0 !important;
    }
    
    .tf-consent-text {
        font-size: 13px !important;
        line-height: 1.5 !important;
        flex: 1 !important;
    }
    
    /* Blad pod checkboxem */
    .tf-consent-item .tf-field-error {
        margin-left: 30px !important;
        font-size: 12px !important;
    }
    
    /* Przycisk submit */
    .tf-submit-btn {
        width: 100% !important;
        height: 50px !important;
        font-size: 16px !important;
        min-width: auto !important;
        border-radius: 8px !important;
    }
    
    /* Sekcja submit */
    .tf-submit-section {
        padding: 16px !important;
    }
    
    /* Informacja o bezpieczenstwie */
    .tf-secure-info {
        font-size: 12px !important;
        margin-top: 12px !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    
    /* Komunikaty */
    .tf-messages {
        margin: 12px !important;
        padding: 12px !important;
        font-size: 14px !important;
    }
    
    /* Bledy walidacji */
    .tf-field-error {
        font-size: 12px !important;
    }
}

/* MALE TELEFONY (< 375px) - np. iPhone SE */
@media (max-width: 375px) {
    .tf-form-section {
        padding: 14px 12px !important;
    }
    
    .tf-preset-amounts {
        gap: 6px !important;
    }
    
    .tf-amount-btn {
        font-size: 14px !important;
        padding: 8px 6px !important;
    }
    
    .tf-form-section h3,
    .tf-section-title {
        font-size: 15px !important;
    }
    
    .tf-consent-text {
        font-size: 12px !important;
    }
    
    .tf-submit-btn {
        font-size: 15px !important;
    }
}

/* Style dla trybu ciemnego (opcjonalne) */
@media (prefers-color-scheme: dark) {
    .tf-form-section {
        background: #1f2937;
        border-color: #374151;
    }
    
    .tf-form-section h3 {
        color: #f9fafb;
    }
    
    .tf-amount-btn {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }
    
    .tf-amount-btn:hover {
        background: #4b5563;
        border-color: #60a5fa;
    }
    
    .tf-form-group label {
        color: #e5e7eb;
    }
    
    .tf-form-group input {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }
}