/* ============================================================
   Kompas360 Leadgen - Popup v1.13
   Navy pille med et animeret fyrtårn (SVG). Folder ud til
   formularen (clip-path morph). Øjet har låg, iris og pupil.
   ============================================================ */

.klp {
    /* Kompas-navy - en tand blåere end sektionerne, så pillen skiller sig ud */
    --klp-blue-1: #2c3b62;
    --klp-blue-2: #222e4f;
    --klp-blue-3: #1b2540;
    --klp-ink: #0f1424;
    --klp-panel: #141a2a;
    --klp-panel-2: #1c2338;
    --klp-line: rgba(255, 255, 255, 0.16);
    --klp-line-2: rgba(255, 255, 255, 0.24);
    --klp-muted: rgba(255, 255, 255, 0.68);
    --klp-faint: rgba(255, 255, 255, 0.44);
    --klp-orange: #EC672E;
    --klp-orange-2: #f47d47;
    --klp-error: #ff9484;
    --klp-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --klp-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
    --klp-gap: 24px;
    --klp-pill-w: 360px;
    --klp-pill-h: 72px;

    position: fixed;
    z-index: 99990;
    inset: auto var(--klp-gap) var(--klp-gap) auto;
    font-family: "Manrope", system-ui, -apple-system, sans-serif;
    color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}
.klp[hidden] { display: none !important; }
.klp *, .klp *::before, .klp *::after { box-sizing: border-box; }
.klp :where(button) { font: inherit; color: inherit; margin: 0; }
.klp svg { display: block; }

/* ══════════════════════════════════════════════════════════
   FYRTÅRNET
   ══════════════════════════════════════════════════════════ */

.klp-lh { display: block; width: 100%; height: 100%; overflow: hidden; }
.klp-lh__body,
.klp-lh__gallery,
.klp-lh__roof,
.klp-lh__finial { fill: #fff; }
.klp-lh__band { fill: var(--klp-orange); }
.klp-lh__door,
.klp-lh__lantern { fill: var(--klp-ink); }
.klp-lh__lamp { fill: #ffe0c9; }
.klp-lh__mullion { fill: none; stroke: rgba(15, 20, 36, 0.35); stroke-width: 0.6; }
.klp-lh__waves {
    fill: none;
    stroke: rgba(255, 255, 255, 0.24);
    stroke-width: 1.2;
    stroke-linecap: round;
    animation: klp-waves 3.6s linear infinite;
}
@keyframes klp-waves { to { transform: translateX(12px); } }

/* ══════════════════════════════════════════════════════════
   PILLEN
   ══════════════════════════════════════════════════════════ */

.klp__launcher {
    position: relative;
    display: flex;
    align-items: center;
    height: var(--klp-pill-h);
    padding: 0 10px 0 0;
    border-radius: 999px;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.16), transparent 50%),
        linear-gradient(115deg, var(--klp-blue-1) 0%, var(--klp-blue-2) 55%, var(--klp-blue-3) 100%);
    box-shadow: 0 22px 44px -20px rgba(8, 10, 20, 0.7);
    opacity: 0;
    transform: translateY(26px) scale(0.92);
    transform-origin: 100% 100%;
    transition: opacity 0.5s var(--klp-ease), transform 0.8s var(--klp-spring);
}
/* Lysstribe der glider over pillen, når den lander */
.klp__launcher::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
    background-size: 250% 100%;
    background-position: 130% 0;
    pointer-events: none;
}
.klp.is-in .klp__launcher { opacity: 1; transform: none; }
.klp.is-in .klp__launcher::after { animation: klp-sheen 1.6s 0.5s var(--klp-ease) both; }
@keyframes klp-sheen { to { background-position: -30% 0; } }

.klp.is-open .klp__launcher {
    opacity: 0;
    transform: scale(0.94);
    pointer-events: none;
    transition-duration: 0.2s;
}
.klp.is-nudge .klp__launcher { animation: klp-nudge 1s var(--klp-ease); }
@keyframes klp-nudge {
    0%, 100% { transform: none; }
    25% { transform: translateY(-7px) rotate(-1.6deg); }
    55% { transform: translateY(0) rotate(1deg); }
    75% { transform: translateY(-2px) rotate(0); }
}

