/* ==========================================================================
   overrides.css — Yii2 / Bootstrap 4 integration overrides for the new design.
   Loaded last in NewDesignAsset so these rules always win over Bootstrap and
   the new design's own CSS where the two systems meet.
   ========================================================================== */

/* ── Bootstrap Modal — new design skin ──────────────────────────────────────
   Re-skins #custom-modal (Bootstrap 4) to match the .acct-modal-dialog look
   from account.css: rounded card, soft shadow, ink backdrop with blur.
   Tokens copied directly from .acct-modal since the modal lives outside
   #atlas-root and therefore outside the CSS-custom-property scope.
   ========================================================================== */

/* ── CSS custom-property tokens for #custom-modal ───────────────────────────
   The modal sits outside #atlas-root/.theme-atlas so all --acct-* and
   theme tokens are undefined inside it. Mirror them here so account.css
   classes (acct-btn-ink, flow-input, acct-card, etc.) work correctly.
   ========================================================================== */
#custom-modal {
    --acct-bg: #F6F7F5;
    --acct-surface: #FFFFFF;
    --acct-surface-2: #FAFAF8;
    --acct-ink: #16181A;
    --acct-ink-soft: #44474B;
    --acct-ink-muted: #6B6F73;
    --acct-line: rgba(16, 24, 26, 0.09);
    --acct-line-2: rgba(16, 24, 26, 0.14);
    --acct-green: #B4D465;
    --acct-green-deep: #6E9A2E;
    --acct-green-text: #496A1B;
    --acct-green-tint: #EEF6DD;
    --acct-blue: #4EA9D8;
    --acct-blue-deep: #2A7BAE;
    --acct-blue-text: #1C6491;
    --acct-blue-tint: #E4F1F9;
    --acct-amber: #C98A2B;
    --acct-amber-text: #8A5A12;
    --acct-amber-tint: #FBF1DE;
    --acct-radius: 16px;
    --acct-shadow: 0 1px 2px rgba(16, 24, 26, 0.04), 0 12px 30px -18px rgba(16, 24, 26, 0.20);
}


/* ── Modal size helpers ─────────────────────────────────────────────────────
   Use these classes on .modal-dialog to control width.
   ========================================================================== */
#custom-modal.modal-login .modal-dialog {
    max-width: 452px !important;
}

#custom-modal.modal-activation .modal-dialog {
    max-width: 550px !important;
}

/* login / sign-in form      */
.modal-narrow {
    max-width: 380px !important;
}

/* compact confirmations      */
.modal-wide {
    max-width: 720px !important;
}

/* activation / report-found  */
@media (max-width: 576px) {

    #custom-modal.modal-login .modal-dialog,
    #custom-modal.modal-activation .modal-dialog,
    .modal-narrow,
    .modal-wide {
        max-width: calc(100% - 24px) !important;
    }
}

/* Backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    background: rgba(16, 18, 20, 1);
    z-index: 1500;
}

.modal-backdrop.show {
    opacity: 0.42;
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
}

/* Raise #custom-modal above the raised backdrop */
#custom-modal {
    z-index: 1600;
}

/* When modal is open, push the fixed header below the backdrop so the
   overlay covers the full page (including the navbar). */
body.modal-open header[data-header] {
    z-index: 0 !important;
}

/* Dialog shell */
#custom-modal .modal-content {
    border: none;
    border-radius: 22px;
    box-shadow: 0 1px 2px rgba(16, 24, 26, 0.06), 0 40px 90px -28px rgba(16, 24, 26, 0.55);
    background: #F6F7F5;
    pointer-events: auto;
    overflow: hidden;
    position: relative;
}

/* Header — hide border when title is empty; always position-relative so the
   absolute close button is anchored to the content card. */
#custom-modal .modal-header {
    background: #F6F7F5;
    border-bottom: none;
    padding: 0;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Hide the empty title element entirely */
#custom-modal .modal-title:empty,
#custom-modal .modal-header .modal-title {
    display: none;
}

