/**
 * Kalkulator Fosforanowanie - Nowoczesny styl z animacjami
 * Kolorystyka: Czerwony (#DC2626), Biały, Czarny/Szary
 */

:root {
    --kf-red: #DC2626;
    --kf-red-dark: #B91C1C;
    --kf-red-light: #FEE2E2;
    --kf-white: #FFFFFF;
    --kf-black: #1F2937;
    --kf-gray: #6B7280;
    --kf-gray-light: #F3F4F6;
    --kf-gray-border: #E5E7EB;
    --kf-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --kf-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --kf-radius: 12px;
    --kf-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.defox-kf-calculator {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.defox-kf-container {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 30px;
    background: var(--kf-white);
    border-radius: var(--kf-radius);
    box-shadow: var(--kf-shadow-lg);
    overflow: hidden;
}

/* === LEWY PANEL - SUWAKI === */
.defox-kf-controls-panel {
    padding: 40px;
    background: var(--kf-gray-light);
    border-right: 1px solid var(--kf-gray-border);
}

.defox-kf-controls-panel h2 {
    margin: 0 0 30px 0;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--kf-black);
    border-bottom: 3px solid var(--kf-red);
    display: inline-block;
    padding-bottom: 8px;
}

.defox-kf-input-group {
    margin-bottom: 28px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

/* Ostatnia pozycja (temperatura) większa odległość */
.defox-kf-input-group:last-child {
    margin-top: 42px;
}

.defox-kf-input-group:nth-child(2) { animation-delay: 0.1s; }
.defox-kf-input-group:nth-child(3) { animation-delay: 0.2s; }
.defox-kf-input-group:nth-child(4) { animation-delay: 0.3s; }
.defox-kf-input-group:nth-child(5) { animation-delay: 0.4s; }
.defox-kf-input-group:nth-child(7) { animation-delay: 0.5s; }

.defox-kf-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.defox-kf-label-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--kf-black);
}

.defox-kf-value-badge {
    background: var(--kf-red);
    color: var(--kf-white);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 70px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
    transition: var(--kf-transition);
}

.defox-kf-value-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.defox-kf-badge-warning {
    background: var(--kf-black);
}

/* Range slider styling - prosty szary pasek */
.defox-kf-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #D1D5DB;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.defox-kf-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #D1D5DB;
    border-radius: 3px;
}

.defox-kf-range::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #D1D5DB;
    border-radius: 3px;
}

/* Kółko suwaka - czarne wypełnienie, czarny border */
.defox-kf-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #000000;
    cursor: pointer;
    border: 3px solid #000000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: var(--kf-transition);
    margin-top: -8px;
}

.defox-kf-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #000000;
    cursor: pointer;
    border: 3px solid #000000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: var(--kf-transition);
}

.defox-kf-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.defox-kf-range::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.defox-kf-divider {
    display: none;
}

/* === PRAWY PANEL - WYNIKI === */
.defox-kf-results-panel {
    padding: 40px;
    background: var(--kf-white);
    display: flex;
    flex-direction: column;
}

.defox-kf-results-header {
    text-align: center;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeIn 1s ease 0.3s forwards;
}

.defox-kf-results-header h3 {
    margin: 0 0 15px 0;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--kf-gray);
}

.defox-kf-main-amount {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--kf-red);
    line-height: 1;
    margin: 15px 0;
    transition: var(--kf-transition);
}

.defox-kf-main-amount:hover {
    transform: scale(1.05);
}

.defox-kf-reduction-badge {
    display: inline-block;
    background: var(--kf-red-light);
    color: var(--kf-red-dark);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Porównanie kart */
.defox-kf-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.5s forwards;
}

.defox-kf-comp-card {
    background: var(--kf-white);
    border-radius: var(--kf-radius);
    padding: 24px;
    box-shadow: var(--kf-shadow);
    transition: var(--kf-transition);
    border-top: 4px solid var(--kf-gray);
}

.defox-kf-comp-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--kf-shadow-lg);
}

.defox-kf-comp-card.defox-kf-current {
    border-top-color: var(--kf-gray);
}

.defox-kf-comp-card.defox-kf-new {
    border-top-color: var(--kf-red);
}

.defox-kf-comp-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--kf-gray);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.defox-kf-comp-cost {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--kf-black);
    margin-bottom: 8px;
}

.defox-kf-comp-card.defox-kf-new .defox-kf-comp-cost {
    color: var(--kf-red);
}

.defox-kf-comp-energy {
    font-size: 0.85rem;
    color: var(--kf-gray);
}

.defox-kf-comp-energy span {
    font-weight: 600;
    color: var(--kf-black);
}

/* Szczegóły */
.defox-kf-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: auto;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.7s forwards;
}

.defox-kf-detail-item {
    background: var(--kf-gray-light);
    padding: 20px;
    border-radius: var(--kf-radius);
    text-align: center;
    border: 1px solid var(--kf-gray-border);
    transition: var(--kf-transition);
}

.defox-kf-detail-item:hover {
    background: var(--kf-red-light);
    border-color: var(--kf-red);
}

.defox-kf-detail-label {
    font-size: 0.75rem;
    color: var(--kf-gray);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.defox-kf-detail-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--kf-black);
    margin-top: 8px;
}