.klp__pill {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 0 8px;
    background: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    text-align: left;
}
.klp__pill:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.klp__icon-wrap {
    position: relative;
    flex: none;
    width: 78px;
    height: 58px;
    border-radius: 999px;
    background: var(--klp-ink);
    overflow: hidden;
    transition: transform 0.5s var(--klp-spring);
}
.klp__pill:hover .klp__icon-wrap { transform: scale(1.05); }

.klp__pill-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    padding-right: 4px;
}
.klp__pill-main {
    font-family: "Bricolage Grotesque", "Manrope", sans-serif;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.015em;
    white-space: nowrap;
}
.klp__pill-sub {
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.76);
    white-space: nowrap;
}

.klp__pill-arrow {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--klp-orange);
    transition: background-color 0.3s, transform 0.4s var(--klp-spring);
}
.klp__pill-arrow svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.klp__pill:hover .klp__pill-arrow { background: var(--klp-orange-2); transform: rotate(45deg); }

.klp__dismiss {
    position: absolute;
    top: -8px;
    right: -6px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    background: var(--klp-ink);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.2s, transform 0.3s var(--klp-spring), color 0.2s, background-color 0.2s;
}
.klp__launcher:hover .klp__dismiss,
.klp__dismiss:focus-visible { opacity: 1; transform: none; }
.klp__dismiss:hover { color: #fff; background: #000; }
.klp__dismiss:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.klp__dismiss svg,
.klp__close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ══════════════════════════════════════════════════════════
   PANEL - morpher ud fra pillen
   ══════════════════════════════════════════════════════════ */

.klp__panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 456px;
    max-height: calc(100dvh - var(--klp-gap) * 2);
    overflow: hidden auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 36px 38px 30px;
    background:
        radial-gradient(90% 60% at 100% 0%, rgba(236, 103, 46, 0.16), transparent 60%),
        radial-gradient(70% 50% at 0% 100%, rgba(60, 80, 140, 0.18), transparent 70%),
        linear-gradient(180deg, var(--klp-panel-2), var(--klp-panel));
    border-radius: 28px;
    box-shadow:
        0 40px 80px -30px rgba(8, 10, 20, 0.7);
    clip-path: inset(calc(100% - var(--klp-pill-h)) 0 0 calc(100% - var(--klp-pill-w)) round calc(var(--klp-pill-h) / 2));
    opacity: 0;
    visibility: hidden;
    transition:
        clip-path 0.45s var(--klp-ease),
        opacity 0.2s ease 0.15s,
        visibility 0s linear 0.45s;
}
/* Fin kornet tekstur */
.klp__panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.07;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.klp.is-open .klp__panel {
    clip-path: inset(0 0 0 0 round 28px);
    opacity: 1;
    visibility: visible;
    transition:
        clip-path 0.7s var(--klp-ease),
        opacity 0.12s ease,
        visibility 0s;
}

.klp__view,
.klp__close {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.klp__view { position: relative; }
.klp.is-open .klp__view,
.klp.is-open .klp__close {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s 0.2s ease, transform 0.7s 0.2s var(--klp-ease);
}
.klp__view[hidden] { display: none; }

.klp__close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 0;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
}
.klp.is-open .klp__close:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    transform: rotate(90deg);
    transition: background-color 0.2s, color 0.2s, transform 0.4s var(--klp-spring);
}
.klp__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.klp__backdrop {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(10, 13, 22, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

/* ──────────────────────────────────────────────────────────
   Team
   ────────────────────────────────────────────────────────── */

.klp__team {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 44px;
    margin-bottom: 22px;
}
.klp__faces { display: flex; flex: none; }
.klp__face {
    width: 36px;
    height: 36px;
    margin-left: -10px;
    border-radius: 50%;
    border: 2px solid var(--klp-panel-2);
    background: var(--klp-panel-2) center / cover no-repeat;
}
.klp__face:first-child { margin-left: 0; }
.klp__team-text { display: flex; flex-direction: column; min-width: 0; }
.klp__team-names { font-size: 13px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.klp__team-time {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    line-height: 1.3;
    color: var(--klp-muted);
}
.klp__team-time::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5be38f;
    animation: klp-live 2.4s ease-out infinite;
}
@keyframes klp-live {
    0% { box-shadow: 0 0 0 0 rgba(91, 227, 143, 0.55); }
    80%, 100% { box-shadow: 0 0 0 7px rgba(91, 227, 143, 0); }
}

/* ──────────────────────────────────────────────────────────
   Tekst
   ────────────────────────────────────────────────────────── */

.klp__title {
    width: 100%;
    max-width: 100% !important;
    margin: 0 0 10px;
    font-family: "Bricolage Grotesque", "Manrope", sans-serif;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.032em;
    color: #fff;
}
.klp__title:focus { outline: none; }

/* Fyrtårnet står frit til højre for overskriften */
.klp__head {
    position: relative;
    padding-right: 104px;
}
.klp__title-light {
    position: absolute;
    top: -9px;
    right: 14px;
    width: 120px;
    height: 75px;
    pointer-events: none;
}

.klp__text {
    width: 100%;
    max-width: 100% !important;   /* temaets p-regler må ikke gøre teksten smallere */
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--klp-muted);
}

/* ──────────────────────────────────────────────────────────
   Formular - understregede felter
   ────────────────────────────────────────────────────────── */

.klp__form { margin: 0; }
.klp__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 22px;
}

