/* ==========================================================================
   Registreren — order/registration page (v2.1)
   ========================================================================== */

/* --- Fix 1: Page columns proportions --- */
.kpreg-hero {
    max-width: 1440px;
    margin: 60px auto;
    padding: 0 80px;
    box-sizing: border-box;
}

.kpreg-hero__inner {
    display: flex;
    gap: 75px;
    align-items: flex-start;
    position: relative;
}

/* --- Fix 1: Orange promo block (left 60%) --- */
.kpreg-promo {
    flex: 0 0 60%;
    max-width: 60%;
    box-sizing: border-box;
    background: var(--color-primary);
    border-radius: 20px;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    margin-top: 90px;
}

/* Top row: heading left + price badge right */
.kpreg-promo__top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 40px 12px 24px 40px;
}

.kpreg-promo__top-text {
    flex: 1;
    min-width: 0;
}

.kpreg-promo__small {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 400;
    color: var(--color-white);
    margin: 0 0 8px;
}

.kpreg-promo__heading {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 400;
    color: var(--color-white);
    margin: 0;
    line-height: 1.2;
}

.kpreg-promo__strikethrough {
    text-decoration: line-through;
}

/* Price badge */
.kpreg-promo__price {
    flex-shrink: 0;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--color-white);
    border: 8px solid var(--color-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    margin-right: -50px;
    position: relative;
    z-index: 5;
}

.kpreg-promo__price-old {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
    line-height: 1;
}

.kpreg-promo__price-new {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 400;
    color: var(--color-text);
    line-height: 1;
    margin-top: 4px;
}

/* --- Fix 2: Bookshelf — 6 books, correct size, shelf line --- */
.kpreg-promo .kph-bookshelf {
    margin: 24px 0 0;
    overflow: visible;
}

.kpreg-promo .kph-bookshelf__books {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    position: relative;
    padding: 0 24px 14px 0;
    margin-left: -20px;
}

.kpreg-promo .kph-bookshelf__books img {
    height: auto !important;
    width: auto !important;
    max-height: 160px !important;
    max-width: 120px !important;
    flex-shrink: 1;
}

.kpreg-promo .kph-bookshelf__books img:nth-child(n+7) {
    display: none;
}

.kpreg-promo .kph-bookshelf__edge {
    display: none;
}

.kpreg-promo .kph-bookshelf__books::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -20px;
    right: 0;
    height: 14px;
    background: #5C3D2E;
    border-radius: 4px 0 0 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.kpreg-promo .kph-bookshelf__books::before {
    content: '';
    position: absolute;
    bottom: -28px;
    right: -40px;
    width: 0;
    height: 0;
    border-top: 35px solid transparent;
    border-bottom: 35px solid transparent;
    border-left: 40px solid #5C3D2E;
    z-index: 10;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* --- Bottom text line --- */
.kpreg-promo__bottom-bar {
    padding: 16px 24px 16px 40px;
    margin-top: 16px;
}

.kpreg-promo__bottom {
    font-family: var(--font-heading);
    font-size: 22px;
    font-style: normal;
    color: var(--color-white);
    margin: 0;
    text-align: right;
    line-height: 32px;
}

/* --- Characters (decorative top-right) --- */
.kpreg-characters {
    position: absolute;
    top: -20px;
    right: 0;
    display: flex;
    gap: 6px;
    z-index: 4;
    pointer-events: none;
}

.kpreg-characters img {
    width: 80px;
    height: auto;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.15));
}

/* --- Fix 1+6: Form column (right ~40%) --- */
.kpreg-form-col {
    flex: 0 0 calc(40% - 40px);
    max-width: calc(40% - 40px);
    box-sizing: border-box;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
    padding: 0 0 24px;
    position: relative;
    margin-top: 10px;
}

.kpreg-form-col::before {
    content: '';
    position: absolute;
    top: 30px;
    left: -48px;
    right: -48px;
    bottom: 0;
    background: var(--color-white);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    z-index: 0;
}

.kpreg-form-col > * {
    position: relative;
    z-index: 1;
}

/* --- Form header books: overlapping, sitting on brown shape --- */
.kpreg-form-header-books {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: -55px;
    margin-bottom: 0;
    padding: 0 16px;
    position: relative;
    z-index: 2;
}

