/* Cashback campaign presentation, loaded only while a campaign runs for the domain's referrer:
   the calm one-line bar directly under the site navigation (views/global/partials/cashback-bar.ejs
   loads this file through the CSS tracker), the plaque under the price of each top tariff on the
   start page (specific/comparison/components/tariff-comparison.ejs) and the rules dialog the bar's
   button opens. No motion and no countdown: one statement, a date, a button. Savings read in
   green — the bar on a soft green ground (#e9f3f0, text #1f3f3b, button #2c5d56), the plaque on
   #e3f4ea in #17613a — and every text keeps a contrast of at least 4.5:1 on its ground. The bar
   is in the first viewport, so the bar and plaque rules (not the dialog) are also inlined in
   global/partials/head-with-css-tracking.ejs while a hint is shown; keep both copies in step.
   The dialog lives in the top layer, so opening it never shifts the page.

   The bar is one line at every width and never wraps: icon, text and button are flex siblings
   with a fixed gap, nothing is positioned, and the text after the bold amount comes in four
   lengths of which CSS shows the one that fits (measured at 13px Inter, button included):
   ≥ 900px the wide sentence (needs ~730px), 700–899px the medium one (~570px), 360–699px the
   compact one (~480px at 13px, ~420px at 12px, ~340px with the icon-only button), < 360px the
   short one (~200px). Below 480px the button keeps only its info icon; its aria-label names it. */
.cashback-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin: 0;
    padding: 9px 16px;
    background: #e9f3f0;
    color: #1f3f3b;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    text-align: center;
    white-space: nowrap;
}

.cashback-bar__icon {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    color: #2c5d56;
}

.cashback-bar__text {
    flex-shrink: 0;
    margin: 0;
}

.cashback-bar__text strong {
    font-weight: 700;
}

.cashback-bar__tail {
    display: none;
}

.cashback-bar__tail--wide {
    display: inline;
}

/* Info icon of every button that opens the rules: the bar button and the plaques. */
.cashback-info-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* The rules button reads like the link of the mockup but is a real button. */
.cashback-bar__more {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #2c5d56;
    font: inherit;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.cashback-bar__more:hover .cashback-bar__more-label {
    text-decoration: underline;
}

.cashback-bar__more:focus-visible {
    outline: 2px solid #2c5d56;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Text only for assistive technology (the plaques name the dialog they open). */
.cashback-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Plaque under the price of each top tariff on the start page: a button to the same rules. */
.tariff-cashback-tag-slot {
    display: flex;
    justify-content: center;
    margin: -4px 0 12px;
}

.tariff-cashback-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 3px 9px;
    border: 0;
    border-radius: 999px;
    background: #e3f4ea;
    color: #17613a;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
}

.tariff-cashback-tag .cashback-info-icon {
    width: 13px;
    height: 13px;
}

.tariff-cashback-tag:hover .tariff-cashback-tag__text {
    text-decoration: underline;
}

.tariff-cashback-tag:focus-visible {
    outline: 2px solid #17613a;
    outline-offset: 2px;
}

@media (max-width: 899px) {
    .cashback-bar__tail--wide {
        display: none;
    }

    .cashback-bar__tail--medium {
        display: inline;
    }
}

@media (max-width: 768px) {
    .tariff-cashback-tag-slot {
        margin: -2px 0 8px;
    }

    .tariff-cashback-tag {
        gap: 3px;
        padding: 2px 7px;
        font-size: 10px;
    }

    .tariff-cashback-tag .cashback-info-icon {
        width: 11px;
        height: 11px;
    }
}

@media (max-width: 699px) {
    .cashback-bar__tail--medium {
        display: none;
    }

    .cashback-bar__tail--compact {
        display: inline;
    }
}

/* Phones: smaller type, no gift icon. */
@media (max-width: 640px) {
    .cashback-bar {
        padding: 8px 12px;
        font-size: 12px;
    }

    .cashback-bar__icon {
        display: none;
    }
}

/* Small phones: the button is its info icon alone, padded to a 44×44px touch target. The
   negative margins keep the bar as flat as the text line; the target reaches 5px into the bar's
   own padding above and 21px into the content below, never into the navigation. */
@media (max-width: 479px) {
    .cashback-bar__more {
        margin: -5px -9px -21px;
        padding: 5px 13px 21px;
    }

    .cashback-bar__more-label {
        display: none;
    }

    .cashback-bar__more .cashback-info-icon {
        width: 18px;
        height: 18px;
    }

    /* The focus ring hugs the icon, not the padded touch target. */
    .cashback-bar__more:focus-visible {
        outline: 0;
    }

    .cashback-bar__more:focus-visible .cashback-info-icon {
        outline: 2px solid #2c5d56;
        outline-offset: 3px;
        border-radius: 50%;
    }
}

@media (max-width: 359px) {
    .cashback-bar__tail--compact {
        display: none;
    }

    .cashback-bar__tail--short {
        display: inline;
    }
}

/* Rules dialog: native <dialog>, opened with showModal() by /js/cashback-voucher-hint.js. The
   same calm palette as the bar: a white panel with a hairline border (#cfe3dc) and a soft green
   shadow, the head on the bar's ground (#e9f3f0, text #1f3f3b), icons in the bar's stroke style,
   the lead on the savings green (#e3f4ea / #17613a), the close and confirm buttons in the
   accent green (#2c5d56). No gradients, no motion. */
.cashback-bar__dialog {
    width: min(440px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: 1px solid #cfe3dc;
    border-radius: 12px;
    background: #fff;
    color: #1f3f3b;
    box-shadow: 0 12px 32px rgba(31, 63, 59, 0.18);
    overflow: hidden;
}

.cashback-bar__dialog::backdrop {
    background: rgba(31, 63, 59, 0.45);
}

.cashback-bar__dialog-panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 34px);
}

