/* טופס הזמנת הרצאה – עמוד "הרצאות לארגונים" בלבד (נטען רק מ-lectures.html).
   בשפת "עולם הספר": קלף, דיו, חמרה; הטוקנים (--bw-*) מוגדרים ב-style.css. */

/* .btn ושאר הכללים באתר קובעים display, ולכן hidden צריך לגבור במפורש */
.booking-section [hidden] {
    display: none !important;
}

.bk-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- כפתור בראש העמוד ---------- */

body.bw-page-lectures .page-header .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title art"
        "cta art";
    align-items: center;
    column-gap: 24px;
    row-gap: 26px;
}

body.bw-page-lectures .page-header .page-title {
    grid-area: title;
    align-self: end;
}

body.bw-page-lectures .page-header .container::after {
    grid-area: art;
}

body.bw-page-lectures .page-header-cta {
    grid-area: cta;
    align-self: start;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
}

body.bw-page-lectures .page-header-note {
    margin: 0;
    font-size: 15px;
    color: var(--bw-muted);
}

@media (max-width: 600px) {
    body.bw-page-lectures .page-header .container {
        grid-template-areas:
            "title art"
            "cta cta";
        row-gap: 20px;
    }

    body.bw-page-lectures .page-header-cta .btn {
        width: 100%;
    }

    body.bw-page-lectures .page-header-note {
        width: 100%;
        text-align: center;
    }
}

/* ---------- כפתור בתוך כרטיס הרצאה ---------- */

body.bw-page-lectures .bk-card-cta {
    margin: 22px 0 0;
}

body.bw-page-lectures .bk-card-cta + .lecture-detail-link {
    margin-top: 12px;
}

/* כרטיס סגור: הכפתור לא נגיש במקלדת */
body.bw-page-lectures .lecture-card:not(.active) .bk-card-cta {
    visibility: hidden;
}

@media (max-width: 600px) {
    body.bw-page-lectures .bk-card-cta .btn {
        width: 100%;
    }
}

/* ---------- הסקשן ---------- */

body.bw-site .booking-section {
    padding: 80px 0 96px;
    background-color: var(--bw-paper);
    border-top: 1px solid var(--bw-line);
    scroll-margin-top: 0;
}

.booking-head {
    max-width: 640px;
    margin: 0 auto 36px;
    text-align: center;
}

.booking-eyebrow {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--bw-accent);
}

body.bw-site .main-content .booking-title {
    margin: 0 0 16px;
    font-size: clamp(32px, 3.6vw, 46px);
    font-weight: 900;
    line-height: 1.1;
}

body.bw-site .booking-title::after {
    content: '';
    display: block;
    width: 150px;
    height: 12px;
    margin: 16px auto 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='12' viewBox='0 0 150 12'%3E%3Cline x1='0' y1='6' x2='137' y2='6' stroke='%23AB4D3D' stroke-width='1.5'/%3E%3Cpolygon points='144,1.5 148.5,6 144,10.5 139.5,6' fill='%23AB4D3D'/%3E%3C/svg%3E") no-repeat;
}

.booking-sub {
    margin: 0;
    font-size: 18px;
    line-height: 1.75;
    color: var(--bw-muted);
}

.booking-card {
    max-width: 760px;
    margin: 0 auto;
    padding: 34px 40px 30px;
    background-color: var(--bw-surface);
    border: 1px solid var(--bw-line);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(48, 44, 39, 0.1);
    scroll-margin-top: 16px;
}

.booking-alt {
    max-width: 760px;
    margin: 22px auto 0;
    font-size: 16px;
    line-height: 1.7;
    text-align: center;
    color: var(--bw-muted);
}

body.bw-site .main-content .booking-alt a {
    color: var(--bw-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- התקדמות ---------- */

.bk-progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 30px;
    padding: 0;
    list-style: none;
}

.bk-progress__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 1.3;
    text-align: center;
    color: var(--bw-muted);
}

/* קו מחבר לעיגול הבא (ב-RTL: שמאלה) */
.bk-progress__item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 17px;
    inset-inline-start: calc(50% + 22px);
    width: calc(100% + 8px - 44px);
    height: 2px;
    background-color: var(--bw-line);
}

.bk-progress__item.is-done:not(:last-child)::after {
    background-color: var(--bw-accent);
}

.bk-progress__num {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--bw-line);
    border-radius: 50%;
    background-color: #FFFDF8;
    font-size: 16px;
    font-weight: 700;
    color: var(--bw-muted);
}

.bk-progress__item.is-current .bk-progress__num {
    background-color: var(--bw-accent);
    border-color: var(--bw-accent);
    color: var(--bw-surface);
    box-shadow: 0 0 0 4px rgba(171, 77, 61, 0.15);
}

.bk-progress__item.is-done .bk-progress__num {
    background-color: var(--bw-surface);
    border-color: var(--bw-accent);
    color: transparent;
}

