/**
 * Lead Capture: forms, pop-ups and squeeze pages
 * @since 3.22.0
 */

/* ---------- Forms ---------- */

.tlc-form-wrap {
    --tlc-accent: #764ba2;
    --tlc-bg: #ffffff;
    --tlc-text: #2d3748;
    box-sizing: border-box;
    width: 100%;
    margin: 1.5em auto;
    color: var(--tlc-text);
    font-size: 16px;
    line-height: 1.5;
}
.tlc-form-wrap *,
.tlc-form-wrap *::before,
.tlc-form-wrap *::after {
    box-sizing: border-box;
}
.tlc-align-left { margin-left: 0; text-align: left; }
.tlc-align-center { text-align: center; }

.tlc-layout-card {
    background: var(--tlc-bg);
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.tlc-popup .tlc-layout-card {
    box-shadow: none;
    padding: 0;
    background: transparent;
    margin: 0 auto;
}

.tlc-heading {
    margin: 0 0 0.4em;
    font-size: 1.5em;
    line-height: 1.25;
    color: inherit;
}
.tlc-intro { margin: 0 0 1em; }
.tlc-intro p { margin: 0 0 0.6em; }

.tlc-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}
.tlc-field { margin: 0; }
.tlc-field label {
    display: block;
    font-size: 0.875em;
    font-weight: 600;
    margin-bottom: 4px;
}
.tlc-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 16px; /* stops iOS zoom */
    background: #fff;
    color: #1a202c;
}
.tlc-field input:focus {
    outline: 2px solid var(--tlc-accent);
    outline-offset: 1px;
    border-color: var(--tlc-accent);
}

.tlc-layout-inline .tlc-fields {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
}
.tlc-layout-inline .tlc-field { flex: 1 1 180px; }
.tlc-layout-inline .tlc-field-submit { flex: 0 0 auto; }

