/* ═══════════════════════════════════════════════════════════
   LIMITED-TIME TRIAL OFFER
   Mirrors the .sub-modal system in Subscriptions.cshtml so the
   two dialogs read as one component family.
   ═══════════════════════════════════════════════════════════ */

body.trial-offer-open { overflow: hidden; }

.trial-offer[hidden] { display: none; }

.trial-offer {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.trial-offer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 10, 9, 0.48);
    backdrop-filter: blur(5px);
}

.trial-offer__dialog {
    position: relative;
    width: min(100%, 560px);
    max-height: min(88vh, 780px);
    overflow: auto;
    background: linear-gradient(180deg, #fffdf9 0%, #ffffff 100%);
    border: 1px solid rgba(30, 61, 47, 0.14);
    border-radius: 20px;
    padding: 1.45rem 1.45rem 1.35rem;
    box-shadow: 0 22px 60px rgba(11, 19, 16, 0.24);
}

.trial-offer__close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(30, 61, 47, 0.06);
    color: var(--font-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, transform 0.18s ease;
}

.trial-offer__close:hover {
    background: rgba(30, 61, 47, 0.12);
    transform: translateY(-1px);
}

.trial-offer__close .material-symbols-outlined { font-size: 1.05rem; }

.trial-offer__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.26rem 0.62rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
    background: rgba(184, 115, 24, 0.12);
    color: var(--blue-color);
}

.trial-offer__title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.35rem;
    line-height: 0.98;
    letter-spacing: -0.02em;
    color: var(--purple-color);
    margin: 0 0 0.5rem;
    padding-right: 2.5rem;
}

.trial-offer__lead {
    margin: 0 0 1.15rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--font-color);
    opacity: 0.76;
}

/* The countdown is the whole point of the component, so it gets the loudest treatment. */
.trial-offer__countdown {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    border-radius: 16px;
    padding: 0.85rem 1.05rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(184, 115, 24, 0.1) 0%, rgba(184, 115, 24, 0.05) 100%);
    border: 1px solid rgba(184, 115, 24, 0.22);
}

.trial-offer__countdown-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--font-color);
    opacity: 0.55;
}

.trial-offer__countdown-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1;
    color: var(--blue-color);
    font-variant-numeric: tabular-nums;
}

/* Reassurance, not a sales line: sits under the card note and stays quiet. */
.trial-offer__footnote {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--font-color);
    opacity: 0.55;
}

.trial-offer__note {
    margin: 0 0 0.55rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--font-color);
    opacity: 0.68;
}

/* Never de-emphasised: hiding the card requirement is the main cause of drop-off at Stripe. */
.trial-offer__note--card {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    opacity: 0.86;
    font-weight: 500;
}

.trial-offer__note--card .material-symbols-outlined {
    font-size: 1rem;
    margin-top: 0.14rem;
    color: var(--font-color);
    opacity: 0.6;
}

.trial-offer__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.15rem;
    flex-wrap: wrap;
}

.trial-offer__decline {
    background: none;
    border: 0;
    padding: 0.4rem 0.2rem;
    font: inherit;
    font-size: 0.86rem;
    color: var(--font-color);
    opacity: 0.6;
    cursor: pointer;
    text-decoration: underline;
}

.trial-offer__decline:hover { opacity: 0.85; }

/* ── Corner widget ──────────────────────────────────────────
   Replaces the inline bar. Follows the user across pages while a
   window is live, sits under the dialog in z-order, and can be
   sent away for the session without giving up the offer.
   ─────────────────────────────────────────────────────────── */

.trial-offer-widget[hidden] { display: none; }

.trial-offer-widget {
    position: fixed;
    right: 1.15rem;
    bottom: 1.15rem;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.2rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #fffdf9 0%, #ffffff 100%);
    border: 1px solid rgba(184, 115, 24, 0.32);
    box-shadow: 0 12px 32px rgba(11, 19, 16, 0.18);
    animation: trial-offer-widget-in 0.28s ease both;
}

@keyframes trial-offer-widget-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.trial-offer-widget__body {
    display: grid;
    gap: 0.15rem;
    justify-items: start;
    padding: 0.7rem 0.9rem;
    border: 0;
    border-radius: 12px;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.trial-offer-widget__body:hover { background: rgba(184, 115, 24, 0.08); }

.trial-offer-widget__title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--purple-color);
}

.trial-offer-widget__remaining {
    font-size: 0.8rem;
    color: var(--blue-color);
    font-variant-numeric: tabular-nums;
}

.trial-offer-widget__close {
    order: 2;
    width: 26px;
    height: 26px;
    margin: 0.35rem 0.35rem 0 0;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--font-color);
    opacity: 0.45;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.trial-offer-widget__close:hover { opacity: 0.8; background: rgba(30, 61, 47, 0.08); }

.trial-offer-widget__close .material-symbols-outlined { font-size: 0.95rem; }

body.dark-mode .trial-offer-widget {
    background: linear-gradient(180deg, #111915 0%, #0d120f 100%);
    border-color: rgba(212, 146, 28, 0.34);
}

body.dark-mode .trial-offer-widget__body:hover { background: rgba(212, 146, 28, 0.12); }

body.dark-mode .trial-offer-widget__close:hover { background: rgba(255, 255, 255, 0.1); }

@media (max-width: 480px) {
    .trial-offer-widget {
        right: 0.7rem;
        bottom: 0.7rem;
        left: 0.7rem;
    }
    .trial-offer-widget__body { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .trial-offer-widget { animation: none; }
}

/* ── Dark mode ──────────────────────────────────────────────
   Every surface above uses a hardcoded light background, so each
   one needs a pair here. (The older .sub-banner rules on the
   subscriptions page are missing theirs; that gap is not copied.)
   ─────────────────────────────────────────────────────────── */

body.dark-mode .trial-offer__dialog {
    background: linear-gradient(180deg, #111915 0%, #0d120f 100%);
    border-color: rgba(148, 220, 175, 0.12);
}

body.dark-mode .trial-offer__close {
    background: rgba(255, 255, 255, 0.06);
    color: var(--font-color);
}

body.dark-mode .trial-offer__close:hover { background: rgba(255, 255, 255, 0.12); }

body.dark-mode .trial-offer__countdown {
    background: rgba(212, 146, 28, 0.12);
    border-color: rgba(212, 146, 28, 0.28);
}

body.dark-mode .trial-offer__eyebrow {
    background: rgba(212, 146, 28, 0.16);
    color: var(--blue-color);
}


/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 720px) {
    .trial-offer__dialog { padding: 1.1rem 1rem 1rem; }
    .trial-offer__title { font-size: 2rem; }
}

@media (max-width: 480px) {
    .trial-offer { padding: 0.85rem; }
    .trial-offer__actions { flex-direction: column-reverse; align-items: stretch; }
    .trial-offer__actions .btn { width: 100%; }
    .trial-offer__decline { width: 100%; text-align: center; }
}