.klp__field {
    position: relative;
    display: block;
    margin: 0;
    cursor: text;
}
.klp__field input,
.klp__field textarea {
    display: block;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 21px 0 7px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--klp-line-2);
    border-radius: 0;
    color: #fff;
    font: 500 15px/1.2 "Manrope", system-ui, sans-serif;
    box-shadow: none;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    caret-color: var(--klp-orange);
    transition: border-color 0.2s;
}
.klp__field input:hover,
.klp__field textarea:hover { border-bottom-color: rgba(255, 255, 255, 0.4); }
.klp__field--wide { grid-column: 1 / -1; }
.klp__field textarea {
    height: 52px;
    min-height: 52px;
    max-height: 140px;
    resize: none;
    overflow-y: auto;
    line-height: 1.45;
    scrollbar-width: thin;
}
.klp__field input:-webkit-autofill,
.klp__field input:-webkit-autofill:hover,
.klp__field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 100px var(--klp-panel) inset;
    transition: background-color 9999s;
}
.klp__label {
    position: absolute;
    left: 0;
    top: 27px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: var(--klp-faint);
    transform-origin: 0 0;
    pointer-events: none;
    transition: transform 0.3s var(--klp-ease), color 0.2s;
}
.klp__field input:focus ~ .klp__label,
.klp__field input:not(:placeholder-shown) ~ .klp__label,
.klp__field textarea:focus ~ .klp__label,
.klp__field textarea:not(:placeholder-shown) ~ .klp__label,
.klp__field input:-webkit-autofill ~ .klp__label {
    transform: translateY(-18px) scale(0.78);
    color: var(--klp-muted);
}
.klp__field input:focus ~ .klp__label,
.klp__field textarea:focus ~ .klp__label { color: var(--klp-orange-2); }

/* Orange streg der tegnes fra venstre ved fokus */
.klp__line {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--klp-orange), var(--klp-orange-2));
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.45s var(--klp-ease);
}
.klp__field input:focus ~ .klp__line,
.klp__field textarea:focus ~ .klp__line { transform: scaleX(1); }

.klp__field.is-invalid input { border-bottom-color: var(--klp-error); }
.klp__field.is-invalid .klp__label { color: var(--klp-error); }
.klp__field.is-invalid .klp__line { background: var(--klp-error); }
.klp__field.is-shake { animation: klp-shake 0.42s var(--klp-ease); }
@keyframes klp-shake {
    0%, 100% { transform: none; }
    20% { transform: translateX(-5px); }
    45% { transform: translateX(4px); }
    70% { transform: translateX(-2px); }
}

.klp__hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.klp__error {
    margin: 14px 0 0;
    font-size: 13.5px;
    color: var(--klp-error);
}
.klp__error[hidden] { display: none; }