/* Title — only shows if content is set (non-empty) */
#custom-modal .modal-header:has(.modal-title:not(:empty)) {
    position: relative;
    top: auto;
    right: auto;
    padding: 14px 18px 12px;
    border-bottom: 1px solid rgba(16, 24, 26, 0.09);
    justify-content: space-between;
}

#custom-modal .modal-header:has(.modal-title:not(:empty)) .modal-title {
    display: block;
    font-family: "Inter Display", Inter, system-ui, sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.015em;
    color: #16181A;
}

/* Body */
#custom-modal .modal-body {
    background: #F6F7F5;
    padding: 0;
}

/* Footer */
#custom-modal .modal-footer {
    background: #F6F7F5;
    border-top: 1px solid rgba(16, 24, 26, 0.09);
    padding: 12px 18px;
}

/* Close button — circular pill anchored top-right of the content card */
#custom-modal .close {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 999px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    color: #44474B;
    border: 0;
    box-shadow: 0 0 0 1px rgba(16, 24, 26, 0.12);
    opacity: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    /* Neutralise now-ui-kit.css's three conflicting rules:
       (1) .modal-content .modal-header button { position:absolute; right:27px; top:30px }
       (2) .modal .modal-header .close { color:#FF3636 }
       (3) @media .modal .modal-dialog .modal-header button.close { right:12px; top:10px }
       All three are defeated by the !important flags below. */
    position: relative !important;
    top: 0 !important;
    right: 0 !important;
    color: #44474B !important;
    z-index: 10;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    float: none;
    margin: 0;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    text-shadow: none;
    -webkit-appearance: none;
}

#custom-modal .close:hover {
    background: #ffffff;
    color: #16181A;
    transform: rotate(90deg);
}

#custom-modal .close:focus {
    outline: 2px solid #4EA9D8;
    outline-offset: 2px;
}

/* ── Global toast — hidden (opacity:0) but Bootstrap renders it display:block by
   default, which blocks clicks in the top-right corner. Only receive pointer
   events once Bootstrap adds .show (opacity:1, fully visible). ── */
#rm-success-toast:not(.show) {
    pointer-events: none;
}

/* ── Account dashboard: push content below the fixed site header ────────── */
main[data-acct-page-root] {
    padding-top: clamp(66px, 5.8vh, 88px);
}

/* Background gradient for the dashboard canvas (replicates the #atlas-root
   :has() rule from account.css — needed here because the layout <main> is not
   a direct child of #atlas-root when rendered through Yii2). */
#atlas-root.acct-app {
    background:
        radial-gradient(150% 120% at 50% -25%, #ECEEF1 0%, #E3E6EB 52%, #D9DDE4 100%);
    background-attachment: fixed;
}

/* ── Banner ads slider ────────────────────────────────────────────────────
   Auto-rotating carousel for promotional banners with dots, nav buttons, and
   automatic rotation every 6.5 seconds (paused on hover). */

.acct-ov2-promo {
    position: relative;
    overflow: hidden;
    background: var(--acct-surface, white);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 26, 0.04);
    min-height: 200px;
    flex: 1;
}

.acct-promo-track {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
}

.acct-promo-slide {
    flex: 0 0 100%;
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--acct-surface, white);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    height: 100%;
    position: relative;
}

.acct-promo-compose {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

.acct-promo-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.acct-promo-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.5) 100%);
}

.acct-promo-body {
    position: relative;
    z-index: 2;
    padding: 24px;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.acct-promo-sub {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: white;
    font-weight: 500;
}

.acct-promo-sub p,
.acct-promo-sub h1,
.acct-promo-sub h2,
.acct-promo-sub h3,
.acct-promo-sub h4,
.acct-promo-sub h5,
.acct-promo-sub h6,
.acct-promo-sub ul,
.acct-promo-sub ol {
    color: white;
    margin: 0;
    padding: 0;
}

.acct-promo-sub strong,
.acct-promo-sub b {
    font-weight: 600;
}

.acct-promo-img {
    display: none;
}

/* Navigation dots */
.acct-promo-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    position: relative;
    z-index: 2;
    background: var(--acct-surface, white);
}