.cashback-bar__dialog-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 18px;
    border-bottom: 1px solid #cfe3dc;
    background: #e9f3f0;
    color: #1f3f3b;
}

.cashback-bar__dialog-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1px solid #cfe3dc;
    border-radius: 50%;
    background: #fff;
    color: #2c5d56;
}

.cashback-bar__dialog-icon svg {
    width: 20px;
    height: 20px;
}

.cashback-bar__dialog-title {
    flex: 1 1 auto;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.cashback-bar__dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #cfe3dc;
    border-radius: 50%;
    background: #fff;
    color: #2c5d56;
    cursor: pointer;
}

.cashback-bar__dialog-close:hover {
    border-color: #2c5d56;
}

.cashback-bar__dialog-close svg {
    width: 16px;
    height: 16px;
}

.cashback-bar__dialog-body {
    padding: 16px 18px 4px;
    overflow-y: auto;
    color: #1f3f3b;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
}

.cashback-bar__dialog-lead {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #cfe3dc;
    border-radius: 8px;
    background: #e3f4ea;
    color: #17613a;
}

.cashback-bar__dialog-lead strong {
    color: #17613a;
    font-weight: 700;
}

.cashback-bar__rules-list {
    margin: 0;
    padding-left: 20px;
}

.cashback-bar__rules-list li {
    margin-bottom: 8px;
}

.cashback-bar__rules-list li::marker {
    color: #2c5d56;
}

.cashback-bar__dialog-foot {
    padding: 12px 18px 16px;
    border-top: 1px solid #e3e8e6;
    text-align: right;
}

.cashback-bar__dialog-confirm {
    padding: 10px 24px;
    border: 1px solid #2c5d56;
    border-radius: 999px;
    background: #2c5d56;
    color: #ffffff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
}

.cashback-bar__dialog-confirm:hover {
    border-color: #1f3f3b;
    background: #1f3f3b;
}

.cashback-bar__dialog-close:focus-visible,
.cashback-bar__dialog-confirm:focus-visible {
    outline: 2px solid #2c5d56;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .cashback-bar__dialog {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }

    .cashback-bar__dialog-panel {
        max-height: calc(100vh - 26px);
    }

    .cashback-bar__dialog-head {
        padding: 12px 10px 12px 14px;
    }

    .cashback-bar__dialog-title {
        font-size: 16px;
    }

    .cashback-bar__dialog-body {
        padding: 14px 14px 2px;
        font-size: 14px;
    }

    .cashback-bar__dialog-foot {
        padding: 10px 14px 14px;
    }
}
