/* Główny kontener formularza */
.invoice-form-container {
    font-family: Arial, sans-serif;
    max-width: 700px;
    margin: 20px auto;
    padding: 30px;
    border: 1px solid #000;
    background-color: #fff;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.15);
}

/* Nagłówki */
.invoice-form-container h1 {
    color: #000;
    text-align: center;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: bold;
    text-transform: uppercase;
}

.invoice-form-container h3 {
    color: #000;
    font-size: 18px;
    margin-top: 10px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #000;
    font-weight: bold;
}

/* Opis */
.invoice-form-container .description {
    text-align: center;
    font-size: 15px;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
    padding: 0 10px;
}

/* Sekcje formularza */
.form-section {
    background-color: #f9f9f9;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Pola formularza */
.mb-3 {
    margin-bottom: 20px;
}

.invoice-form-container .form-label {
    font-weight: bold;
    margin-bottom: 6px;
    display: block;
    color: #333;
    font-size: 14px;
}

.invoice-form-container .form-control {
    border: 1px solid #666;
    border-radius: 4px;
    font-size: 14px;
    padding: 12px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.invoice-form-container .form-control:focus {
    border-color: #000;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.invoice-form-container .form-control.error {
    border-color: #d32f2f;
    background-color: #ffebee;
}

/* Oznaczenie pól wymaganych */
.required {
    color: #d32f2f;
    font-weight: bold;
}

/* Teksty pomocnicze */
.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Komunikaty błędów */
.error-message {
    display: block;
    color: #d32f2f;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
}

/* Komunikaty ogólne */
.invoice-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.invoice-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.invoice-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.invoice-message.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Grupa przycisków */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.button-group button {
    flex: 1;
}

/* Przyciski */
.invoice-form-container .btn {
    border-radius: 4px;
    padding: 15px 20px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.invoice-form-container .btn-primary {
    background-color: #000;
    color: #fff;
}

.invoice-form-container .btn-primary:hover:not(:disabled) {
    background-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.invoice-form-container .btn-primary:disabled {
    background-color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.invoice-form-container .btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.invoice-form-container .btn-secondary:hover:not(:disabled) {
    background-color: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.invoice-form-container .btn-secondary:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Spinner w przycisku */
.btn-spinner {
    display: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Ekran podziękowania */
.thank-you-screen {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border: 2px solid #28a745;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    animation: fadeIn 0.5s ease-in-out;
}

.thank-you-screen h2 {
    font-size: 28px;
    color: #28a745;
    margin-bottom: 15px;
    font-weight: bold;
}

.thank-you-screen p {
    font-size: 16px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 15px;
}

.thank-you-screen strong {
    color: #000;
}

.thank-you-screen .btn {
    margin-top: 20px;
    display: inline-block;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translateY(-10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsywność */
@media (max-width: 768px) {
    .invoice-form-container {
        padding: 20px;
        margin: 10px;
    }

    .invoice-form-container h1 {
        font-size: 20px;
    }

    .invoice-form-container h3 {
        font-size: 16px;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group button {
        width: 100%;
    }

    .form-section {
        padding: 15px;
    }
}

/* Styl dla pól ukrytych */
[style*="display: none"] {
    display: none !important;
}

/* Styl dla select */
.invoice-form-container select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

/* Animacja dla komunikatów */
.invoice-message {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

button, input, select, textarea {
    touch-action: manipulation;
}
