/* tidconsent 1.0.1 - Electech colours (--primary-color #1d77a3, text #333, Lexend). */
.tidconsent, .tidconsent-modal {
    --tc-primary: var(--primary-color, #1d77a3);
    --tc-primary-dark: #18628a;
    --tc-text: #333333;
    --tc-muted: #555555;
    --tc-bg: #ffffff;
    --tc-radius: var(--border-radius, 5px);
    font-family: var(--body-font-family, Lexend), Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tc-text);
    box-sizing: border-box;
}
.tidconsent *, .tidconsent-modal * { box-sizing: border-box; }
.tidconsent[hidden], .tidconsent-modal[hidden] { display: none !important; }

.tidconsent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    background: var(--tc-bg);
    border-top: 3px solid var(--tc-primary);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .18);
    padding: 16px;
    max-height: 85vh;
    overflow-y: auto;
}
.tidconsent__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}
.tidconsent__text { flex: 1 1 auto; }
.tidconsent__title {
    font-family: var(--title-font-family, Lexend), Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
    color: #171d27;
    text-transform: none;
}
.tidconsent__body { margin: 0; color: var(--tc-text); }
.tidconsent__actions--dialog .tidconsent-btn:only-child { grid-column: 1 / -1; }
.tidconsent__link, .tidconsent-modal a {
    color: var(--tc-primary-dark);
    text-decoration: underline;
    font-weight: 500;
}
.tidconsent__link:hover, .tidconsent__link:focus { color: #0f4a69; }
.tidconsent__actions {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    flex-wrap: wrap;
}
.tidconsent-btn {
    appearance: none;
    -webkit-appearance: none;
    min-height: 44px;
    min-width: 120px;
    padding: 10px 18px;
    border: 2px solid var(--tc-primary);
    border-radius: var(--tc-radius);
    background: var(--tc-primary);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-transform: none;
}
.tidconsent-btn:hover { background: var(--tc-primary-dark); border-color: var(--tc-primary-dark); color: #fff; }
.tidconsent-btn--outline { background: #ffffff; color: var(--tc-primary-dark); }
.tidconsent-btn--outline:hover { background: #e6edf5; color: var(--tc-primary-dark); }
.tidconsent-btn:focus-visible, .tidconsent-modal__close:focus-visible, .tidconsent__link:focus-visible,
.tidconsent-cat input:focus-visible, .tidconsent-footer-link:focus-visible, .tidconsent-modal__box:focus-visible {
    outline: 3px solid #f0a000;
    outline-offset: 2px;
}

/* GPC notice: smaller card bottom-left */
.tidconsent--gpc {
    left: 16px;
    right: auto;
    bottom: 16px;
    max-width: 420px;
    border: 1px solid #dddddd;
    border-left: 4px solid var(--tc-primary);
    border-radius: var(--tc-radius);
    padding: 14px;
}
.tidconsent--gpc .tidconsent__inner { flex-direction: column; align-items: stretch; gap: 10px; }
.tidconsent--gpc .tidconsent-btn { min-width: 0; flex: 1 1 auto; }

/* Dialog */
.tidconsent-modal {
    position: fixed;
    inset: 0;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.tidconsent-modal__backdrop { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(23, 29, 39, .55); }
.tidconsent-modal__box {
    position: relative;
    background: #ffffff;
    border-radius: var(--tc-radius);
    border-top: 4px solid var(--tc-primary);
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}
.tidconsent-modal__box > p { margin: 0 0 14px; }
.tidconsent-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    border-radius: var(--tc-radius);
}
.tidconsent-gpcnote {
    background: #e6edf5;
    border-left: 4px solid var(--tc-primary);
    padding: 10px 12px;
    border-radius: 3px;
}
.tidconsent-cat { border-top: 1px solid #ebebeb; padding: 12px 0; }
.tidconsent-cat__label { display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; font-weight: 600; color: #171d27; }
.tidconsent-cat input[type="checkbox"] { width: 22px; height: 22px; margin: 0; accent-color: var(--tc-primary); flex: 0 0 auto; cursor: pointer; }
.tidconsent-cat input[disabled] { cursor: not-allowed; }
.tidconsent-cat__badge { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--tc-muted); }
.tidconsent-cat__desc { margin: 4px 0 0 32px; color: var(--tc-muted); font-size: 13px; }
.tidconsent__actions--dialog { margin-top: 12px; justify-content: flex-end; }
.tidconsent-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tidconsent-footer-fallback { margin-top: 6px; }
.tidconsent-footer-link {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}
.tidconsent-privacy-icon {
    display: inline-block;
    width: 30px;
    height: 14px;
    flex: 0 0 30px;
    line-height: 0;
    text-decoration: none;
}
.tidconsent-privacy-icon svg {
    display: block;
    width: 30px;
    height: 14px;
}


/* Keep page content and Electech's back-to-top button clear of the banner */
html.tidconsent-open body { padding-bottom: var(--tidconsent-h, 0px); }
html.tidconsent-open .top_button { bottom: calc(var(--tidconsent-h, 0px) + 15px) !important; }
html.tidconsent-modal-open body { overflow: hidden; }

@media (max-width: 767px) {
    .tidconsent { padding: 12px; }
    .tidconsent__inner { flex-direction: column; align-items: stretch; gap: 10px; }
    .tidconsent__title { font-size: 15px; }
    .tidconsent__body { font-size: 13px; }
    .tidconsent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .tidconsent__actions .tidconsent-btn { width: 100%; min-width: 0; padding: 10px 8px; }
    .tidconsent__actions [data-tc="reject"] { order: 1; }
    .tidconsent__actions [data-tc="accept"] { order: 2; }
    .tidconsent__actions [data-tc="manage"] { order: 3; grid-column: 1 / -1; }
    .tidconsent__actions--dialog [data-tc="save"] { order: 3; grid-column: 1 / -1; }
    .tidconsent--gpc { left: 8px; right: 8px; bottom: 8px; max-width: none; }
    .tidconsent--gpc .tidconsent__actions [data-tc="manage"] { order: 1; grid-column: auto; }
    .tidconsent--gpc .tidconsent__actions [data-tc="gpc-ok"] { order: 2; }
    .tidconsent-modal { padding: 0; align-items: flex-end; }
    .tidconsent-modal__box { max-height: 92vh; border-radius: var(--tc-radius) var(--tc-radius) 0 0; padding: 20px 16px; }
}
@media (prefers-reduced-motion: no-preference) {
    .tidconsent-btn { transition: background-color .15s ease, color .15s ease; }
}
@media (forced-colors: active) {
    .tidconsent-btn { border: 2px solid ButtonText; }
}
