/*
 * Bannerul de consimtamant. Se incarca pe layout-uri cu teme diferite
 * (site, auth, aplicatie), deci nu depinde de variabilele, fonturile sau
 * framework-urile paginii gazda.
 */
.af-cc {
    --cc-navy: #1E2145;
    --cc-purple: #452B90;
    --cc-text: #1E2145;
    --cc-muted: #4A4D6B;
    --cc-line: #E3E1EE;
    --cc-soft: #F6F4FB;
    --cc-focus: #452B90;
    font-family: "DM Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--cc-text);
}

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

.af-cc *,
.af-cc *::before,
.af-cc *::after {
    box-sizing: border-box;
}

/* ─── Nivelul 1 ─────────────────────────────────────────────────────────── */
.af-cc__bar {
    position: fixed;
    z-index: 2147483000;
    left: 24px;
    bottom: 24px;
    max-width: 440px;
    padding: 22px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(30, 33, 69, 0.18), 0 2px 6px rgba(30, 33, 69, 0.08);
    text-align: left;
}

.af-cc__title {
    margin: 0 0 6px;
    font-family: "Montserrat Alternates", "DM Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--cc-navy);
    letter-spacing: 0;
    text-transform: none;
}

.af-cc__title:focus {
    outline: none;
}

.af-cc__text {
    margin: 0 0 16px;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--cc-text);
}

.af-cc a {
    color: var(--cc-navy);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.af-cc__actions {
    display: flex;
    gap: 10px;
}

.af-cc__btn {
    flex: 1 1 0;
    margin: 0;
    padding: 12px 16px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    box-shadow: none;
}

.af-cc__btn--accept {
    background: var(--cc-purple);
    border-color: var(--cc-purple);
}

.af-cc__btn--reject {
    background: var(--cc-navy);
    border-color: var(--cc-navy);
}

.af-cc__btn--accept:hover {
    background: #3A2479;
    border-color: #3A2479;
}

.af-cc__btn--reject:hover {
    background: #2B2F5E;
    border-color: #2B2F5E;
}

.af-cc__btn--secondary {
    display: block;
    width: 100%;
    margin-top: 10px;
    background: #fff;
    border-color: var(--cc-navy);
    color: var(--cc-navy);
}

.af-cc__btn--secondary:hover {
    background: var(--cc-soft);
}

.af-cc__link {
    display: block;
    margin: 12px auto 0;
    padding: 4px 8px;
    background: none;
    border: 0;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--cc-text);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.af-cc button:focus-visible,
.af-cc a:focus-visible,
.af-cc summary:focus-visible,
.af-cc input:focus-visible + .af-cc__slider {
    outline: 3px solid var(--cc-focus);
    outline-offset: 2px;
}

/* ─── Nivelul 2 ─────────────────────────────────────────────────────────── */
.af-cc__backdrop {
    position: fixed;
    z-index: 2147483001;
    inset: 0;
    background: rgba(30, 33, 69, 0.45);
}

.af-cc__panel {
    position: fixed;
    z-index: 2147483002;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 48px);
    max-width: 560px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(30, 33, 69, 0.25);
    text-align: left;
}

.af-cc__panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.af-cc__close {
    flex: none;
    display: inline-flex;
    margin: -6px -6px 0 0;
    padding: 8px;
    background: none;
    border: 0;
    border-radius: 8px;
    color: var(--cc-navy);
    cursor: pointer;
}

.af-cc__close:hover {
    background: var(--cc-soft);
}

.af-cc__cats {
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.af-cc__cat {
    margin: 0;
    padding: 14px 0;
    border-top: 1px solid var(--cc-line);
}

.af-cc__cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.af-cc__cat-name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--cc-navy);
    cursor: pointer;
}

.af-cc__always {
    margin-left: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-muted);
}

.af-cc__cat-text {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cc-muted);
}

/* comutatorul */
.af-cc__switch {
    position: relative;
    flex: none;
    display: inline-flex;
}

.af-cc__switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.af-cc__switch input:disabled {
    cursor: not-allowed;
}

.af-cc__slider {
    display: inline-block;
    position: relative;
    padding: 12px 22px;
    border-radius: 999px;
    background: #C9C7D9;
    transition: background-color 0.15s ease;
}

.af-cc__slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    bottom: 3px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(30, 33, 69, 0.3);
    transition: transform 0.15s ease;
}

.af-cc__switch input:checked + .af-cc__slider {
    background: var(--cc-purple);
}

.af-cc__switch input:checked + .af-cc__slider::after {
    transform: translateX(20px);
}

.af-cc__switch input:disabled + .af-cc__slider {
    opacity: 0.6;
}

/* detaliile categoriei */
.af-cc__details {
    margin-top: 8px;
}

.af-cc__details summary {
    display: inline-block;
    padding: 2px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--cc-navy);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.af-cc__details summary::-webkit-details-marker {
    display: none;
}

.af-cc__cookies {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.af-cc__cookie {
    margin: 0 0 6px;
    padding: 8px 10px;
    background: var(--cc-soft);
    border-radius: 8px;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--cc-text);
}

.af-cc__cookie code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--cc-navy);
    background: none;
    padding: 0;
}

.af-cc__cookie-meta {
    display: block;
    color: var(--cc-muted);
}

/* Pe ecranele joase (1366×768) stânga-jos cade peste butonul principal din hero,
   iar pe ecranele de cont formularul stă în stânga. */
@media (min-width: 768px) and (max-height: 839.98px) {
    .af-cc__bar {
        left: auto;
        right: 24px;
    }
}

@media (min-width: 768px) {
    body:has(.af-auth) .af-cc__bar {
        left: auto;
        right: 24px;
    }
}

/* ─── Mobil ─────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .af-cc__bar {
        left: 0;
        right: 0;
        bottom: 0;
        max-width: none;
        max-height: 40vh;
        overflow-y: auto;
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
    }

    .af-cc__title {
        font-size: 17px;
    }

    .af-cc__text {
        margin-bottom: 12px;
        font-size: 14px;
    }

    .af-cc__link {
        margin-top: 6px;
    }

    .af-cc__panel {
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: none;
        max-height: 90vh;
        padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .af-cc__slider,
    .af-cc__slider::after {
        transition: none;
    }
}