.acct-promo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 0;
    background: rgba(16, 24, 26, 0.2);
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.acct-promo-dot:hover {
    background: rgba(16, 24, 26, 0.35);
}

.acct-promo-dot[aria-current="true"] {
    background: var(--acct-ink, #16181A);
    width: 10px;
    height: 10px;
    margin: -1px;
}

/* Previous/Next navigation buttons */
.acct-promo-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.85);
    color: var(--acct-ink, #16181A);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(16, 24, 26, 0.12);
}

.acct-promo-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.05);
}

.acct-promo-nav:active {
    transform: translateY(-50%) scale(0.98);
}

.acct-promo-nav svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.acct-promo-prev {
    left: 12px;
}

.acct-promo-next {
    right: 12px;
}

/* Checkout popup modal */
#custom-modal.modal-checkout .modal-dialog {
    max-width: 520px !important;
}

#custom-modal.modal-checkout .modal-body {
    padding: clamp(18px, 4vw, 28px) clamp(18px, 4vw, 28px) clamp(22px, 4vw, 32px);
}

#custom-modal.modal-checkout .modal-header {
    /* Bring back into normal flow so the × button doesn't overlap the plan cards */
    position: relative !important;
    top: auto !important;
    right: auto !important;
    padding: 10px 14px 0;
    border-bottom: none;
    background: #F6F7F5;
    border-radius: inherit;
    display: flex;
    justify-content: flex-end;
}

/* With the header in-flow, reduce the body top padding — header already provides gap */
#custom-modal.modal-checkout .modal-body {
    padding-top: 8px !important;
}

/* Inject design-system tokens into the Bootstrap modal so acct-upg* classes work */
#custom-modal .modal-content {
    --acct-bg: #F6F7F5;
    --acct-surface: #FFFFFF;
    --acct-surface-2: #FAFAF8;
    --acct-ink: #16181A;
    --acct-ink-soft: #44474B;
    --acct-ink-muted: #6B6F73;
    --acct-line: rgba(16, 24, 26, 0.09);
    --acct-line-2: rgba(16, 24, 26, 0.14);
    --acct-green: #B4D465;
    --acct-green-deep: #6E9A2E;
    --acct-green-text: #496A1B;
    --acct-green-tint: #EEF6DD;
    --acct-blue: #4EA9D8;
    --acct-blue-deep: #2A7BAE;
    --acct-blue-text: #1C6491;
    --acct-blue-tint: #E4F1F9;
    --acct-amber: #C98A2B;
    --acct-amber-text: #8A5A12;
    --acct-amber-tint: #FBF1DE;
    font-family: "Inter Display", Inter, system-ui, sans-serif;
}

@media (max-width: 576px) {
    #custom-modal.modal-checkout .modal-dialog {
        max-width: calc(100% - 24px) !important;
    }
}

/* ── Header row — 3-col grid: logo | nav | controls ── */
@media (min-width: 1024px) {
    .nav-header-row {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr;
        column-gap: clamp(16px, 2vw, 40px);
        align-items: center;
    }

    /* Col 1 — logo, left-aligned */
    .nav-header-row>div:first-child {
        grid-column: 1;
        justify-self: start;
    }

    /* Col 2 — center nav, genuinely centered in its auto column */
    .nav-header-row>nav[data-mega-nav] {
        position: static !important;
        transform: none !important;
        left: auto !important;
        grid-column: 2;
        justify-self: center;
    }

    /* Col 3 — right controls, right-aligned */
    .nav-header-row>div:last-child {
        grid-column: 3;
        justify-self: end;
    }
}

/* ── Hide gtranslate float widget globally ── */
.gt-float-switcher {
    display: none !important;
}

