/* MedAtlas cookie consent (self-hosted CMP) */

.mac-banner,
.mac-modal,
.mac-tab {
    display: none;
}

.mac-banner.is-open {
    display: block;
}

.mac-modal.is-open {
    display: flex;
}

.mac-tab.is-open {
    display: flex;
}

/* ---------- Persistent reopen tab ---------- */

/*
 * Bottom left on purpose: the WhatsApp bubble on /pentru-companii sits
 * bottom right.
 */
.mac-tab {
    position: fixed;
    z-index: 2147482999;
    left: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
    padding: 0;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #dfe3e9;
    border-radius: 50%;
    color: var(--blue_ad, #06255E);
    box-shadow: 0 2px 10px rgba(6, 37, 94, .16);
    cursor: pointer;
    opacity: .62;
    transition: opacity .15s ease, box-shadow .15s ease, color .15s ease;
}

.mac-tab:hover,
.mac-tab:focus-visible {
    opacity: 1;
    color: var(--dark_orange, #e13856);
    box-shadow: 0 4px 16px rgba(6, 37, 94, .26);
}

.mac-tab:focus-visible {
    outline: 2px solid var(--dark_orange, #e13856);
    outline-offset: 2px;
}

.mac-tab svg {
    display: block;
    pointer-events: none;
}

@media print {
    .mac-tab {
        display: none !important;
    }
}

/* ---------- Banner ---------- */

.mac-banner {
    position: fixed;
    z-index: 2147483000;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 780px;
    margin: 0 auto;
    padding: 20px 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(6, 37, 94, .22);
    font-size: 14px;
    line-height: 1.55;
    color: #1f2937;
}

.mac-banner__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--blue_ad, #06255E);
}

.mac-banner__text {
    margin: 0 0 16px;
}

.mac-banner__text a {
    color: var(--dark_orange, #e13856);
    text-decoration: underline;
}

.mac-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mac-btn {
    flex: 1 1 auto;
    min-width: 150px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: opacity .15s ease;
}

.mac-btn:hover {
    opacity: .88;
}

.mac-btn:focus-visible {
    outline: 2px solid var(--dark_orange, #e13856);
    outline-offset: 2px;
}

/* Accept and reject are deliberately identical in size and weight. */
.mac-btn--accept {
    background: var(--dark_orange, #e13856);
    color: #fff;
}

.mac-btn--reject {
    background: var(--blue_ad, #06255E);
    color: #fff;
}

.mac-btn--settings {
    background: #fff;
    border-color: #c7cdd6;
    color: #1f2937;
}

/* ---------- Preferences modal ---------- */

.mac-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(6, 37, 94, .55);
}

.mac-modal__dialog {
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(6, 37, 94, .3);
    color: #1f2937;
    font-size: 14px;
    line-height: 1.55;
}

.mac-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #e6e9ee;
}

.mac-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--blue_ad, #06255E);
}

.mac-modal__close {
    padding: 4px 8px;
    background: none;
    border: 0;
    font-size: 24px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
}

.mac-modal__body {
    padding: 8px 24px 16px;
    overflow-y: auto;
}

.mac-modal__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e6e9ee;
}

.mac-group {
    padding: 16px 0;
    border-bottom: 1px solid #eef0f4;
}

.mac-group:last-child {
    border-bottom: 0;
}

.mac-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mac-group__name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.mac-group__desc {
    margin: 6px 0 0;
    color: #4b5563;
}

.mac-group__always {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

/* Toggle */
.mac-switch {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
}

.mac-switch input {
    position: absolute;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.mac-switch__track {
    display: block;
    width: 100%;
    height: 100%;
    background: #c7cdd6;
    border-radius: 13px;
    transition: background .15s ease;
    pointer-events: none;
}

.mac-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s ease;
}

.mac-switch input:checked + .mac-switch__track {
    background: var(--dark_orange, #e13856);
}

.mac-switch input:checked + .mac-switch__track::after {
    transform: translateX(20px);
}

.mac-switch input:focus-visible + .mac-switch__track {
    outline: 2px solid var(--dark_orange, #e13856);
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    .mac-banner {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 16px;
    }

    .mac-btn {
        flex: 1 1 100%;
    }
}
