/* =============================================================================
   PROFESJONALNE STYLE DLA SYSTEMU ZGOD COOKIE (samodzielny, bez Klaro)

   Ten plik styluje baner i modal systemu zgod cookie.
   <link rel="stylesheet" href="cookie-consent.css" />
   ============================================================================= */

/* ---------------------------------------------------------------------------
   CSS CUSTOM PROPERTIES — glowna paleta kolorow i ustawienia
   Zmien te wartosci, by dostosowac wyglad do swojej marki
   --------------------------------------------------------------------------- */
:root {
    /* Kolory podstawowe */
    --cc-primary: #295cff;          /* niebieski — akcje glowne (piotrlitwa.com) */
    --cc-primary-hover: #0e94ff;
    --cc-success: #16a34a;          /* zielony — "zaakceptuj" */
    --cc-success-hover: #15803d;
    --cc-danger: #6b7280;           /* szary — "odrzuc" */
    --cc-danger-hover: #4b5563;
    --cc-info: #0ea5e9;             /* jasny niebieski — "dowiedz sie wiecej" */
    --cc-info-hover: #0284c7;

    /* Tlo i tekst */
    --cc-bg: #ffffff;
    --cc-bg-secondary: #f8fafc;
    --cc-text: #1e293b;
    --cc-text-secondary: #475569;
    --cc-text-light: #94a3b8;
    --cc-border: #e2e8f0;

    /* Typografia */
    --cc-font: 'Quicksand', sans-serif;
    --cc-font-size: 14px;

    /* Zaokraglenia */
    --cc-radius: 8px;
    --cc-radius-sm: 6px;
    --cc-radius-btn: 6px;

    /* Cienie */
    --cc-shadow: 0 0 6px rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 0, 0, 0.06);
    --cc-shadow-lg: 0 15px 25px -7px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ---------------------------------------------------------------------------
   ANIMACJE
   --------------------------------------------------------------------------- */
@keyframes cc-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cc-slide-in-top {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cc-slide-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes cc-fade-in {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cc-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.96);
    }
}

/* ---------------------------------------------------------------------------
   BANER — WSPOLNE STYLE
   --------------------------------------------------------------------------- */
