.cookie-consent,
.cookie-consent * {
    box-sizing: border-box;
}

.cookie-consent [hidden] {
    display: none !important;
}

.cookie-banner {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 10000;
    width: min(100% - 2rem, 760px);
    margin-inline: auto;
    padding: 1.2rem;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    color: #17212b;
    background: #ffffff;
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.28);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.cookie-banner-title {
    display: block;
    margin-bottom: 0.35rem;
    color: #102a43;
    font-size: 1.2rem;
}

.cookie-banner p {
    margin: 0;
}

.cookie-banner a,
.cookie-dialog a {
    color: #005bbb;
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.cookie-button {
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 2px solid #005bbb;
    border-radius: 999px;
    color: #0051a8;
    background: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.cookie-button:hover {
    background: #eef6ff;
}

.cookie-button-primary {
    color: #ffffff;
    background: #005bbb;
}

.cookie-button-primary:hover {
    background: #003f82;
}

.cookie-button:focus-visible,
.cookie-settings-trigger:focus-visible,
.video-consent-button:focus-visible,
.cookie-dialog-close:focus-visible,
.cookie-toggle input:focus-visible + span {
    outline: 3px solid #ffbf47;
    outline-offset: 3px;
}

.cookie-settings-trigger {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 9998;
    min-height: 40px;
    padding: 0.5rem 0.85rem;
    border: 1px solid #94a3b8;
    border-radius: 999px;
    color: #243b53;
    background: #ffffff;
    box-shadow: 0 5px 20px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    font: 700 13px/1.2 Arial, Helvetica, sans-serif;
}

.cookie-settings-trigger:hover {
    background: #f1f5f9;
}

.cookie-dialog {
    width: min(100% - 2rem, 620px);
    max-height: min(88vh, 760px);
    padding: 0;
    border: 0;
    border-radius: 16px;
    color: #17212b;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.38);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

.cookie-dialog::backdrop {
    background: rgba(15, 23, 42, 0.6);
}

.cookie-dialog-inner {
    position: relative;
    max-height: min(88vh, 760px);
    overflow-y: auto;
    padding: 1.5rem;
}

.cookie-dialog h2 {
    margin: 0 3rem 0.35rem 0;
    color: #102a43;
    font-size: 1.65rem;
    line-height: 1.25;
}

.cookie-dialog-intro {
    margin: 0 0 1.25rem;
    color: #52606d;
}

.cookie-dialog-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    color: #243b53;
    background: #ffffff;
    cursor: pointer;
    font: 700 24px/1 Arial, Helvetica, sans-serif;
}

.cookie-category {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem 1rem;
    align-items: start;
    padding: 1rem 0;
    border-top: 1px solid #d9e2ec;
}

.cookie-category h3 {
    margin: 0;
    color: #102a43;
    font-size: 1.05rem;
}

.cookie-category p {
    grid-column: 1 / -1;
    margin: 0;
    color: #52606d;
    font-size: 0.92rem;
}

.cookie-required {
    color: #166534;
    font-size: 0.85rem;
    font-weight: 700;
}

.cookie-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cookie-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.cookie-toggle span {
    position: relative;
    display: block;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: #94a3b8;
    cursor: pointer;
    transition: background-color 160ms ease;
}

.cookie-toggle span::after {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.3);
    content: "";
    transition: transform 160ms ease;
}

.cookie-toggle input:checked + span {
    background: #005bbb;
}

.cookie-toggle input:checked + span::after {
    transform: translateX(20px);
}

.cookie-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding-top: 1rem;
    border-top: 1px solid #d9e2ec;
}

.video-consent-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    color: #ffffff;
    background:
        linear-gradient(rgba(5, 15, 30, 0.76), rgba(5, 15, 30, 0.88)),
        url("../images/dopalearn_logo_preview.png") center / cover no-repeat;
    text-align: center;
}

.video-consent-content {
    max-width: 300px;
}

.video-consent-title {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.video-consent-placeholder p {
    margin: 0 0 1rem;
    font-size: 0.92rem;
    line-height: 1.45;
}

.video-consent-button {
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 2px solid #ffffff;
    border-radius: 999px;
    color: #102a43;
    background: #ffffff;
    cursor: pointer;
    font: 700 14px/1.2 Arial, Helvetica, sans-serif;
}

.video-consent-button:hover {
    background: #eaf2f8;
}

@media (max-width: 560px) {
    .cookie-banner {
        right: 0.65rem;
        bottom: 0.65rem;
        left: 0.65rem;
        width: auto;
        padding: 1rem;
    }

    .cookie-actions,
    .cookie-dialog-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cookie-button {
        width: 100%;
    }

    .cookie-settings-trigger {
        right: 0.65rem;
        bottom: 0.65rem;
    }

    .cookie-dialog-inner {
        padding: 1.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-toggle span,
    .cookie-toggle span::after {
        transition: none;
    }
}
