/* ===== ZMIENNE ===== */
:root {
    --dream-primary: #2563eb;
    --dream-primary-dark: #1d4ed8;
    --dream-success: #10b981;
    --dream-warning: #f59e0b;
    --dream-error: #ef4444;
    --dream-bg: #f8fafc;
    --dream-card-bg: #ffffff;
    --dream-border: #e2e8f0;
    --dream-text: #1e293b;
    --dream-text-muted: #64748b;
    --dream-radius: 12px;
    --dream-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --dream-shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1);
}

/* ===== KONTENER GŁÓWNY ===== */
.dream-calculator {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--dream-text);
}

/* ===== HEADER Z CENĄ ===== */
.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    padding: 24px;
    background: linear-gradient(135deg, var(--dream-primary), var(--dream-primary-dark));
    border-radius: var(--dream-radius);
    color: white;
}

.calculator-header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.price-display {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.price-display .label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.price-display .value {
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.price-display .value.updating {
    transform: scale(0.95);
    opacity: 0.7;
}

.price-display .value.updated {
    transform: scale(1.05);
    color: #fef08a;
}

/* ===== SEKCJE ===== */
.calc-section {
    background: var(--dream-card-bg);
    border-radius: var(--dream-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--dream-shadow);
    border: 1px solid var(--dream-border);
}

.calc-section h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dream-text);
}

.section-icon {
    font-size: 1.5rem;
}

/* ===== GRID OPCJI ===== */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.options-grid.cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* ===== KARTY OPCJI (RADIO) ===== */
.option-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card .option-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: var(--dream-bg);
    border: 2px solid var(--dream-border);
    border-radius: var(--dream-radius);
    transition: all 0.2s ease;
}

.option-card:hover .option-content {
    border-color: var(--dream-primary);
    background: white;
}

.option-card input:checked + .option-content {
    border-color: var(--dream-primary);
    background: linear-gradient(to bottom right, #eff6ff, #dbeafe);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.option-card.just-selected .option-content {
    animation: pulse 0.4s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.option-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--dream-text);
}

.option-meta {
    font-size: 0.85rem;
    color: var(--dream-text-muted);
}

.option-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dream-primary);
    margin-top: 4px;
}

.option-price.included {
    color: var(--dream-success);
}

.option-price.discount {
    color: var(--dream-success);
}

.option-price.discount::before {
    content: "▼";
    font-size: 0.7em;
}

/* ===== LISTA OPCJI (CHECKBOXY) ===== */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.options-list.extras {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--dream-border);
}

.option-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--dream-bg);
    border: 2px solid transparent;
    border-radius: var(--dream-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-checkbox:hover {
    background: white;
    border-color: var(--dream-border);
}

.option-checkbox input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--dream-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.option-checkbox input:checked ~ .option-content {
    color: var(--dream-primary);
}

.option-checkbox .option-content {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}

.option-checkbox .option-title {
    flex: 1;
    min-width: 200px;
}

.option-checkbox .option-meta {
    flex-basis: 100%;
}

.option-checkbox .option-price {
    margin-left: auto;
    margin-top: 0;
}

/* ===== FORMULARZ KONTAKTOWY ===== */
.contact-section {
    background: linear-gradient(to bottom right, #fefce8, #fef9c3);
    border-color: #fde047;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

.form-field label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dream-text);
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"] {
    padding: 12px 16px;
    border: 2px solid var(--dream-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-field input:focus {
    outline: none;
    border-color: var(--dream-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.options-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.options-inline label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

/* ===== PŁATNOŚĆ ===== */
.payment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.option-card.payment.highlight .option-content {
    background: linear-gradient(to bottom right, #ecfdf5, #d1fae5);
    border-color: var(--dream-success);
}

.option-card.payment.highlight input:checked + .option-content {
    background: linear-gradient(to bottom right, #dcfce7, #bbf7d0);
    border-color: var(--dream-success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

/* ===== PODSUMOWANIE STICKY ===== */
.calculator-summary {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid var(--dream-border);
    margin: 0 -20px -20px -20px;
    padding: 20px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.summary-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.summary-prices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-row span:first-child {
    color: var(--dream-text-muted);
    font-size: 0.9rem;
}

.price-row .price {
    font-weight: 700;
    font-size: 1.1rem;
}

.price-row.brutto .price {
    font-size: 1.4rem;
    color: var(--dream-primary);
}

.price-row.discount {
    color: var(--dream-success);
}

.price-row.discount .price {
    color: var(--dream-success);
}

/* ===== PRZYCISK SUBMIT ===== */
.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--dream-primary), var(--dream-primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--dream-shadow);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--dream-shadow-lg);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.submit-btn .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== MODAL ===== */
.dream-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    padding: 40px;
    border-radius: var(--dream-radius);
    text-align: center;
    max-width: 400px;
    animation: slideUp 0.3s ease;
}

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

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.dream-modal.success .modal-icon {
    background: #dcfce7;
    color: var(--dream-success);
}

.dream-modal.error .modal-icon {
    background: #fee2e2;
    color: var(--dream-error);
}

.modal-content h3 {
    margin: 0 0 10px;
    font-size: 1.5rem;
}

.modal-content p {
    margin: 0 0 24px;
    color: var(--dream-text-muted);
}

.modal-content button {
    padding: 12px 32px;
    background: var(--dream-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

/* ===== RESPONSYWNOŚĆ ===== */
@media (max-width: 768px) {
    .calculator-header {
        flex-direction: column;
        text-align: center;
    }
    
    .price-display {
        justify-content: center;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-content {
        flex-direction: column;
        text-align: center;
    }
    
    .submit-btn {
        width: 100%;
        justify-content: center;
    }
}