.klp__submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    margin-top: 20px;
    padding: 0 24px;
    background: linear-gradient(115deg, #f27a43 0%, var(--klp-orange) 50%, #de5620 100%);
    border: 0;
    border-radius: 999px;
    color: #fff;
    font-family: "Bricolage Grotesque", "Manrope", sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s var(--klp-ease), filter 0.2s;
}
.klp__submit::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.3) 50%, transparent 65%);
    background-size: 250% 100%;
    background-position: 130% 0;
    transition: background-position 0.9s var(--klp-ease);
    pointer-events: none;
}
.klp__submit:hover { filter: brightness(1.06); }
.klp__submit:hover::after { background-position: -30% 0; }
.klp__submit:active { transform: scale(0.985); }
.klp__submit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.klp__submit-arrow {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.4s var(--klp-ease);
}
.klp__submit:hover .klp__submit-arrow { transform: translateX(5px); }
.klp__spinner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: klp-spin 0.7s linear infinite;
}
.klp__form.is-busy .klp__submit { pointer-events: none; }
.klp__form.is-busy .klp__submit-label,
.klp__form.is-busy .klp__submit-arrow { opacity: 0; }
.klp__form.is-busy .klp__spinner { opacity: 1; }
@keyframes klp-spin { to { transform: rotate(360deg); } }

.klp__fine {
    margin: 12px 0 0;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--klp-faint);
    text-align: center;
}

/* ──────────────────────────────────────────────────────────
   Tak
   ────────────────────────────────────────────────────────── */

.klp__view--done {
    padding: 22px 10px 16px;
    text-align: center;
}
.klp__done-icon {
    display: block;
    width: 128px;
    height: 96px;
    margin: 0 auto 18px;
    border-radius: 999px;
    background: var(--klp-ink);
    overflow: hidden;
}
.klp__title--done { font-size: 26px; }
.klp__view--done .klp__text { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════
   MOBIL - bundark
   ══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .klp {
        --klp-gap: 12px;
        --klp-pill-h: 54px;
    }
    /* Mobil: kun fyrtårnet - teksten er skjult visuelt, men læses stadig op */
    .klp__pill { gap: 0; padding: 0 5px; }
    .klp__icon-wrap { width: 62px; height: 44px; }
    .klp__pill-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .klp__pill-arrow { display: none; }
    .klp__launcher { padding-right: 0; }
    /* Touch har ingen hover - krydset er altid synligt */
    .klp__dismiss { opacity: 1; transform: none; width: 22px; height: 22px; top: -7px; right: -7px; }
    .klp__dismiss svg { width: 12px; height: 12px; }

    .klp__backdrop { display: block; }
    .klp.is-open .klp__backdrop {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.35s ease, visibility 0s;
    }

    .klp__panel {
        position: fixed;
        right: var(--klp-gap);
        bottom: var(--klp-gap);
        width: calc(100vw - var(--klp-gap) * 2);
        max-height: calc(100dvh - 64px);
        padding: 28px 24px 22px;
        border-radius: 24px;
    }
    .klp.is-open .klp__panel { clip-path: inset(0 0 0 0 round 24px); }

    .klp__close { top: 20px; right: 18px; }
    .klp__team { margin-bottom: 20px; gap: 12px; }
    .klp__face { width: 30px; height: 30px; margin-left: -9px; }
    /* Mobil: kun den korte linje - navnene står i mailen alligevel */
    .klp__team-names { display: none; }
    .klp__team-time { font-size: 12px; white-space: nowrap; color: rgba(255, 255, 255, 0.8); }
    .klp__team { gap: 10px; padding-right: 40px; }

    .klp__title { font-size: 25px; margin-bottom: 8px; }
    .klp__head { padding-right: 78px; }
    .klp__title-light { width: 92px; height: 58px; top: -5px; right: 4px; }
    .klp__text { font-size: 13.5px; margin-bottom: 10px; }

    .klp__fields { grid-template-columns: 1fr; gap: 0; }
    .klp__field input { height: 50px; font-size: 16px; }
    .klp__field textarea { font-size: 16px; min-height: 50px; }
    .klp__label { top: 26px; }
    .klp__submit { margin-top: 18px; height: 52px; }
}

@media (max-width: 600px) and (max-height: 680px) {
    .klp__text { display: none; }
    .klp__title { margin-bottom: 8px; }
}


@media (prefers-reduced-motion: reduce) {
    .klp__launcher,
    .klp__panel,
    .klp__view,
    .klp__close {
        transition-duration: 0.01s !important;
        transition-delay: 0s !important;
    }
    .klp-lh__waves,
    .klp.is-in .klp__launcher::after,
    .klp.is-nudge .klp__launcher { animation: none !important; }
}

html.klp-lock,
html.klp-lock body { overflow: hidden !important; }

@media print { .klp { display: none !important; } }