.bk-progress__item.is-done .bk-progress__num::after {
    content: '';
    position: absolute;
    top: 9px;
    left: 13px;
    width: 7px;
    height: 13px;
    border: solid var(--bw-accent);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.bk-progress__item.is-current .bk-progress__label {
    font-weight: 700;
    color: var(--bw-ink);
}

.booking-form:not(.is-wizard) .bk-progress,
.booking-form:not(.is-wizard) .bk-back,
.booking-form:not(.is-wizard) .bk-next {
    display: none;
}

/* ---------- שלבים ---------- */

body.bw-site .main-content .bk-step-title {
    margin: 0 0 6px;
    font-size: clamp(25px, 2.4vw, 30px);
    font-weight: 800;
    line-height: 1.2;
}

body.bw-site .main-content .bk-step-title:focus,
body.bw-site .main-content .bk-success__title:focus {
    outline: none;
}

.bk-step-hint {
    margin: 0 0 18px;
    font-size: 16px;
    color: var(--bw-muted);
}

.booking-form:not(.is-wizard) .bk-step + .bk-step {
    margin-top: 36px;
    padding-top: 30px;
    border-top: 1px solid var(--bw-line);
}

.bk-picked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 22px;
    padding: 6px 14px;
    font-size: 15.5px;
    line-height: 1.5;
    color: var(--bw-ink);
    background-color: rgba(171, 77, 61, 0.06);
    border-inline-start: 3px solid var(--bw-accent);
    border-radius: 6px;
}

.bk-picked__text {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 0;
}

.bk-link {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 6px;
    background: none;
    border: 0;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--bw-accent-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.bk-field {
    margin: 0 0 22px;
}

fieldset.bk-field {
    min-width: 0;
    padding: 0;
    border: 0;
}

.bk-label {
    display: block;
    float: none;
    width: 100%;
    margin: 0 0 9px;
    padding: 0;
    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--bw-ink);
}

.bk-optional {
    font-size: 14.5px;
    font-weight: 400;
    color: var(--bw-muted);
}

body.bw-site .booking-section .required {
    color: var(--bw-accent);
}

/* ---------- שדות טקסט ---------- */

.booking-form :is(input[type="text"], input[type="tel"], input[type="email"], input[type="date"], textarea) {
    display: block;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 12px 14px;
    background-color: #FFFDF8;
    color: var(--bw-ink);
    border: 1px solid var(--bw-line);
    border-radius: 8px;
    font-family: 'Heebo', Arial, sans-serif;
    font-size: 17px;
    line-height: 1.4;
    text-align: right;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.booking-form input[type="date"] {
    min-width: 0;
    max-width: 320px;
}

.booking-form input[type="date"]::-webkit-date-and-time-value {
    text-align: right;
}

.booking-form textarea {
    min-height: 104px;
    resize: vertical;
}

.booking-form :is(input, textarea)::placeholder {
    color: #8C8273;
    opacity: 1;
}

.booking-form :is(input[type="text"], input[type="tel"], input[type="email"], input[type="date"], textarea):focus {
    outline: none;
    border-color: var(--bw-accent);
    box-shadow: 0 0 0 3px rgba(171, 77, 61, 0.18);
}

.bk-field.has-error :is(input[type="text"], input[type="tel"], input[type="email"], input[type="date"], textarea) {
    border-color: var(--bw-accent-dark);
    background-color: #FFF7F3;
}

/* ---------- כרטיסי בחירה (שלב 1) ---------- */

.bk-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.bk-option,
.bk-chip {
    position: relative;
    display: block;
    cursor: pointer;
}

/* הרדיו האמיתי מכסה את כל הכרטיס: נגיש למקלדת ולקורא מסך, ושקוף לעין */
.bk-option input,
.bk-chip input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.bk-option__box {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    min-height: 58px;
    padding: 12px 16px;
    background-color: #FFFDF8;
    border: 1px solid var(--bw-line);
    border-radius: 10px;
    font-size: 16.5px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--bw-ink);
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.bk-option__mark {
    position: relative;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border: 1.5px solid #9A9083;
    border-radius: 50%;
    background-color: #FFFDF8;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.bk-option--extra .bk-option__box {
    background-color: transparent;
}

/* שתי האפשרויות הכלליות מתחילות שורה חדשה אחרי ההרצאות */
.bk-option:not(.bk-option--extra) + .bk-option--extra {
    grid-column-start: 1;
    margin-top: 8px;
}

.bk-option:not(.bk-option--extra) + .bk-option--extra + .bk-option--extra {
    margin-top: 8px;
}

@media (hover: hover) {
    .bk-option:hover .bk-option__box,
    .bk-chip:hover .bk-chip__box {
        border-color: #A89A86;
    }
}

.bk-option input:checked + .bk-option__box {
    background-color: rgba(171, 77, 61, 0.07);
    border-color: var(--bw-accent);
    box-shadow: inset 0 0 0 1px var(--bw-accent);
    font-weight: 600;
}

.bk-option input:checked + .bk-option__box .bk-option__mark {
    background-color: var(--bw-accent);
    border-color: var(--bw-accent);
    box-shadow: inset 0 0 0 4px #FFFDF8;
}

.bk-option input:focus-visible + .bk-option__box,
.bk-chip input:focus-visible + .bk-chip__box {
    outline: 3px solid var(--bw-accent);
    outline-offset: 2px;
}

.bk-field.has-error .bk-option__box {
    border-color: rgba(139, 59, 46, 0.55);
}

/* ---------- צ'יפים (שלב 2) ---------- */

.bk-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bk-chips--pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 440px;
}

