/* PromptCloud Sync — lease form front-end
   Accent colour comes from --avi-accent (set in the plugin settings).
   All selectors are documented in the plugin under the Shortcodes tab. */

.avi-lease-form {
    font-family: 'Livvic', sans-serif;
    max-width: 456px;
}

.avi-lease-field { margin-bottom: 16px; }

.avi-lease-label {
    display: block;
    font-family: 'Livvic', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 8px;
}

.avi-lease-form select.avi-lease-term,
.avi-lease-form input.avi-lease-down,
.avi-lease-form input.avi-lease-balloon {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    min-height: 0;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 17px;
    line-height: 1.4;
    color: #1d2327;
    background-color: #f2f2f3;
    border: 1px solid transparent;
    border-radius: 10px;
    box-shadow: none;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.avi-lease-term {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23555' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.avi-lease-form select.avi-lease-term:focus,
.avi-lease-form input.avi-lease-down:focus,
.avi-lease-form input.avi-lease-balloon:focus {
    border-color: var(--avi-accent, #FE6631);
    background-color: #f2f2f3;
    box-shadow: none;
    outline: none;
}

.avi-lease-price {
    margin: 20px 0;
    font-family: 'Livvic', sans-serif;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    color: var(--avi-accent, #FE6631);
}

.avi-lease-price-currency { font-size: 18px; vertical-align: super; margin-right: 3px; color: #353535; font-weight: 400; }
.avi-lease-price-amount   { font-size: 36px; }
.avi-lease-price-suffix   { font-size: 36px; color: #353535; font-weight: 400;}

.avi-lease-submit {
    display: block;
    width: 100%;
    padding: 16px 26px;
    font-family: inherit;
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    color: #fff;
    background: var(--avi-accent, #FE6631);
    border: none;
    border-radius: 32px;
    cursor: pointer;
    transition: background .15s ease, filter .15s ease;
}

.avi-lease-unavailable { font-family: 'Livvic', sans-serif; color: #666; }

/* --- Popup ------------------------------------------------------------- */

.avi-lease-popup-overlay {
    position: fixed;
    inset: 0;
    /* Above sticky headers and Elementor overlays, which commonly sit
       anywhere up to 999999 */
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 20, 20, .55);
}

/* The hidden attribute must win over display:flex — without this the
   popup would be visible on page load */
.avi-lease-popup-overlay[hidden] { display: none; }

.avi-lease-popup {
    position: relative;
    width: 100%;
    /* Wide enough to put the fields in two columns, which keeps the whole
       form on screen without scrolling */
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 28px 32px;
    font-family: 'Livvic', sans-serif;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

/* Close button: icon only — no background, no hover effect */
.avi-lease-popup-close,
.avi-lease-popup-close:hover,
.avi-lease-popup-close:focus,
.avi-lease-popup-close:active {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    box-shadow: none;
    font-size: 17px;
    line-height: 1;
    color: #1d2327;
    cursor: pointer;
    outline: none;
}

.avi-lease-popup-title { margin: 0 0 14px; font-size: 34px; font-weight: 600; }

.avi-lease-summary {
    background: #faf7f5;
    border: 1px solid #f0e4de;
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 18px;
    font-size: 15px;
}
.avi-lease-summary-row { display: flex; justify-content: space-between; padding: 3px 0; }
.avi-lease-summary-row strong { font-weight: 600; }
.avi-lease-summary-row--price { color: var(--avi-accent, #FE6631); font-weight: 600; }

/* Two columns on desktop as well: six stacked rows is what pushes the popup
   past the screen height on a 13" laptop */
@media (min-width: 701px) {
    .avi-lease-summary {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 24px;
    }
    .avi-lease-summary-row--price {
        grid-column: 1 / -1;
        border-top: 1px solid #f0e4de;
        margin-top: 4px;
        padding-top: 7px;
        font-size: 17px;
    }
}

/* Two columns on desktop. Anything that needs the full width — the paired
   rows, the remarks box, the error line and the button — spans both. */
.avi-lease-contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 10px;
}
.avi-lease-contact-form > div,
.avi-lease-contact-form > textarea,
.avi-lease-contact-form > p,
.avi-lease-contact-form > button,
.avi-lease-contact-form > .avi-lease-kvk { grid-column: 1 / -1; }

.avi-lease-popup-cols { display: flex; gap: 10px; }
.avi-lease-popup-cols .avi-lease-input { flex: 1; }
/* Subtle busy state while the address is being looked up */
.avi-lease-popup input.avi-lease-loading {
    background-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, .05), transparent);
    background-size: 200% 100%;
    animation: avi-lease-shimmer 1s linear infinite;
}
@keyframes avi-lease-shimmer { to { background-position: -200% 0; } }

/* A house number needs far less room than a postcode */
.avi-lease-popup-cols .avi-lease-huisnummer { flex: 0 0 32%; }

/* High-specificity selectors so theme/Elementor input styles (borders,
   radius, height) never override the popup fields — all fields match the
   textarea look */
.avi-lease-popup input.avi-lease-input,
.avi-lease-popup textarea.avi-lease-input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 16px;
    margin: 0 0 10px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: #1d2327;
    background: #f2f2f3;
    border: 1px solid transparent;
    border-radius: 10px;
    box-shadow: none;
    outline: none;
    min-height: 0;
    height: auto;
}
.avi-lease-popup input.avi-lease-input:focus,
.avi-lease-popup textarea.avi-lease-input:focus {
    border-color: var(--avi-accent, #FE6631);
    background: #f2f2f3;
    box-shadow: none;
    outline: none;
}
.avi-lease-textarea { resize: vertical; }

.avi-lease-hp { position: absolute !important; left: -9999px !important; height: 0; width: 0; opacity: 0; }

.avi-lease-error { color: #d63638; font-size: 14px; margin: 4px 0 10px; }

.avi-lease-send {
    display: block;
    width: 100%;
    padding: 16px 26px;
    font-family: inherit;
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    color: #fff;
    background: var(--avi-accent, #FE6631);
    border: none;
    border-radius: 32px;
    cursor: pointer;
    transition: background .15s ease, filter .15s ease;
}
.avi-lease-send[disabled] { opacity: .6; cursor: default; }

/* Hover/focus/active: slightly darker accent colour on both buttons.
   color-mix() darkens the accent CSS variable; older browsers fall back
   to a brightness filter. */
.avi-lease-submit:hover,
.avi-lease-submit:focus,
.avi-lease-send:hover,
.avi-lease-send:focus { filter: brightness(.88); outline: none; }

.avi-lease-submit:active,
.avi-lease-send:active { filter: brightness(.78); outline: none; }

@supports (background: color-mix(in srgb, #fff, #000)) {
    .avi-lease-submit:hover,
    .avi-lease-submit:focus,
    .avi-lease-send:hover,
    .avi-lease-send:focus {
        background: color-mix(in srgb, var(--avi-accent, #FE6631) 86%, #000);
        filter: none;
    }
    .avi-lease-submit:active,
    .avi-lease-send:active {
        background: color-mix(in srgb, var(--avi-accent, #FE6631) 74%, #000);
        filter: none;
    }
}

.avi-lease-thanks { text-align: center; padding: 18px 6px; }
.avi-lease-thanks h3 { font-size: 22px; margin: 0 0 8px; }

/* --- Mobile ------------------------------------------------------------ */

@media (max-width: 700px) {
    .avi-lease-popup-overlay {
        padding: 0;
        align-items: flex-end; /* sheet from the bottom, within thumb reach */
    }

    .avi-lease-popup {
        max-width: none;
        max-height: 94vh;
        border-radius: 20px 20px 0 0;
        padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
        /* Momentum scrolling inside the sheet instead of dragging the page */
        -webkit-overflow-scrolling: touch;
    }

    .avi-lease-popup-title { font-size: 26px; padding-right: 40px; }

    /* One column, and the paired rows stack too */
    .avi-lease-contact-form { grid-template-columns: 1fr; }
    .avi-lease-popup-cols { flex-wrap: wrap; }
    .avi-lease-popup-cols .avi-lease-input { flex: 1 1 100%; }
    /* Postcode and house number stay side by side — they are short enough */
    .avi-lease-popup-cols .avi-lease-postcode { flex: 1 1 0; }
    .avi-lease-popup-cols .avi-lease-huisnummer { flex: 0 0 32%; }

    /* 16px keeps iOS from zooming in when a field gets focus, which otherwise
       leaves the visitor stuck on a magnified page */
    .avi-lease-popup input.avi-lease-input,
    .avi-lease-popup textarea.avi-lease-input {
        font-size: 16px;
        padding: 14px 16px;
    }

    .avi-lease-summary { font-size: 14px; padding: 12px 14px; }
    .avi-lease-send { padding: 15px 20px; }
    .avi-lease-popup-close { top: 10px; right: 10px; }
}

/* Landscape on a phone: very little height, so drop the sheet look */
@media (max-height: 480px) and (max-width: 900px) {
    .avi-lease-popup { max-height: 100vh; border-radius: 0; }
    .avi-lease-popup-overlay { align-items: stretch; }
}
