@import url("theme-tokens.css");

.cookie-consent[hidden],
.privacy-settings-button[hidden],
[data-consent-options][hidden],
[data-consent-save][hidden] {
    display: none !important;
}

.cookie-consent {
    position: fixed;
    z-index: 10000;
    inset: auto 0 0;
    padding: 12px;
    filter: drop-shadow(0 -14px 32px var(--theme-shadow-color));
}

.cookie-consent-card {
    max-width: 1100px;
    margin: auto;
    padding: 14px 16px;
    display: flex;
    gap: 13px;
    border: 1px solid color-mix(in srgb, var(--theme-border) 74%, transparent);
    border-radius: 16px;
    background: color-mix(in srgb, var(--theme-panel) 96%, transparent);
    color: var(--theme-text-primary);
    box-shadow: 0 16px 45px color-mix(in srgb, var(--theme-bg) 70%, transparent);
    backdrop-filter: blur(18px);
}

.cookie-consent-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px;
    background: var(--theme-accent-soft);
    color: var(--theme-accent);
    font-size: 20px;
}

.cookie-consent-copy {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    column-gap: 18px;
    flex: 1;
    min-width: 0;
}

.cookie-consent-eyebrow {
    margin: 0 0 1px;
    color: var(--theme-accent);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.cookie-consent h2 {
    margin: 0;
    color: var(--theme-text-primary);
    font-size: 1rem;
    line-height: 1.25;
    letter-spacing: -1px;
}

.cookie-consent h2:focus {
    outline: none;
}

.cookie-consent-copy > p:not(.cookie-consent-eyebrow) {
    margin: 4px 0 0;
    color: var(--theme-text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.cookie-consent a {
    color: var(--theme-link);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-consent form {
    grid-column: 2;
    grid-row: 1/4;
    align-self: center;
}

.cookie-consent-copy:has(.cookie-consent-options:not([hidden])) {
    display: block;
}

.cookie-consent-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 0;
}

.cookie-button {
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}

.cookie-button.secondary {
    background: transparent;
    color: var(--theme-text-primary);
}

.cookie-button.primary {
    border-color: var(--theme-accent);
    background: var(--theme-accent);
    color: var(--theme-text-on-accent);
}

.cookie-button:focus-visible,
.privacy-settings-button:focus-visible {
    outline: 3px solid var(--theme-ring);
    outline-offset: 3px;
}

.cookie-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.cookie-consent-options {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.cookie-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--theme-border-subtle);
    border-radius: 13px;
    background: var(--theme-glass-subtle);
}

.cookie-option span {
    display: grid;
    gap: 2px;
    flex: 1;
}

.cookie-option b {
    color: var(--theme-text-primary);
    font-size: 0.88rem;
}

.cookie-option small {
    color: var(--theme-text-secondary);
    line-height: 1.35;
}

.cookie-option input[type="checkbox"] {
    width: 21px;
    height: 21px;
    accent-color: var(--theme-accent);
}

.cookie-option i {
    color: var(--theme-accent);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
}

.cookie-consent-error {
    margin-top: 9px !important;
    color: var(--theme-danger) !important;
}

.privacy-settings-button {
    position: fixed;
    z-index: 9000;
    left: 14px;
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: 220px;
    overflow: hidden;
    padding: 8px 11px;
    border: 1px solid color-mix(in srgb, var(--theme-border) 78%, transparent);
    border-radius: 999px;
    background: var(--theme-panel);
    color: var(--theme-text-primary);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--theme-bg) 66%, transparent);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
    transition:
        max-width 0.3s ease,
        padding 0.3s ease,
        gap 0.3s ease;
}

.privacy-settings-button i {
    flex: 0 0 auto;
}

.privacy-settings-button span {
    display: block;
    max-width: 160px;
    overflow: hidden;
    opacity: 1;
    transform: translateX(0);
    transition:
        max-width 0.3s ease,
        opacity 0.2s ease,
        transform 0.3s ease;
}

.privacy-settings-button.is-compact {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    gap: 0;
}

.privacy-settings-button.is-compact span {
    max-width: 0;
    opacity: 0;
    transform: translateX(10px);
}

.privacy-page {
    width: min(900px, calc(100% - 32px));
    margin: 130px auto 80px;
    color: var(--text-color, var(--theme-text-primary));
}

.privacy-page header {
    margin-bottom: 32px;
}

.privacy-page .eyebrow {
    color: var(--theme-success);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.privacy-page h1 {
    font-size: clamp(2.1rem, 6vw, 4rem);
    line-height: 1.04;
    margin: 0.2em 0;
}

.privacy-page .lead {
    max-width: 720px;
    font-size: 1.05rem;
    line-height: 1.7;
}

.privacy-page article {
    display: grid;
    gap: 26px;
}

.privacy-page section {
    padding: 24px;
    border: 1px solid var(--theme-border-subtle);
    border-radius: 18px;
    background: var(--theme-glass-subtle);
}

.privacy-page h2 {
    margin: 0 0 9px;
    font-size: 1.25rem;
}

.privacy-page p,
.privacy-page li {
    line-height: 1.7;
}

.privacy-page table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}

.privacy-page th,
.privacy-page td {
    padding: 11px;
    text-align: left;
    border-bottom: 1px solid var(--theme-border-subtle);
    vertical-align: top;
}

.privacy-page th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.privacy-page .privacy-manage {
    display: inline-flex;
    margin-top: 12px;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: var(--theme-success);
    color: var(--theme-text-on-dark);
    font-weight: 750;
    cursor: pointer;
}

@media (max-width: 820px) {
    .cookie-consent-copy {
        display: block;
    }

    .cookie-consent form {
        margin-top: 10px;
    }

    .cookie-consent-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .cookie-button {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .privacy-settings-button,
    .privacy-settings-button span {
        transition: none;
    }
}

@media (max-width: 650px) {
    .cookie-consent {
        padding: 7px;
    }

    .cookie-consent-card {
        padding: 11px;
        gap: 0;
        border-radius: 13px;
    }

    .cookie-consent-icon,
    .cookie-consent-eyebrow {
        display: none;
    }

    .cookie-consent h2 {
        font-size: 0.95rem;
    }

    .cookie-consent-copy > p:not(.cookie-consent-eyebrow) {
        font-size: 0.75rem;
        line-height: 1.35;
    }

    .cookie-consent form {
        margin-top: 8px;
    }

    .cookie-consent-actions {
        gap: 5px;
    }

    .cookie-button {
        min-height: 34px;
        padding: 6px 7px;
        font-size: 0.72rem;
    }

    .cookie-option {
        padding: 9px;
    }

    .privacy-page table,
    .privacy-page tbody,
    .privacy-page tr,
    .privacy-page th,
    .privacy-page td {
        display: block;
    }

    .privacy-page thead {
        display: none;
    }

    .privacy-page tr {
        padding: 10px 0;
        border-bottom: 1px solid var(--theme-border-subtle);
    }

    .privacy-page td {
        padding: 4px 0;
        border: 0;
    }

    .privacy-page td:before {
        content: attr(data-label) ": ";
        font-weight: 800;
    }
}