.tlc-button {
    display: inline-block;
    width: 100%;
    padding: 13px 22px;
    border: 0;
    border-radius: 8px;
    background: var(--tlc-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: filter 0.15s ease, transform 0.15s ease;
}
.tlc-button:hover,
.tlc-button:focus { filter: brightness(1.08); color: #fff; }
.tlc-button:active { transform: translateY(1px); }
.tlc-button[disabled] { opacity: 0.7; cursor: wait; }
.tlc-layout-inline .tlc-button { width: auto; }
.tlc-download { width: auto; margin-top: 8px; }

.tlc-check {
    margin: 12px 0 0;
    font-size: 0.875em;
    text-align: left;
}
.tlc-check label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.tlc-check input { margin-top: 3px; flex: 0 0 auto; }
.tlc-check a { color: inherit; text-decoration: underline; }

.tlc-privacy { margin: 10px 0 0; font-size: 0.8em; opacity: 0.8; }
.tlc-privacy a { color: inherit; }

.tlc-message {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fff5f5;
    color: #c53030;
    font-size: 0.9em;
    text-align: left;
}
.tlc-message.is-visible { display: block; }

.tlc-success { font-size: 1.05em; }
.tlc-success:focus { outline: none; }
.tlc-success p { margin: 0 0 0.6em; }

/* Honeypot: off-screen, not display:none (some bots skip hidden inputs) */
.tlc-hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.tlc-turnstile { margin-top: 12px; }

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

.tlc-admin-note {
    padding: 8px 12px;
    border-left: 4px solid #dba617;
    background: #fcf9e8;
    color: #1d2327;
    font-size: 14px;
    text-align: left;
}

/* ---------- Pop-ups ---------- */

html.tlc-no-scroll,
html.tlc-no-scroll body { overflow: hidden; }

.tlc-popup {
    --tlc-popup-bg: #ffffff;
    --tlc-popup-text: #2d3748;
    --tlc-popup-width: 520px;
    position: fixed;
    z-index: 999990;
    color: var(--tlc-popup-text);
}
.tlc-popup[hidden] { display: none !important; }

.tlc-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 6, 25, 0.65);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.tlc-popup.is-open .tlc-popup-overlay { opacity: 1; }

.tlc-popup-box {
    position: relative;
    background: var(--tlc-popup-bg);
    color: var(--tlc-popup-text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    outline: none;
    overflow: auto;
}
.tlc-popup.is-open .tlc-popup-box { opacity: 1; transform: none; }

.tlc-popup-body { padding: 32px 26px 26px; }
.tlc-popup-content { margin-bottom: 8px; }
.tlc-popup-content > :first-child { margin-top: 0; }
.tlc-popup-image img { display: block; width: 100%; height: auto; }

.tlc-popup-close {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
}
.tlc-popup-close:hover,
.tlc-popup-close:focus { background: rgba(0, 0, 0, 0.14); }

/* Centered modal */
.tlc-popup-modal,
.tlc-popup-fullscreen {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.tlc-popup-modal .tlc-popup-box {
    width: 100%;
    max-width: var(--tlc-popup-width);
    max-height: calc(100vh - 32px);
    border-radius: 14px;
    transform: translateY(16px) scale(0.98);
}

/* Full screen */
.tlc-popup-fullscreen { padding: 0; }
.tlc-popup-fullscreen .tlc-popup-box {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: scale(1.02);
}
.tlc-popup-fullscreen .tlc-popup-body { width: 100%; max-width: 640px; }
.tlc-popup-fullscreen .tlc-popup-image { max-width: 640px; width: 100%; }

/* Slide-in */
.tlc-popup-slide_in {
    bottom: 20px;
    width: calc(100% - 32px);
    max-width: var(--tlc-popup-width);
}
.tlc-popup-slide_in.tlc-popup-right { right: 16px; }
.tlc-popup-slide_in.tlc-popup-left { left: 16px; }
.tlc-popup-slide_in .tlc-popup-box {
    border-radius: 12px;
    max-height: calc(100vh - 40px);
    transform: translateY(30px);
}
.tlc-popup-slide_in .tlc-popup-body { padding: 26px 20px 20px; }

/* Bars */
.tlc-popup-bar_top,
.tlc-popup-bar_bottom { left: 0; right: 0; }
.tlc-popup-bar_top { top: 0; }
.tlc-popup-bar_bottom { bottom: 0; }
.admin-bar .tlc-popup-bar_top { top: 32px; }
.tlc-popup-bar_top .tlc-popup-box { transform: translateY(-100%); }
.tlc-popup-bar_bottom .tlc-popup-box { transform: translateY(100%); }
.tlc-popup-bar_top .tlc-popup-box,
.tlc-popup-bar_bottom .tlc-popup-box {
    max-height: 60vh;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
}
.tlc-popup-bar_top .tlc-popup-body,
.tlc-popup-bar_bottom .tlc-popup-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 56px 14px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 24px;
}
.tlc-popup-bar_top .tlc-popup-content,
.tlc-popup-bar_bottom .tlc-popup-content { flex: 1 1 260px; margin: 0; }
.tlc-popup-bar_top .tlc-popup-content p,
.tlc-popup-bar_bottom .tlc-popup-content p { margin: 0; }
.tlc-popup-bar_top .tlc-form-wrap,
.tlc-popup-bar_bottom .tlc-form-wrap { flex: 2 1 420px; margin: 0; max-width: none !important; }
.tlc-popup-bar_top .tlc-popup-image,
.tlc-popup-bar_bottom .tlc-popup-image { display: none; }

@media (max-width: 782px) {
    .admin-bar .tlc-popup-bar_top { top: 46px; }
}

@media (max-width: 600px) {
    .tlc-popup-modal .tlc-popup-body { padding: 28px 18px 20px; }
    .tlc-layout-card { padding: 22px 16px; }
    .tlc-layout-inline .tlc-button { width: 100%; }
    .tlc-layout-inline .tlc-field-submit { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .tlc-popup-box,
    .tlc-popup-overlay,
    .tlc-button { transition: none; }
}

/* ---------- Background images (forms and pop-ups) @since 3.37.0 ---------- */

/* The layer sits behind the content inside its own stacking context. */
.tlc-has-bg {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.tlc-bg-layer {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
.tlc-bg-layer .tlc-bg-img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    object-fit: cover;
    object-position: var(--tlc-bg-pos, center center);
}
.tlc-bg-overlay {
    position: absolute;
    inset: 0;
    background: var(--tlc-bg-overlay, rgba(0, 0, 0, 0.45));
}

/* Forms: any layout gets padding and rounded corners over an image. */
.tlc-form-wrap.tlc-has-bg {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: var(--tlc-min-h, auto);
    padding: 36px 28px;
    border-radius: 12px;
    /* clip (not hidden) keeps a shaped box able to grow with its content */
    overflow: clip;
}
.tlc-popup .tlc-form-wrap.tlc-has-bg { padding: 28px 20px; }

/* Text over an image: a soft shadow that suits the text colour. */
.tlc-has-bg .tlc-heading,
.tlc-has-bg .tlc-intro,
.tlc-has-bg .tlc-field label,
.tlc-has-bg .tlc-check,
.tlc-has-bg .tlc-privacy,
.tlc-has-bg .tlc-success,
.tlc-has-bg .tlc-popup-content {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}
.tlc-text-light .tlc-has-bg .tlc-heading,
.tlc-text-light .tlc-has-bg .tlc-intro,
.tlc-text-light .tlc-has-bg .tlc-field label,
.tlc-text-light .tlc-has-bg .tlc-check,
.tlc-text-light .tlc-has-bg .tlc-privacy,
.tlc-text-light .tlc-has-bg .tlc-success,
.tlc-text-light .tlc-has-bg .tlc-popup-content,
.tlc-text-light.tlc-has-bg .tlc-heading,
.tlc-text-light.tlc-has-bg .tlc-intro,
.tlc-text-light.tlc-has-bg .tlc-field label,
.tlc-text-light.tlc-has-bg .tlc-check,
.tlc-text-light.tlc-has-bg .tlc-privacy,
.tlc-text-light.tlc-has-bg .tlc-success {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.tlc-has-bg .tlc-button { text-shadow: none; }

/* "Glass" fields: see-through boxes that let the image show. */
.tlc-fields-glass .tlc-field input {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.25);
    color: inherit;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.tlc-fields-glass.tlc-text-light .tlc-field input,
.tlc-text-light .tlc-has-bg .tlc-fields-glass:not(.tlc-has-bg) .tlc-field input {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.6);
}
.tlc-fields-glass .tlc-field input::placeholder { color: inherit; opacity: 0.75; }

/* Pop-ups: the image stays put while the content scrolls inside it. */
.tlc-popup-box.tlc-has-bg {
    display: flex;
    flex-direction: column;
}
.tlc-popup-box.tlc-has-bg > .tlc-popup-body {
    flex: 0 1 auto;
    min-height: 0;
    overflow: auto;
}
.tlc-popup-fullscreen .tlc-popup-box.tlc-has-bg > .tlc-popup-body { max-height: 100%; }
/* A plain form inside an image pop-up takes the pop-up's text colour. */
.tlc-popup-box.tlc-has-bg .tlc-form-wrap:not(.tlc-has-bg) { color: inherit; }
.tlc-text-light .tlc-popup-close { background: rgba(255, 255, 255, 0.16); }
.tlc-text-light .tlc-popup-close:hover,
.tlc-text-light .tlc-popup-close:focus { background: rgba(255, 255, 255, 0.3); }

@media (max-width: 600px) {
    .tlc-form-wrap.tlc-has-bg { padding: 28px 18px; }
}

/* ---------- Box shapes @since 3.38.0 ---------- */
/* --tlc-ratio = height / width. The shape is a minimum: content that needs
   more room makes the box taller instead of being cut off. */

.tlc-form-wrap.tlc-shaped {
    display: flex;
    flex-direction: column;
    justify-content: center;
    aspect-ratio: 1 / var(--tlc-ratio);
}
.tlc-form-wrap.tlc-shaped:not(.tlc-has-bg) { padding: 28px 24px; }

.tlc-popup-box.tlc-shaped {
    display: flex;
    flex-direction: column;
}
.tlc-popup-modal .tlc-popup-box.tlc-shaped {
    min-height: min(calc(min(var(--tlc-popup-width), 100vw - 32px) * var(--tlc-ratio)), calc(100vh - 32px));
}
.tlc-popup-slide_in .tlc-popup-box.tlc-shaped {
    min-height: min(calc(min(var(--tlc-popup-width), 100vw - 32px) * var(--tlc-ratio)), calc(100vh - 40px));
}
/* Auto margins centre the content but never clip it when it overflows. */
.tlc-popup-box.tlc-shaped > .tlc-popup-body { margin-top: auto; margin-bottom: auto; }

/* ---------- Side image (e.g. lead magnet) @since 3.39.0 ---------- */
/* Two columns when the form is wide enough, stacked when it isn't. The
   container query looks at the form's own width, so it also stacks in
   narrow sidebars and pop-ups, not just on phones. */

.tlc-form-wrap.tlc-has-side { container-type: inline-size; }
.tlc-split {
    display: grid;
    grid-template-columns: var(--tlc-side-w, 40%) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
}
.tlc-side-right .tlc-split { grid-template-columns: minmax(0, 1fr) var(--tlc-side-w, 40%); }
.tlc-side-right .tlc-side-media { order: 2; }
.tlc-main { min-width: 0; }
.tlc-side-media { margin: 0; line-height: 0; }
.tlc-side-media .tlc-side-img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    margin: 0 auto;
}
.tlc-side-cover .tlc-side-media { align-self: stretch; }
.tlc-side-cover .tlc-side-media .tlc-side-img {
    height: 100%;
    min-height: 240px;
    object-fit: cover;
    border-radius: 8px;
}

@container (max-width: 560px) {
    .tlc-split { grid-template-columns: minmax(0, 1fr) !important; gap: 18px; }
    .tlc-side-right .tlc-side-media { order: 0; }
    .tlc-side-media { max-width: 280px; width: 100%; margin: 0 auto; }
    .tlc-side-cover .tlc-side-media .tlc-side-img { min-height: 0; height: auto; aspect-ratio: 4 / 3; }
    .tlc-side-mobile-hide .tlc-side-media { display: none; }
}

/* ---------- Squeeze page ---------- */

body.tlc-squeeze-body { margin: 0; }
.tlc-squeeze {
    --tlc-sq-bg: #1a1033;
    --tlc-sq-text: #ffffff;
    --tlc-sq-width: 720px;
    --tlc-sq-overlay: 0.5;
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    background-color: var(--tlc-sq-bg);
    background-size: cover;
    background-position: center;
    color: var(--tlc-sq-text);
    box-sizing: border-box;
}
.tlc-squeeze.has-bg-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--tlc-sq-overlay));
}
.tlc-squeeze-inner {
    position: relative;
    width: 100%;
    max-width: var(--tlc-sq-width);
}
.tlc-squeeze-content { text-align: center; }
.tlc-squeeze-content > * { margin-left: auto; margin-right: auto; }
.tlc-squeeze-content img { max-width: 100%; height: auto; }