.kpreg-form-header-books img {
    height: 100px !important;
    width: auto !important;
    object-fit: contain;
    margin-right: -12px;
    position: relative;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    vertical-align: bottom;
    display: block;
}

.kpreg-form-header-books img:nth-child(1) { height: 90px !important; }
.kpreg-form-header-books img:nth-child(2) { height: 110px !important; }
.kpreg-form-header-books img:nth-child(3) { height: 80px !important; }
.kpreg-form-header-books img:nth-child(4) { height: 102px !important; }
.kpreg-form-header-books img:nth-child(5) { height: 115px !important; }
.kpreg-form-header-books img:nth-child(6) { height: 84px !important; }

.kpreg-form-header-books img:last-child {
    margin-right: 0;
}

/* --- Brown form header: pocket pointing down --- */
.kpreg-form-header {
    background: #5C3D2E;
    padding: 36px 40px 64px;
    clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px 12px 0 0;
    position: relative;
    z-index: 1;
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
}

.kpreg-form-header p {
    font-family: var(--font-heading);
    font-size: 28px;
    color: var(--color-white);
    line-height: 36px;
    text-align: center;
    margin: 0;
}

.kpreg-form-header .kp-orange {
    color: var(--color-primary);
}

/* --- Fix 6: Form body same width as header --- */
.kpreg-form {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 20px 18px;
    background: transparent;
    border: none;
}

.kpreg-form__section {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 1px;
}

.kpreg-form__title {
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    margin: 4px 0 0;
    line-height: 1.1;
}

.kpreg-form__sub {
    font-family: var(--font-body);
    font-size: 14px;
    color: #666666;
    margin: 0 0 2px;
}

.kpreg-form__label {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: #666666;
    margin: 2px 0 0;
}

.kpreg-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 3px;
}

.kpreg-form__row--three {
    grid-template-columns: 1fr 1fr 1fr;
}

.kpreg-form__row input,
.kpreg-form__row select {
    width: 100%;
    min-width: 0;
    font-family: var(--font-body);
    font-size: 16px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
    color: var(--color-text);
    outline: none;
    box-sizing: border-box;
}

.kpreg-form__row input::placeholder {
    color: #999999;
}

.kpreg-form__row select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23999' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 7px;
    padding-right: 32px;
    color: #999999;
}

.kpreg-form__row select:valid,
.kpreg-form__row select option:not(:disabled) {
    color: var(--color-text);
}

.kpreg-form__row input:focus,
.kpreg-form__row select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(255, 94, 0, 0.12);
}

/* Consent checkbox */
.kpreg-form__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.55;
    cursor: pointer;
    margin-top: 24px;
}

.kpreg-form__consent input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-text); /* Willem: darker + thicker so the box stands out on the white form */
    border-radius: 3px;
    background: var(--color-white);
    cursor: pointer;
    margin-top: 2px;
    position: relative;
}