.cc-banner {
    position: fixed;
    z-index: 99999;
    background: var(--cc-bg);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
    font-family: var(--cc-font);
    font-size: var(--cc-font-size);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Domyslnie ukryty — cc-visible pokazuje */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cc-banner.cc-visible {
    opacity: 1;
    transform: translateY(0);
    animation: cc-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cc-banner.cc-hiding {
    animation: cc-slide-out 0.3s cubic-bezier(0.4, 0, 1, 1) both;
    pointer-events: none;
}

/* ---------------------------------------------------------------------------
   POZYCJE BANERA
   --------------------------------------------------------------------------- */

/* Prawy dolny rog */
.cc-banner.cc-pos-bottom-right {
    bottom: 1em;
    right: 1em;
    max-width: 400px;
}

/* Lewy dolny rog */
.cc-banner.cc-pos-bottom-left {
    bottom: 1em;
    left: 1em;
    max-width: 400px;
}

/* Pasek na dole */
.cc-banner.cc-pos-bottom-bar {
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

/* Pasek na gorze */
.cc-banner.cc-pos-top-bar {
    top: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

.cc-banner.cc-pos-top-bar.cc-visible {
    animation: cc-slide-in-top 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Modal na srodku */
.cc-banner.cc-pos-center-modal {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    max-width: 460px;
    width: calc(100% - 2em);
    box-shadow: var(--cc-shadow-lg);
    animation: none;
    opacity: 0;
}

.cc-banner.cc-pos-center-modal.cc-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Pasek na dole — uklad poziomy */
.cc-banner.cc-pos-bottom-bar,
.cc-banner.cc-pos-top-bar {
    display: flex;
    align-items: center;
    gap: 1.5em;
    padding: 1em 2em;
}

.cc-banner.cc-pos-bottom-bar .cc-banner-body,
.cc-banner.cc-pos-top-bar .cc-banner-body {
    flex: 1;
    padding: 0;
}

.cc-banner.cc-pos-bottom-bar .cc-banner-actions,
.cc-banner.cc-pos-top-bar .cc-banner-actions {
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   BANER — ZAWARTOSC
   --------------------------------------------------------------------------- */
.cc-banner-body {
    padding: 1.5em 1.5em 1.25em;
}

.cc-banner-title {
    color: var(--cc-text);
    font-size: 1.1em;
    font-weight: 700;
    margin: 0 0 0.4em 0;
    line-height: 1.3;
}

.cc-banner-text {
    color: var(--cc-text-secondary);
    font-size: 0.875em;
    line-height: 1.6;
    margin: 0 0 1em 0;
}

.cc-banner-text a {
    color: var(--cc-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cc-banner-text a:hover {
    color: var(--cc-primary-hover);
    text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   BANER — PRZYCISKI
   --------------------------------------------------------------------------- */
.cc-banner-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 1.5em 1.5em;
}

.cc-banner.cc-pos-bottom-bar .cc-banner-actions,
.cc-banner.cc-pos-top-bar .cc-banner-actions {
    padding: 0;
}

.cc-banner-buttons {
    display: flex;
    gap: 0.5em;
}

.cc-banner-buttons .cc-btn {
    flex: 1;
    text-align: center;
}

.cc-banner-customize {
    color: var(--cc-primary);
    font-size: 0.85em;
    font-weight: 600;
    margin-top: 0.75em;
    text-align: center;
    display: block;
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1.4;
}

.cc-banner-customize:hover {
    color: var(--cc-primary-hover);
    text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   PRZYCISKI — WSPOLNE
   --------------------------------------------------------------------------- */
.cc-btn {
    border-radius: var(--cc-radius-btn);
    padding: 0.65em 1.2em;
    font-size: 0.875em;
    font-weight: 600;
    font-family: var(--cc-font);
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
    line-height: 1.4;
}

/* Zaakceptuj — zielony */
.cc-btn.cc-btn-accept {
    background: var(--cc-success);
    color: #fff;
}

.cc-btn.cc-btn-accept:hover {
    background: var(--cc-success-hover);
    transform: translateY(-1px);
    box-shadow: 0 15px 25px -7px rgba(22, 163, 74, 0.25);
}

/* Odrzuc — obramowanie */
.cc-btn.cc-btn-decline {
    background: transparent;
    color: var(--cc-text-secondary);
    border: 1.5px solid var(--cc-border);
}

.cc-btn.cc-btn-decline:hover {
    background: var(--cc-bg-secondary);
    color: var(--cc-text);
    border-color: var(--cc-text-light);
    transform: translateY(-1px);
}

/* Zapisz wybrane — niebieski */
.cc-btn.cc-btn-save {
    background: var(--cc-primary);
    color: #fff;
}

.cc-btn.cc-btn-save:hover {
    background: var(--cc-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 15px 25px -7px rgba(41, 92, 255, 0.25);
}

/* ---------------------------------------------------------------------------
   MODAL — OVERLAY
   --------------------------------------------------------------------------- */
.cc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2em;
    font-family: var(--cc-font);
    font-size: var(--cc-font-size);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    opacity: 0;
    transition: opacity 0.3s ease;
}

.cc-modal-overlay.cc-visible {
    opacity: 1;
}

.cc-modal-overlay.cc-hiding {
    opacity: 0;
    pointer-events: none;
}

/* Tlo overlay */
.cc-modal-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ---------------------------------------------------------------------------
   MODAL — OKNO
   --------------------------------------------------------------------------- */
.cc-modal {
    position: relative;
    background: var(--cc-bg);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow-lg);
    max-width: 680px;
    max-height: 85vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    animation: cc-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cc-modal-overlay.cc-hiding .cc-modal {
    animation: cc-fade-out 0.25s ease both;
}

/* ---------------------------------------------------------------------------
   MODAL — NAGLOWEK
   --------------------------------------------------------------------------- */
.cc-modal-header {
    position: relative;
    padding: 1.5em 1.5em 1em;
    border-bottom: 1px solid var(--cc-border);
}

.cc-modal-header h1 {
    color: var(--cc-text);
    font-size: 1.4em;
    font-weight: 700;
    margin: 0 0 0.4em 0;
    padding-right: 2em;
}

.cc-modal-header p {
    color: var(--cc-text-secondary);
    line-height: 1.6;
    margin: 0 0 0.3em 0;
    font-size: 0.9em;
}

.cc-privacy-link {
    font-size: 0.85em !important;
}

.cc-privacy-link a {
    color: var(--cc-primary);
    text-decoration: none;
    font-weight: 500;
}

.cc-privacy-link a:hover {
    color: var(--cc-primary-hover);
    text-decoration: underline;
}

/* Przycisk zamknij (X) */
.cc-modal-close {
    position: absolute;
    top: 1.2em;
    right: 1.2em;
    background: none;
    border: none;
    font-size: 1.5em;
    color: var(--cc-text-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.cc-modal-close:hover {
    color: var(--cc-text);
    background: var(--cc-bg-secondary);
}

/* ---------------------------------------------------------------------------
   MODAL — BODY (lista serwisow)
   --------------------------------------------------------------------------- */
.cc-modal-body {
    padding: 0.5em 1.5em;
    overflow-y: auto;
    flex: 1;
}

/* Grupa celow */
.cc-purpose-group {
    padding: 0.8em 0;
    border-bottom: 1px solid var(--cc-border);
}

.cc-purpose-group:last-child {
    border-bottom: none;
}

.cc-purpose-header {
    margin-bottom: 0.5em;
}

.cc-purpose-title {
    color: var(--cc-text);
    font-size: 1em;
    font-weight: 700;
    margin: 0 0 0.2em 0;
}

.cc-purpose-desc {
    color: var(--cc-text-light);
    font-size: 0.82em;
    line-height: 1.5;
    margin: 0;
}

/* Lista serwisow */
.cc-service-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cc-service-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8em;
    padding: 0.6em 0 0.6em 0.5em;
}

.cc-service-item:last-child {
    padding-bottom: 0;
}

.cc-service-info {
    flex: 1;
    min-width: 0;
}

.cc-service-title {
    color: var(--cc-text);
    font-weight: 600;
    font-size: 0.92em;
    display: block;
    line-height: 1.4;
}

.cc-service-desc {
    color: var(--cc-text-secondary);
    font-size: 0.82em;
    line-height: 1.5;
    margin: 0.15em 0 0 0;
}

.cc-required-tag {
    display: inline-block;
    font-size: 0.75em;
    font-weight: 600;
    color: var(--cc-text-light);
    font-style: italic;
    margin-left: 0.3em;
}

/* ---------------------------------------------------------------------------
   TOGGLE SWITCH — przelaczniki zgod
   --------------------------------------------------------------------------- */
.cc-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

.cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cc-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.25s ease, box-shadow 0.25s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cc-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cc-toggle input:checked + .cc-toggle-slider {
    background: var(--cc-success);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.cc-toggle input:checked + .cc-toggle-slider::before {
    transform: translateX(20px);
}

/* Required — szary, zablokowany */
.cc-toggle input:disabled + .cc-toggle-slider {
    background: var(--cc-text-light);
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: none;
}

.cc-toggle input:disabled:checked + .cc-toggle-slider {
    background: var(--cc-text-light);
}

/* ---------------------------------------------------------------------------
   MODAL — STOPKA
   --------------------------------------------------------------------------- */
.cc-modal-footer {
    padding: 1em 1.5em;
    border-top: 1px solid var(--cc-border);
    background: var(--cc-bg-secondary);
    border-radius: 0 0 var(--cc-radius) var(--cc-radius);
}

.cc-modal-buttons {
    display: flex;
    gap: 0.5em;
}

.cc-modal-buttons .cc-btn {
    flex: 1;
    text-align: center;
}

.cc-powered-by {
    font-size: 0.75em;
    color: var(--cc-text-light);
    text-align: center;
    margin-top: 0.5em;
}

.cc-powered-by a {
    color: var(--cc-text-light);
    text-decoration: none;
}

.cc-powered-by a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   RESPONSYWNOSC
   --------------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 768px) {
    .cc-banner.cc-pos-bottom-right,
    .cc-banner.cc-pos-bottom-left {
        max-width: calc(100vw - 2em);
        left: 1em;
        right: 1em;
    }

    .cc-banner.cc-pos-bottom-bar,
    .cc-banner.cc-pos-top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
    }

    .cc-banner.cc-pos-bottom-bar .cc-banner-body,
    .cc-banner.cc-pos-top-bar .cc-banner-body {
        padding: 1.25em 1.25em 0.75em;
    }

    .cc-banner.cc-pos-bottom-bar .cc-banner-actions,
    .cc-banner.cc-pos-top-bar .cc-banner-actions {
        padding: 0 1.25em 1.25em;
    }

    .cc-banner-body {
        padding: 1.25em;
    }

    .cc-modal-overlay {
        padding: 1em;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .cc-banner.cc-pos-bottom-right,
    .cc-banner.cc-pos-bottom-left {
        border-radius: var(--cc-radius-sm) var(--cc-radius-sm) 0 0;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
    }

    .cc-banner-body {
        padding: 1em 1em 1.25em;
    }

    .cc-banner-actions {
        padding: 0 1em 1em;
    }

    .cc-banner-title {
        font-size: 1em;
    }

    .cc-banner-text {
        font-size: 0.82em;
    }

    .cc-btn {
        padding: 0.7em 1em;
        font-size: 0.85em;
    }

    .cc-modal {
        max-height: 90vh;
        max-width: 100vw;
        border-radius: var(--cc-radius) var(--cc-radius) 0 0;
    }

    .cc-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
}
