/*
 * Ebook sales landing — self-contained .eb-* component styles.
 * Relies on brand CSS variables (--wf-primary, --wf-dark, --wf-muted, …)
 * declared inline in layouts/marketing.blade.php.
 */

:root {
    /* Book palette: dark indigo pages + gold gradient accents (matches ebook.html) */
    --eb-violet: #5b4fc7;
    --eb-honey: #e9bd6e;
    --eb-honey-deep: #d99a2b;
    --eb-dark: #12102a;
    /* Gold headline gradient — same as the book's .hl accent */
    --eb-grad: linear-gradient(100deg, var(--eb-honey) 0%, var(--eb-honey-deep) 100%);
}

.eb-wrap {
    max-width: 1080px;
    margin: 0 auto;
}

/* Brand headline font (body inherits Inter from the marketing layout). */
.eb-h1,
.eb-h2,
.eb-cover-title,
.eb-price-now,
.eb-final h2 {
    font-family: 'Funnel Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Hero ---------- */
.eb-hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
    align-items: center;
    padding: 1rem 0 3.5rem;
}

.eb-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--wf-primary);
    margin-bottom: 1rem;
}

.eb-kicker::before {
    content: "";
    width: 22px;
    height: 2px;
    background: var(--wf-primary);
    border-radius: 2px;
}

.eb-h1 {
    font-size: clamp(2rem, 4.5vw, 3.1rem);
    line-height: 1.1;
    font-weight: 800;
    color: var(--wf-navy);
    margin-bottom: 1.1rem;
    letter-spacing: -0.02em;
}

.eb-h1 span {
    background: var(--eb-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.eb-lede {
    font-size: 1.15rem;
    color: var(--wf-muted);
    margin-bottom: 1.75rem;
    max-width: 36ch;
}

.eb-hero-points {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.eb-hero-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: var(--wf-dark);
    font-weight: 500;
}

.eb-check {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--wf-primary-soft);
    color: var(--wf-primary);
    display: grid;
    place-items: center;
}

/* ---------- Buy box ---------- */
.eb-buybox {
    background: #fff;
    border: 1px solid var(--wf-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 24px 60px -28px rgba(31, 27, 46, 0.35);
}

/* Replika skutečné obálky knihy: tmavé indigo + fialová a medová záře */
.eb-cover {
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    background:
        radial-gradient(120% 90% at 88% 95%, rgba(217, 154, 43, 0.18), transparent 62%),
        radial-gradient(130% 100% at 8% 5%, rgba(91, 79, 199, 0.42), transparent 62%),
        var(--eb-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    padding: 1.3rem 1.2rem;
    margin-bottom: 1.5rem;
}

.eb-cover-tag {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.65;
}

.eb-cover-mid {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.eb-cover-kicker {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.7;
}

.eb-cover-title {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.12;
    margin: 0.5rem 0 0.45rem;
}

.eb-cover-title em {
    font-style: normal;
    background: var(--eb-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.eb-cover-sub {
    font-size: 0.78rem;
    opacity: 0.85;
    max-width: 26ch;
}

/* Obálková ilustrace je na černém pozadí — screen blend ji vklíčuje do tmavé karty */
.eb-cover-art {
    width: 66%;
    max-width: 220px;
    display: block;
    margin: 0.7rem auto 0;
    mix-blend-mode: screen;
}

.eb-cover-foot {
    font-size: 0.7rem;
    opacity: 0.6;
}

.eb-price {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    margin-bottom: 0.35rem;
}

.eb-price-now {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--wf-navy);
    letter-spacing: -0.02em;
}

.eb-price-was {
    font-size: 1.25rem;
    color: var(--wf-muted);
    text-decoration: line-through;
}

.eb-save {
    display: inline-block;
    background: #f6e8c8;
    color: #8a6210;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.eb-vat-note {
    font-size: 0.8rem;
    color: var(--wf-muted);
    margin: -0.5rem 0 1.25rem;
}

.eb-roi-note {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--eb-honey-deep);
    margin: 0.1rem 0 0.5rem;
}

.eb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    border: none;
    cursor: pointer;
    background: var(--wf-primary);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.eb-btn:hover { background: var(--wf-primary-dark); transform: translateY(-1px); text-decoration: none; }

.eb-buybox-meta {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--wf-muted);
}

.eb-buybox-meta li { display: flex; align-items: center; gap: 0.5rem; }

.eb-error {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Free-sample block inside the buy box */
.eb-sample { margin-top: 1.25rem; }

.eb-sample-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--wf-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}

.eb-sample-divider::before,
.eb-sample-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--wf-border);
}

.eb-sample-lead {
    font-weight: 600;
    color: var(--wf-dark);
    margin-bottom: 0.6rem;
}

.eb-sample .eb-sample-btn { width: 100%; }

.eb-sample-row { display: flex; gap: 0.5rem; }
.eb-sample-row .eb-input { flex: 1; }

@media (max-width: 420px) {
    .eb-sample-row { flex-direction: column; }
}

.eb-btn-ghost {
    width: auto;
    white-space: nowrap;
    background: transparent;
    color: var(--eb-violet);
    border: 1.5px solid var(--eb-violet);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
}

.eb-btn-ghost:hover { background: var(--eb-violet); color: #fff; }

.eb-sample-consent {
    font-size: 0.78rem;
    color: var(--wf-muted);
    margin-top: 0.6rem;
    line-height: 1.5;
}

.eb-sample-consent a { text-decoration: underline; }

/* ---------- Sections ---------- */
.eb-section { padding: 3.5rem 0; }
.eb-section + .eb-section { border-top: 1px solid var(--wf-border); }

.eb-h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--wf-navy);
    margin-bottom: 0.6rem;
    letter-spacing: -0.01em;
}