/* CTA Button */
.defox-kf-cta-wrapper {
    margin: 30px 0;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.9s forwards;
}

.defox-kf-cta-button {
    background: var(--kf-red);
    color: var(--kf-white);
    border: none;
    padding: 16px 40px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--kf-transition);
}

.defox-kf-cta-button:hover {
    background: var(--kf-red-dark);
    transform: translateY(-2px);
}

.defox-kf-cta-button:active {
    transform: translateY(0);
}

.defox-kf-disclaimer {
    margin-top: 20px;
    font-size: 0.7rem;
    color: var(--kf-gray);
    text-align: center;
    line-height: 1.5;
}

/* === MODAL === */
.defox-kf-modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    z-index: 9999;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.defox-kf-modal.active {
    display: flex;
    opacity: 1;
}

.defox-kf-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    margin: 0 !important;
    padding: 0 !important;
}

.defox-kf-modal-content {
    position: relative;
    background: var(--kf-white);
    border-radius: var(--kf-radius);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--kf-shadow-lg);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
}

.defox-kf-modal.active .defox-kf-modal-content {
    transform: scale(1);
}

.defox-kf-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--kf-gray);
    transition: var(--kf-transition);
}

.defox-kf-modal-close:hover {
    color: var(--kf-red);
    transform: rotate(90deg);
}

.defox-kf-modal-header {
    margin-bottom: 30px;
}

.defox-kf-modal-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: var(--kf-black);
}

.defox-kf-modal-header p {
    margin: 0;
    color: var(--kf-gray);
    font-size: 0.9rem;
}

/* Form styles */
.defox-kf-form-group {
    margin-bottom: 20px;
}

.defox-kf-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--kf-black);
    font-size: 0.9rem;
}

.defox-kf-required {
    color: var(--kf-red);
}

.defox-kf-form-group input[type="email"],
.defox-kf-form-group input[type="text"],
.defox-kf-form-group input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--kf-gray-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--kf-transition);
    box-sizing: border-box;
}

.defox-kf-form-group input[type="email"]:focus,
.defox-kf-form-group input[type="text"]:focus,
.defox-kf-form-group input[type="tel"]:focus {
    outline: none;
    border-color: var(--kf-red);
    box-shadow: 0 0 0 3px var(--kf-red-light);
}

.defox-kf-checkbox-group {
    margin-bottom: 15px;
}

.defox-kf-checkbox-label {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
}

.defox-kf-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--kf-red);
}

.defox-kf-checkbox-label span {
    font-size: 0.85rem;
    color: var(--kf-gray);
    line-height: 1.5;
    cursor: default;
}

.defox-kf-checkbox-label span a {
    color: var(--kf-red);
    text-decoration: underline;
    cursor: pointer;
}

.defox-kf-checkbox-label span a:hover {
    color: var(--kf-red-dark);
}

.defox-kf-submit-button {
    width: 100%;
    background: var(--kf-red);
    color: var(--kf-white);
    border: none;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--kf-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.defox-kf-submit-button:hover {
    background: var(--kf-red-dark);
    transform: translateY(-2px);
}

.defox-kf-cta-button:hover,
.defox-kf-cta-button:focus,
.defox-kf-cta-button:active {
    background: var(--kf-red-dark);
    color: var(--kf-white);
    transform: translateY(-2px);
    outline: none;
}

.defox-kf-submit-button:hover,
.defox-kf-submit-button:focus,
.defox-kf-submit-button:active {
    background: var(--kf-red-dark);
    color: var(--kf-white);
    transform: translateY(-2px);
    outline: none;
}

.defox-kf-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.defox-kf-button-loader svg {
    animation: spin 1s linear infinite;
}

.defox-kf-form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.defox-kf-form-message.success {
    display: block;
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.defox-kf-form-message.error {
    display: block;
    background: var(--kf-red-light);
    color: var(--kf-red-dark);
    border: 1px solid var(--kf-red);
}

/* === ANIMACJE === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .defox-kf-container {
        grid-template-columns: 1fr;
    }

    .defox-kf-controls-panel {
        border-right: none;
        border-bottom: 1px solid var(--kf-gray-border);
    }

    .defox-kf-main-amount {
        font-size: 2.5rem;
    }

    .defox-kf-comparison-grid,
    .defox-kf-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .defox-kf-calculator {
        padding: 0 10px;
        margin: 20px auto;
    }

    .defox-kf-controls-panel,
    .defox-kf-results-panel {
        padding: 25px;
    }

    .defox-kf-main-amount {
        font-size: 2rem;
    }

    .defox-kf-modal-content {
        padding: 30px 20px;
    }
}
.defox-kf-trust-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background-color: #f8f9fa; /* Bardzo jasny szary, neutralny */
    border-left: 4px solid #0056b3; /* Kolor Twojej marki (przykładowy niebieski) */
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    font-size: 0.9em;
    line-height: 1.4;
    color: #495057;
}

.defox-kf-trust-icon svg {
    color: #0056b3; /* Kolor ikony spójny z belką */
    flex-shrink: 0;
}

.defox-kf-trust-content strong {
    display: block;
    margin-bottom: 4px;
    color: #212529;
}

.defox-kf-trust-content p {
    margin: 0;
    font-size: 0.95em;
}