.bk-chip {
    display: inline-flex;
}

.bk-chips--pair .bk-chip {
    display: flex;
}

.bk-chip__box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 48px;
    padding: 10px 18px;
    background-color: #FFFDF8;
    border: 1px solid var(--bw-line);
    border-radius: 999px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
    color: var(--bw-ink);
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.bk-chip input:checked + .bk-chip__box {
    background-color: rgba(171, 77, 61, 0.07);
    border-color: var(--bw-accent);
    box-shadow: inset 0 0 0 1px var(--bw-accent);
    font-weight: 600;
    color: var(--bw-accent-dark);
}

.bk-chip input:checked + .bk-chip__box::before {
    content: '';
    flex: 0 0 auto;
    width: 5px;
    height: 10px;
    margin-top: -3px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ---------- שדה מותנה ---------- */

.bk-reveal {
    padding-inline-start: 14px;
    border-inline-start: 2px solid var(--bw-line);
}

/* ---------- תיבת סימון ---------- */

.bk-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 44px;
    padding: 8px 0;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--bw-ink);
    cursor: pointer;
}

.bk-check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 2px 0 0;
    accent-color: var(--bw-accent);
    cursor: pointer;
}

body.bw-site .main-content .bk-check a {
    color: var(--bw-accent-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- שגיאות ---------- */

.bk-error {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 8px 0 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--bw-accent-dark);
}

.bk-error:empty {
    display: none;
}

.bk-error::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 50%;
    background-color: var(--bw-accent-dark);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    color: #FFFDF8;
}

.bk-alert:not(:empty) {
    margin-top: 22px;
    padding: 16px 18px;
    background-color: #FFF6F1;
    border: 1px solid rgba(139, 59, 46, 0.3);
    border-inline-start: 4px solid var(--bw-accent-dark);
    border-radius: 10px;
}

.bk-alert p {
    margin: 0 0 12px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--bw-ink);
}

.bk-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* ---------- ניווט ---------- */

.bk-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--bw-line);
}

body.bw-site .main-content .bk-nav .btn {
    min-height: 52px;
}

body.bw-site .main-content .bk-nav :is(.bk-next, .bk-submit) {
    min-width: 200px;
    margin-inline-start: auto;
}

body.bw-site .main-content .bk-nav .btn[disabled] {
    opacity: 0.75;
    cursor: progress;
}

.bk-required-note {
    margin: 14px 0 0;
    font-size: 14px;
    color: var(--bw-muted);
}

.booking-form[data-step="1"] .bk-required-note {
    display: none;
}

/* ---------- הצלחה ---------- */

.bk-success {
    padding: 20px 4px 8px;
    text-align: center;
}

.bk-success__icon {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    color: var(--bw-forest);
}

body.bw-site .main-content .bk-success__title {
    margin: 0 0 12px;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 900;
    line-height: 1.15;
}

.bk-success__text {
    max-width: 30em;
    margin: 0 auto 26px;
    font-size: 18.5px;
    line-height: 1.7;
    color: var(--bw-ink);
}

.bk-success__more {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--bw-muted);
}

/* ---------- תנועה ---------- */

@media (prefers-reduced-motion: no-preference) {
    .booking-form.is-wizard .bk-step.is-active,
    .bk-reveal.is-entering,
    .bk-success:not([hidden]) {
        animation: bk-in 0.28s ease both;
    }
}

@keyframes bk-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- מובייל ---------- */

@media (max-width: 640px) {
    .bk-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .bk-option:not(.bk-option--extra) + .bk-option--extra + .bk-option--extra {
        margin-top: 0;
    }
}

@media (max-width: 600px) {
    body.bw-site .booking-section {
        padding: 56px 0 64px;
    }

    .booking-head {
        margin-bottom: 26px;
    }

    .booking-sub {
        font-size: 17px;
    }

    .booking-card {
        padding: 22px 16px 20px;
        border-radius: 12px;
    }

    .bk-progress {
        margin-bottom: 24px;
    }

    .bk-progress__item {
        font-size: 13px;
    }

    .bk-chips--pair,
    .booking-form input[type="date"] {
        max-width: none;
    }

    .bk-chip__box {
        padding: 10px 15px;
    }

    .bk-nav {
        gap: 10px;
    }

    body.bw-site .main-content .bk-nav :is(.bk-next, .bk-submit) {
        flex: 1 1 auto;
        min-width: 0;
        padding-inline: 16px;
    }

    body.bw-site .main-content .bk-nav .bk-back {
        flex: 0 0 auto;
        padding-inline: 16px;
    }
}