.eb-dek {
    color: var(--wf-muted);
    font-size: 1.05rem;
    max-width: 60ch;
    margin-bottom: 2rem;
}

.eb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.eb-card {
    background: #fff;
    border: 1px solid var(--wf-border);
    border-radius: 16px;
    padding: 1.5rem;
}

.eb-card h3 {
    font-size: 1.1rem;
    color: var(--wf-navy);
    margin-bottom: 0.4rem;
}

.eb-card p { color: var(--wf-muted); font-size: 0.95rem; }

/* Table of contents */
.eb-toc {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.75rem 2rem;
    counter-reset: toc;
}

.eb-toc li {
    display: flex;
    gap: 0.85rem;
    align-items: baseline;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--wf-border);
    counter-increment: toc;
}

.eb-toc li::before {
    content: counter(toc, decimal-leading-zero);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--wf-primary);
    font-weight: 600;
}

.eb-toc strong { color: var(--wf-dark); font-weight: 600; }

/* FAQ */
.eb-faq { display: grid; gap: 0.75rem; max-width: 760px; }

.eb-faq details {
    background: #fff;
    border: 1px solid var(--wf-border);
    border-radius: 12px;
    padding: 0 1.25rem;
}

.eb-faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--wf-navy);
    padding: 1.1rem 0;
    list-style: none;
}

.eb-faq summary::-webkit-details-marker { display: none; }

.eb-faq details[open] summary { color: var(--wf-primary); }

.eb-faq p { color: var(--wf-muted); padding: 0 0 1.1rem; margin: 0; }

/* Final CTA */
.eb-final {
    text-align: center;
    /* Stejná tmavá plocha jako obálka a předěly knihy */
    background:
        radial-gradient(640px 420px at 88% 92%, rgba(217, 154, 43, 0.16), transparent 62%),
        radial-gradient(760px 520px at 8% 6%, rgba(91, 79, 199, 0.38), transparent 62%),
        var(--eb-dark);
    color: #fff;
    border-radius: 24px;
    padding: 3rem 2rem;
}

/* Secondary sample CTA on the dark final block (opens the modal).
   Matched to the primary buy button's size so the two stack evenly. */
.eb-final-sample {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.9rem;
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 1rem 2.5rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.eb-final-sample:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.75); }

/* Equal width for both final-block CTAs regardless of label length. */
.eb-final .eb-btn,
.eb-final-sample { min-width: 280px; justify-content: center; }

.eb-final h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 0.75rem; }
.eb-final p { color: rgba(255, 255, 255, 0.8); margin-bottom: 1.75rem; }
.eb-final .eb-btn { width: auto; padding: 1rem 2.5rem; }

/* ---------- Thank you ---------- */
.eb-thanks {
    max-width: 640px;
    margin: 2rem auto;
    text-align: center;
    background: #fff;
    border: 1px solid var(--wf-border);
    border-radius: 20px;
    padding: 3rem 2rem;
}

.eb-thanks-badge {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: #d1fae5;
    color: #047857;
    display: grid;
    place-items: center;
}

/* ---------- Review form ---------- */
.eb-review-card {
    max-width: 600px;
    margin: 2rem auto;
    background: #fff;
    border: 1px solid var(--wf-border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
}

.eb-review-form { display: flex; flex-direction: column; }

.eb-field-label {
    font-weight: 600;
    color: var(--wf-dark);
    margin: 1.25rem 0 0.5rem;
}

.eb-input {
    width: 100%;
    border: 1px solid var(--wf-border);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--wf-dark);
    background: var(--wf-bg-soft);
}

.eb-input:focus {
    outline: none;
    border-color: var(--wf-primary);
    background: #fff;
}

