/* ProfiProg — compact cookie consent */

.cookie-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    padding: 8px 10px 10px;
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.cookie-consent.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cookie-consent__inner {
    max-width: 920px;
    margin: 0 auto;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-theme="dark"] .cookie-consent__inner {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.cookie-consent__icon {
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.cookie-consent__content {
    flex: 1;
    min-width: 0;
}

.cookie-consent__text {
    margin: 0;
    color: var(--text-secondary, #64748b);
    line-height: 1.4;
    font-size: 0.78rem;
}

.cookie-consent__title {
    color: var(--text, #0f172a);
    font-weight: 700;
    font-size: 0.82rem;
}

.cookie-consent__sep {
    margin: 0 4px;
    color: var(--text-muted, #94a3b8);
}

.cookie-consent__text a {
    color: var(--primary, #2563eb);
    text-decoration: underline;
    white-space: nowrap;
}

.cookie-consent__actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
    align-items: center;
}

.cookie-consent__btn {
    border: none;
    border-radius: 8px;
    padding: 7px 11px;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.cookie-consent__btn--primary {
    background: var(--primary, #2563eb);
    color: #fff;
}

.cookie-consent__btn--primary:hover {
    background: #1d4ed8;
}

.cookie-consent__btn--outline {
    background: transparent;
    color: var(--text, #0f172a);
    border: 1px solid var(--border, #cbd5e1);
}

.cookie-consent__btn--outline:hover {
    background: var(--bg-secondary, #f8fafc);
}

.cookie-consent__btn--ghost {
    background: transparent;
    color: var(--text-secondary, #64748b);
    padding: 7px 8px;
}

.cookie-consent__btn--ghost:hover {
    color: var(--text, #0f172a);
}

/* Modal */
.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.cookie-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
}

.cookie-modal__panel {
    position: relative;
    width: min(480px, 100%);
    max-height: calc(100vh - 24px);
    overflow: auto;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
}

[data-theme="dark"] .cookie-modal__panel {
    background: #0f172a;
    border-color: #334155;
}

.cookie-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-secondary, #64748b);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.cookie-modal__title {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: var(--text, #0f172a);
}

.cookie-modal__text {
    margin: 0 0 14px;
    color: var(--text-secondary, #64748b);
    line-height: 1.45;
    font-size: 0.85rem;
}

.cookie-pref {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--bg-secondary, #f8fafc);
}

[data-theme="dark"] .cookie-pref {
    background: rgba(255, 255, 255, 0.03);
}

.cookie-pref__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.cookie-pref h3 {
    margin: 0 0 2px;
    font-size: 0.88rem;
    color: var(--text, #0f172a);
}

.cookie-pref p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.35;
}

.cookie-pref__always {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary, #2563eb);
    white-space: nowrap;
}

.cookie-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-switch__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.cookie-switch__slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.cookie-switch input:checked + .cookie-switch__slider {
    background: #2563eb;
}

.cookie-switch input:checked + .cookie-switch__slider::before {
    transform: translateX(18px);
}

.cookie-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

.cookie-modal__actions .cookie-consent__btn {
    font-size: 0.8rem;
    padding: 8px 14px;
}

.cookie-settings-fab {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 99990;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 50%;
    background: var(--bg-card, #fff);
    color: var(--text-secondary, #64748b);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .cookie-settings-fab {
    background: #0f172a;
    border-color: #334155;
}

.cookie-settings-footer-link {
    display: none;
}

@media (max-width: 768px) {
    .cookie-settings-fab {
        display: none !important;
    }

    .cookie-settings-footer-link {
        display: list-item;
    }

    .cookie-consent {
        padding: 6px 8px 8px;
    }

    .cookie-consent__inner {
        flex-wrap: wrap;
        padding: 10px;
        gap: 8px;
    }

    .cookie-consent__icon {
        display: none;
    }

    .cookie-consent__text {
        font-size: 0.75rem;
    }

    .cookie-consent__title {
        display: block;
        margin-bottom: 2px;
        font-size: 0.8rem;
    }

    .cookie-consent__sep {
        display: none;
    }

    .cookie-consent__actions {
        width: 100%;
        justify-content: stretch;
    }

    .cookie-consent__btn--ghost {
        display: none;
    }

    .cookie-consent__btn {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
    }
}

@media (max-width: 400px) {
    .cookie-consent__actions {
        flex-direction: column;
    }

    .cookie-consent__btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent,
    .cookie-modal,
    .cookie-consent__btn,
    .cookie-switch__slider,
    .cookie-switch__slider::before {
        transition: none;
    }
}
