/* Cookie consent banner styling for the Foundation-based pubquizmaster theme.
   The xddesigners/cookieconsent module ships a Bootstrap-oriented base style; this file
   restyles the (theme-overridden) banner markup to use the theme's Foundation buttons.
   The module's own CSS keeps the fixed bottom-right container + slide-in animation. */

.cookie-consent {
    padding: 1.1rem 1.25rem;
    border-radius: 4px;
}

.cookie-consent__title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    line-height: 1.2;
}

.cookie-consent__body {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

/* Buttons stack on small screens; the theme's .button styling does the rest. */
.cookie-consent-actions .button {
    text-transform: none;
    font-weight: normal;
    margin-bottom: 0.5rem;
}

.cookie-consent-actions .button:last-child {
    margin-bottom: 0;
}

/* Side-by-side from Foundation's medium breakpoint up. */
@media only screen and (min-width: 640px) {
    .cookie-consent-actions {
        display: flex;
        justify-content: space-between;
    }

    .cookie-consent-action {
        flex: 1 1 0;
    }

    .cookie-consent-action:not(:last-child) {
        margin-right: 0.5rem;
    }

    .cookie-consent-actions .button {
        margin-bottom: 0;
    }
}

/* ---- Cookie policy page: consent form with toggle switches ---- */
.cookie-consent-form .cookie-consent-field {
    padding: 1rem 0;
    border-bottom: 1px solid #e8e8e8;
}

.cookie-consent-field .d-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-consent-field__label label {
    margin: 0;
    font-weight: 600;
    font-size: 1.15rem;
}

.cookie-consent-field__description {
    margin-top: 0.4rem;
    color: #555;
    font-size: 0.95rem;
}

/* Toggle switch built from the consent checkbox. */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
    flex: none;
}

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

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

.cookie-switch__slider::before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.cookie-switch input:checked + .cookie-switch__slider {
    background: #78a22f;
}

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

.cookie-switch input:disabled + .cookie-switch__slider {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Save button (module renders a Bootstrap .btn-primary; make it a theme-green button). */
.cookie-consent-form button[name="action_submitConsent"] {
    display: inline-block;
    margin-top: 1.25rem;
    padding: 0.6em 1.4em;
    background: #78a22f;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-weight: 600;
    cursor: pointer;
}

.cookie-consent-form button[name="action_submitConsent"]:hover {
    background: #688c28;
}