/* ── Custom language switcher (lang-switcher.js) ────────────────────────── */
.rm-lang-wrapper {
    position: relative;
    font-family: 'Switzer', Inter, system-ui, sans-serif;
}

/* Pill trigger button */
.rm-lang-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    padding: clamp(6px, 0.4vw, 8px) 11px clamp(6px, 0.4vw, 8px) 10px;
    min-width: 120px;
    /* prevents resize when switching languages */
    border-radius: 999px;
    border: 1.5px solid rgba(16, 24, 26, 0.16);
    background: #fff;
    color: #16181A;
    font-size: clamp(13px, 0.78vw, 15px);
    font-weight: 500;
    font-family: inherit;
    letter-spacing: -0.005em;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(16, 24, 26, 0.08);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    line-height: 1.5;
    user-select: none;
}

.rm-lang-trigger:hover,
.rm-lang-wrapper.rm-lang-open .rm-lang-trigger {
    border-color: rgba(16, 24, 26, 0.28);
    box-shadow: 0 2px 10px rgba(16, 24, 26, 0.11);
    background: #fafafa;
}

.rm-lang-flag {
    border-radius: 3px;
    display: block;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.rm-lang-chevron {
    flex-shrink: 0;
    color: rgba(16, 24, 26, 0.4);
    transition: transform 0.2s ease;
    margin-left: 1px;
}

.rm-lang-wrapper.rm-lang-open .rm-lang-chevron {
    transform: rotate(180deg);
}

/* Dropdown panel — invisible + shifted by default, animates in */
.rm-lang-dropdown {
    position: absolute;
    right: 0;
    /* right-align: grows leftward, never overflows right edge */
    left: auto;
    min-width: 158px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(16, 24, 26, 0.09);
    box-shadow: 0 12px 36px -8px rgba(16, 24, 26, 0.2), 0 0 0 1px rgba(16, 24, 26, 0.05);
    padding: 5px;
    z-index: 9999;
    /* hidden state */
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.18s ease;
    /* default: opens downward */
    top: calc(100% + 8px);
}

/* when direction is up */
.rm-lang-wrapper[data-dir="up"] .rm-lang-dropdown {
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateY(-6px) scale(0.97);
    transform-origin: bottom right;
}

/* open state */
.rm-lang-wrapper.rm-lang-open .rm-lang-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Dropdown items */
.rm-lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    border-radius: 9px;
    color: #16181A;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.1s;
    cursor: pointer;
    line-height: 1.2;
}

.rm-lang-option:hover {
    background: rgba(16, 24, 26, 0.06);
    text-decoration: none;
    color: #16181A;
}

.rm-lang-option.rm-lang-current {
    background: rgba(16, 24, 26, 0.05);
    font-weight: 600;
}

.rm-lang-option .rm-lang-flag {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* ── Nav Activate CTA — hidden until hero scrolls away ── */
[data-cta-activate] {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.88) translateY(4px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    visibility: hidden;
}

[data-cta-activate].is-in {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
    visibility: visible;
}

[data-cta-activate].is-out {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.88) translateY(4px);
    visibility: hidden;
}

/* Mobile sheet — full-width, dropdown opens downward */
@media (max-width: 1023px) {
    .rm-lang-wrapper {
        width: 100%;
    }

    .rm-lang-trigger {
        width: 100%;
        justify-content: flex-start;
        padding: 10px 14px;
        font-size: 14.5px;
        border-radius: 10px;
    }

    .rm-lang-dropdown {
        top: calc(100% + 6px);
        bottom: auto;
        width: 100%;
        min-width: 0;
        border-radius: 10px;
        transform-origin: top left;
    }

    .rm-lang-wrapper[data-dir="up"] .rm-lang-dropdown {
        top: auto;
        bottom: calc(100% + 6px);
        transform-origin: bottom left;
    }
}

/* Membership comparison table — allow text to wrap (important for translated languages) */
.acct-memrow-name {
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: break-word;
}

.acct-memcell-val {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}