.kpreg-form__consent input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0;
    width: 5px;
    height: 10px;
    border: solid var(--color-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.kpreg-form__consent a {
    color: #0066cc; /* Dick: match the canonical order-form 'voorwaarden' link blue (landing .kp-tc-trigger); no token exists for it */
    text-decoration: underline;
}

/* Adresvinder (BE-only) action controls — light grey, not the generic
   autofill.css orange (--color-primary base). Scoped to this /bestellen/ form
   (both kpreg desktop + kpodm mobile wrappers, matching the manual-toggle
   margin rule lower down) per autofill.css's per-form-override rule (#12
   containment); grey-mid is the muted/hint token the adresvinder's own
   counters/hints already use. */
.kpreg-form .kpf-gevonden-adres__change,
.kpreg-form .kpf-gevonden-adres__reset,
.kpreg-form .kpf-manual-toggle,
.kpodm-form .kpf-gevonden-adres__change,
.kpodm-form .kpf-gevonden-adres__reset,
.kpodm-form .kpf-manual-toggle {
    color: var(--color-grey-mid);
}

/* The wp_kses_post() output of reg_form_consent (ACF wysiwyg) wraps the
   text in a <p>. Without these resets the <p>'s default 1em top margin
   pushes the first text line down past the checkbox, so the consent
   visually appears stacked even though the parent is flex-row. */
.kpreg-form__consent > span {
    flex: 1;
    min-width: 0;
}
.kpreg-form__consent p {
    margin: 0;
}

/* Submit button */
.kpreg-form__submit-wrap {
    margin-top: 22px;
    text-align: left;
}

.kpreg-form__submit {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 400;
    color: var(--color-white);
    background: var(--color-primary);
    border: 3px solid var(--color-white);
    border-radius: 999px;
    padding: 10px 36px;
    cursor: pointer;
    transition: transform 0.2s;
    line-height: 1;
}

.kpreg-form__submit:hover {
    transform: scale(1.04);
}

/* --- Mobile base (prevent breakage, not fine-tuned) --- */
@media (max-width: 767px) {
    .kpreg-hero {
        margin: 20px auto;
        padding: 0 16px;
    }

    .kpreg-hero__inner {
        flex-direction: column;
        gap: 24px;
    }

    .kpreg-promo {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    .kpreg-promo__top {
        padding: 24px 20px 16px;
    }

    .kpreg-promo__heading {
        font-size: 20px;
    }

    .kpreg-promo__price {
        width: 80px;
        height: 80px;
    }

    .kpreg-promo__price-old {
        font-size: 12px;
    }

    .kpreg-promo__price-new {
        font-size: 28px;
    }

    .kpreg-promo .kph-bookshelf__books {
        padding: 0 16px 12px;
    }

    .kpreg-promo .kph-bookshelf__books img {
        height: 100px !important;
        max-width: 80px !important;
    }

    .kpreg-promo .kph-bookshelf__books::after {
        left: -20px;
        right: -20px;
    }

    .kpreg-promo__bottom-bar {
        padding: 12px 40px 12px 20px;
        clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 50%, calc(100% - 24px) 100%, 0 100%);
    }

    .kpreg-promo__bottom {
        font-size: 16px;
    }

    .kpreg-form-col {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    .kpreg-form {
        padding: 24px 20px 32px;
    }

    .kpreg-form__row {
        grid-template-columns: 1fr;
    }

    .kpreg-form__row--three {
        grid-template-columns: 1fr;
    }

    .kpreg-form__submit {
        width: 100%;
        font-size: 22px;
        padding: 14px 24px;
    }

    .kpreg-form-header-books {
        padding: 0 20px;
    }

    .kpreg-form-header-books img {
        height: 80px !important;
        max-width: 65px !important;
    }

    .kpreg-form-header {
        padding: 20px 20px 36px;
        min-height: auto;
    }

    .kpreg-form-header p {
        font-size: 16px;
        line-height: 24px;
    }

    .kpreg-characters {
        display: none;
    }
}

/* Tighten the BE manual-fallback toggle on /bestellen/ only. Plugin base
   (.kpf-manual-toggle in autofill.css) ships 4px 0 14px — fine for nijntje
   / prentenboek / age-pakket / kpstop2 BE forms, but on /bestellen/ Willem
   wants it closer to the leveradres lookup above and tighter to Telefoon
   below. Scoped via .kpreg-form / .kpodm-form so other BE forms keep the
   plugin default. */
.kpreg-form .kpf-manual-toggle,
.kpodm-form .kpf-manual-toggle {
    margin: 2px 0 6px;
}

/* Voorwaarden-popup op /bestellen/ (desktop + mobiel — beide laden registreren.css).
   Zelfde modal als op de landingspagina's (landing.css) en nu ook in shared.css.
   Actief als het algemene veld form_voorwaarden (Site-instellingen → Voorwaarden) is
   ingevuld; de .kp-tc-trigger-link opent 'm i.p.v. weg te navigeren. */
.kp-tc-modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); padding: 20px; }
.kp-tc-modal.is-open { display: flex; }
.kp-tc-modal__box {
    position: relative; background: var(--color-white); color: var(--color-black);
    max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto;
    border-radius: 8px; padding: 28px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
    font-family: var(--font-body, sans-serif); font-size: 14px; line-height: 1.5;
}
.kp-tc-modal__box h3 { font-family: var(--font-body); font-size: 16px; font-weight: 700; margin: 16px 0 4px; color: var(--color-black); }
.kp-tc-modal__box h3:first-child { margin-top: 0; }
.kp-tc-modal__box p { margin: 0 0 10px; }
.kp-tc-modal__close { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: var(--color-black); }