.eb-field-error { color: #b91c1c; font-size: 0.85rem; margin-top: 0.35rem; }

/* CSS-only star rating: radios reversed (5→1) in DOM, displayed row-reverse */
.eb-stars {
    position: relative;
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.2rem;
}

.eb-stars input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.eb-stars label { color: #d1d5db; cursor: pointer; line-height: 1; transition: color 0.1s ease; }

.eb-stars label:hover,
.eb-stars label:hover ~ label,
.eb-stars input:checked ~ label { color: #d99a2b; }

.eb-stars input:focus-visible + label { outline: 2px solid var(--wf-primary); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 860px) {
    .eb-hero { grid-template-columns: 1fr; gap: 2rem; }
    .eb-buybox { order: -1; }
}

/* ---------- Reviews ---------- */
.eb-reviews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

.eb-review {
    margin: 0;
    padding: 1.5rem 1.6rem;
    background: #ffffff;
    border: 1px solid var(--wf-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.eb-review-stars {
    color: var(--eb-honey-deep);
    font-size: 1.05rem;
    letter-spacing: 2px;
    line-height: 1;
}

.eb-review-stars-off { color: #d1d5db; }

.eb-review blockquote {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--wf-dark);
    flex: 1;
}

.eb-review figcaption {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.88rem;
}

.eb-review figcaption strong { color: var(--wf-navy); }
.eb-review figcaption time { color: var(--wf-muted); font-size: 0.82rem; }

/* ---------- Mobile sticky buy bar ----------
   Practices what the book preaches: the buy CTA stays within thumb reach
   while scrolling. JS hides it whenever an in-page CTA (buybox or final
   section) is on screen, so two buy buttons are never visible at once. */
.eb-sticky { display: none; }

@media (max-width: 860px) {
    .eb-sticky {
        display: flex;
        gap: 0.5rem;
        align-items: stretch;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        margin: 0;
        padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.94);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        border-top: 1px solid rgba(18, 16, 42, 0.08);
        box-shadow: 0 -10px 30px rgba(18, 16, 42, 0.08);
        transform: translateY(110%);
        transition: transform 0.28s ease;
    }
    .eb-sticky.eb-sticky--visible { transform: translateY(0); }
    .eb-sticky__buy { flex: 1 1 auto; display: flex; }
    .eb-sticky__buy .eb-btn { width: 100%; justify-content: center; }
    .eb-sticky__sample { flex: 0 0 auto; white-space: nowrap; padding-left: 1.1rem; padding-right: 1.1rem; }
}

/* ---------- Promo-code note ---------- */
.eb-promo-note {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--wf-muted);
    margin-top: 0.75rem;
}

/* ---------- Free-sample modal ---------- */
body.eb-modal-lock { overflow: hidden; }

.eb-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 15, 18, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

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

.eb-modal__card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 20px;
    padding: 2.4rem 1.75rem 1.75rem;
    box-shadow: 0 30px 80px -20px rgba(31, 27, 46, 0.5);
    text-align: center;
    animation: eb-modal-in 0.24s ease;
}

@keyframes eb-modal-in {
    from { transform: translateY(14px) scale(0.98); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.eb-modal__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 34px;
    height: 34px;
    border: none;
    background: var(--wf-bg-soft);
    color: var(--wf-muted);
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.eb-modal__close:hover { background: #eceaf6; color: var(--wf-dark); }

.eb-modal__badge {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--wf-primary-soft);
    color: var(--wf-primary);
    display: grid;
    place-items: center;
}

.eb-modal__card h3 {
    font-family: 'Funnel Display', 'Inter', sans-serif;
    font-size: 1.5rem;
    color: var(--wf-navy);
    margin-bottom: 0.5rem;
}

.eb-modal__card > p { color: var(--wf-muted); margin-bottom: 1.25rem; }
.eb-modal__card .eb-sample-consent { text-align: center; }

/* Stack the field + button so the input isn't squished by the full-width CTA. */
.eb-modal__card .eb-sample-row { flex-direction: column; gap: 0.6rem; }
.eb-modal__card .eb-sample-row .eb-input,
.eb-modal__card .eb-sample-row .eb-btn { width: 100%; }
.eb-modal__card .eb-sample-row .eb-input { text-align: center; }

/* ---------- Desktop float reopen button ---------- */
.eb-float {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 120;
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: var(--eb-violet);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.8rem 1.3rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 12px 30px -8px rgba(91, 79, 199, 0.6);
    transition: background 0.15s ease, transform 0.15s ease;
}

.eb-float.is-visible { display: inline-flex; }
.eb-float:hover { background: var(--wf-primary-dark); transform: translateY(-1px); }

/* On mobile the sticky Ukázka button covers this — avoid two reopen controls. */
@media (max-width: 860px) {
    .eb-float { display: none !important; }
}
