/*
 * eAsig - Cookie consent banner & preferences dialog.
 * Self-contained styles: the banner must render correctly even before the
 * Tailwind CDN runtime has finished generating utility classes.
 */

.cc {
    --cc-brand: #89B136;
    --cc-brand-dark: #678826;
    --cc-brand-soft: #f2f8e7;
    --cc-ink: #111827;
    --cc-muted: #6b7280;
    --cc-line: #e5e7eb;
    --cc-surface: #ffffff;
    --cc-radius: 20px;
    font-family: inherit;
}

.cc[hidden] {
    display: none !important;
}

/* ----------------------------------------------------------------- banner */

.cc-banner {
    position: fixed;
    z-index: 2147483000;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 62rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(137, 177, 54, 0.25);
    border-radius: var(--cc-radius);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 45px -12px rgba(17, 24, 39, 0.25), 0 2px 6px rgba(17, 24, 39, 0.05);
    animation: cc-rise 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cc-rise {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(1.5rem);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.cc-banner__icon {
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--cc-brand-dark);
    background: var(--cc-brand-soft);
}

    .cc-banner__icon svg {
        width: 1.75rem;
        height: 1.75rem;
    }

.cc-banner__body {
    flex: 1 1 auto;
    min-width: 0;
}

.cc-title {
    margin: 0 0 0.35rem;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--cc-ink);
}

.cc-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--cc-muted);
}

.cc-link {
    color: var(--cc-brand-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

    .cc-link:hover {
        color: var(--cc-brand);
    }

.cc-banner__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------------------------------------------------------------- buttons */

.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 0.625rem 1.125rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

    .cc-btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(137, 177, 54, 0.35);
    }

.cc-btn--primary {
    color: #fff;
    background: var(--cc-brand);
    box-shadow: 0 6px 16px -6px rgba(137, 177, 54, 0.75);
}

    .cc-btn--primary:hover {
        background: var(--cc-brand-dark);
        transform: translateY(-1px);
    }

.cc-btn--outline {
    color: var(--cc-ink);
    background: #fff;
    border-color: var(--cc-line);
}

    .cc-btn--outline:hover {
        border-color: var(--cc-brand);
        color: var(--cc-brand-dark);
    }

.cc-btn--ghost {
    color: var(--cc-muted);
    background: transparent;
}

    .cc-btn--ghost:hover {
        color: var(--cc-brand-dark);
        background: var(--cc-brand-soft);
    }

/* ----------------------------------------------------------------- dialog */

.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cc-modal[hidden] {
    display: none !important;
}

.cc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: cc-fade 0.25s ease both;
}

.cc-modal__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 38rem;
    max-height: calc(100vh - 2rem);
    border-radius: var(--cc-radius);
    background: var(--cc-surface);
    box-shadow: 0 25px 60px -15px rgba(17, 24, 39, 0.45);
    overflow: hidden;
    animation: cc-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cc-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cc-pop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cc-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--cc-line);
    background: linear-gradient(135deg, var(--cc-brand-soft) 0%, #ffffff 65%);
}

.cc-modal__header .cc-banner__icon {
    width: 2.5rem;
    height: 2.5rem;
    background: #fff;
}

    .cc-modal__header .cc-banner__icon svg {
        width: 1.375rem;
        height: 1.375rem;
    }

.cc-modal__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.cc-close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    color: var(--cc-muted);
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .cc-close:hover {
        color: var(--cc-ink);
        background: rgba(17, 24, 39, 0.06);
    }

    .cc-close:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(137, 177, 54, 0.35);
    }

    .cc-close svg {
        width: 1.125rem;
        height: 1.125rem;
    }

.cc-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}

.cc-intro {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--cc-muted);
}

.cc-group {
    padding: 1rem;
    border: 1px solid var(--cc-line);
    border-radius: 14px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

    .cc-group + .cc-group {
        margin-top: 0.75rem;
    }

    .cc-group:hover {
        border-color: rgba(137, 177, 54, 0.45);
        background: rgba(242, 248, 231, 0.4);
    }

.cc-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cc-group__name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--cc-ink);
}

.cc-group__desc {
    margin: 0.4rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--cc-muted);
}

.cc-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--cc-brand-dark);
    background: var(--cc-brand-soft);
}

/* ---------------------------------------------------------------- toggle */

.cc-switch {
    position: relative;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 1.5rem;
}

    .cc-switch input {
        position: absolute;
        width: 100%;
        height: 100%;
        margin: 0;
        opacity: 0;
        cursor: pointer;
    }

.cc-switch__track {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    background: #d1d5db;
    transition: background-color 0.2s ease;
    pointer-events: none;
}

    .cc-switch__track::after {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 1.125rem;
        height: 1.125rem;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 1px 3px rgba(17, 24, 39, 0.3);
        transition: transform 0.2s ease;
    }

.cc-switch input:checked ~ .cc-switch__track {
    background: var(--cc-brand);
}

    .cc-switch input:checked ~ .cc-switch__track::after {
        transform: translateX(1.25rem);
    }

.cc-switch input:focus-visible ~ .cc-switch__track {
    box-shadow: 0 0 0 3px rgba(137, 177, 54, 0.35);
}

.cc-switch input:disabled {
    cursor: not-allowed;
}

    .cc-switch input:disabled ~ .cc-switch__track {
        background: var(--cc-brand);
        opacity: 0.45;
    }

.cc-modal__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--cc-line);
    background: #fafafa;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 860px) {
    .cc-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.875rem;
        padding: 1.125rem;
        bottom: 0.75rem;
        width: calc(100% - 1.5rem);
    }

    .cc-banner__actions {
        width: 100%;
        flex-wrap: wrap;
    }

        .cc-banner__actions .cc-btn {
            flex: 1 1 auto;
        }

    .cc-modal__footer .cc-btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 420px) {
    .cc-banner__actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cc-banner,
    .cc-modal__dialog,
    .cc-modal__backdrop {
        animation: none;
    }

    .cc-btn,
    .cc-switch__track,
    .cc-switch__track::after {
        transition: none;
    }
}
