/* =========================================================
   Bizmantra - Enquiry form (reusable)
   assets/css/enquiry-form.css?v=1
   Wrapper .bmf is a container: layout reacts to the width
   of the place where you put the form, not the screen.
   ========================================================= */
.bmf {
    --f-card: #FFFFFF;                 /* solid: label patch must match it */
    --f-shadow: 0 22px 44px -28px rgba(31,53,115,.35);
    --f-line: #C9D4EC;
    --f-ph: #8A96B0;
    --f-sub: #4F5D7A;
    --f-fh: 54px;                      /* field height */

    container: bmf / inline-size;
    width: 100%; min-width: 0;
    background: none; box-shadow: none; border: 0;   /* wrapper is invisible */
    color: var(--bm-text);
    font-family: var(--bm-font, 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif);
}
:root[data-theme="dark"] .bmf {
    --f-card: #141E3D;
    --f-shadow: 0 22px 44px -24px rgba(0,0,0,.65);
    --f-line: rgba(143,176,255,.30);
    --f-ph: #7F8DB1;
    --f-sub: #B4C1E0;
}

/* Resets use :where() so they never beat the component classes */
:where(.bmf) *, :where(.bmf) *::before, :where(.bmf) *::after { box-sizing: border-box; }
:where(.bmf) h2, :where(.bmf) p { margin: 0; }
:where(.bmf) a { color: inherit; text-decoration: none; }
:where(.bmf) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(.bmf) svg { display: block; flex: none; }
.bmf :focus-visible { outline: 2px solid var(--bm-blue-d); outline-offset: 2px; border-radius: 8px; }

/* ---------------- CARD ---------------- */
.bmf__form {
    position: relative; overflow: hidden;
    padding: clamp(22px, 3.4vh, 32px) clamp(18px, 2.5vw, 32px) clamp(20px, 3vh, 28px);
    border-radius: 0;
    background: var(--f-card); border: 1px solid var(--bm-line); box-shadow: var(--f-shadow);
}
.bmf__form::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
    background: linear-gradient(90deg, var(--bm-blue), var(--bm-green));
}
/* variant: no card look (use inside your own box) */
.bmf--flat .bmf__form { padding: 0; border: 0; box-shadow: none; background: transparent; }
.bmf--flat .bmf__form::before { display: none; }

.bmf__title { font-size: clamp(20px, 3vh, 24px); font-weight: 800; letter-spacing: -.02em; color: var(--bm-head); }
.bmf__sub { margin-top: 4px; margin-bottom: clamp(18px, 3vh, 26px); font-size: 14px; line-height: 1.5; color: var(--f-sub); }

/* ---------------- FIELDS ---------------- */
.bmf-f { margin-bottom: clamp(16px, 2.6vh, 20px); min-width: 0; }
.bmf-f__opt { font-weight: 400; opacity: .75; }
.bmf-f__ctl { position: relative; }

.bmf-f__ic {
    position: absolute; left: 15px; top: calc(var(--f-fh) / 2); transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--bm-blue-d); opacity: .75; pointer-events: none;
    transition: opacity .2s, color .2s;
}
.bmf-f__ctl:focus-within .bmf-f__ic { opacity: 1; color: var(--bm-blue); }
.bmf-f__ctl--area .bmf-f__ic { top: 27px; }

.bmf-f input, .bmf-f select, .bmf-f textarea {
    display: block; width: 100%; border-radius: 12px;
    border: 1.5px solid var(--f-line); background-color: transparent; color: var(--bm-head);
    font: inherit; font-size: 15px; font-weight: 500; line-height: 1.4;
    transition: border-color .18s;
}
.bmf-f input, .bmf-f select { height: var(--f-fh); padding: 0 14px 0 46px; }
.bmf-f textarea { height: clamp(84px, 11.5vh, 104px); padding: 16px 14px 12px 46px; line-height: 1.5; resize: none; }

.bmf-f input:focus, .bmf-f select:focus, .bmf-f textarea:focus {
    outline: none; border-color: var(--bm-blue); box-shadow: none;
}
.bmf-f select {
    appearance: none; -webkit-appearance: none; padding-right: 40px; text-overflow: ellipsis; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A96B0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.bmf-f select option { color: #1B2A52; background: #fff; }
:root[data-theme="dark"] .bmf-f select option { color: #E6ECFF; background: #14203F; }

/* keep Chrome autofill inside the theme */
.bmf-f input:-webkit-autofill,
.bmf-f input:-webkit-autofill:hover,
.bmf-f input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--bm-head);
    -webkit-box-shadow: 0 0 0 40px var(--f-card) inset;
            box-shadow: 0 0 0 40px var(--f-card) inset;
    caret-color: var(--bm-head);
}

/* ---------- FLOATING LABEL ---------- */
.bmf-f .bmf-f__lbl {
    position: absolute; left: 40px; top: calc(var(--f-fh) / 2);
    display: block; margin: 0; padding: 0 6px; max-width: calc(100% - 54px);
    font-size: 15px; font-weight: 500; line-height: 1.2; color: var(--f-sub);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
    transform: translateY(-50%); transform-origin: left center;
    transition: top .18s ease, left .18s ease, transform .18s ease, color .18s ease;
}
.bmf-f__ctl--area .bmf-f__lbl { top: 27px; }

.bmf-f input:focus + .bmf-f__lbl,
.bmf-f input:not(:placeholder-shown) + .bmf-f__lbl,
.bmf-f input:-webkit-autofill + .bmf-f__lbl,
.bmf-f textarea:focus + .bmf-f__lbl,
.bmf-f textarea:not(:placeholder-shown) + .bmf-f__lbl,
.bmf-f select:focus + .bmf-f__lbl,
.bmf-f select:required:valid + .bmf-f__lbl {
    top: 0; left: 12px; max-width: calc((100% - 24px) / .82);
    transform: translateY(-50%) scale(.82); font-weight: 700; color: var(--bm-blue-d);
    background: var(--f-card);
}
.bmf--flat .bmf-f input:focus + .bmf-f__lbl,
.bmf--flat .bmf-f input:not(:placeholder-shown) + .bmf-f__lbl,
.bmf--flat .bmf-f textarea:focus + .bmf-f__lbl,
.bmf--flat .bmf-f textarea:not(:placeholder-shown) + .bmf-f__lbl,
.bmf--flat .bmf-f select:focus + .bmf-f__lbl,
.bmf--flat .bmf-f select:required:valid + .bmf-f__lbl { background: var(--bmf-flat-bg, var(--bm-bg, #fff)); }

.bmf-f input:focus + .bmf-f__lbl,
.bmf-f textarea:focus + .bmf-f__lbl,
.bmf-f select:focus + .bmf-f__lbl { color: var(--bm-blue); }
:root[data-theme="dark"] .bmf-f input:focus + .bmf-f__lbl,
:root[data-theme="dark"] .bmf-f textarea:focus + .bmf-f__lbl,
:root[data-theme="dark"] .bmf-f select:focus + .bmf-f__lbl { color: #8FB0FF; }

.bmf-f input::placeholder, .bmf-f textarea::placeholder { color: transparent; transition: color .2s; }
.bmf-f input:focus::placeholder, .bmf-f textarea:focus::placeholder { color: var(--f-ph); transition-delay: .08s; }

/* error state */
.bmf-f.is-bad input, .bmf-f.is-bad select, .bmf-f.is-bad textarea { border-color: #D64545; }
.bmf-f.is-bad .bmf-f__lbl, .bmf-f.is-bad .bmf-f__ic { color: #D64545 !important; opacity: 1; }
:root[data-theme="dark"] .bmf-f.is-bad .bmf-f__lbl,
:root[data-theme="dark"] .bmf-f.is-bad .bmf-f__ic { color: #FF8A8A !important; }
.bmf-f__err { display: block; margin-top: 6px; padding-left: 2px; font-size: 12.5px; font-weight: 500; line-height: 1.4; color: #D64545; }
:root[data-theme="dark"] .bmf-f__err { color: #FF8A8A; }
.bmf-f__err:empty { display: none; }

.bmf-f__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.bmf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------- SUBMIT ---------------- */
.bmf-submit {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 9px;
    width: 100%; min-height: clamp(50px, 6.8vh, 56px); margin-top: 6px; border-radius: 12px;
    background: linear-gradient(135deg, #A8D75E, #86B83F); color: #17306B; font-size: 15.5px; font-weight: 800;
    box-shadow: 0 14px 26px -12px rgba(134,184,63,.95);
    transition: transform .2s, box-shadow .2s, opacity .2s;
}
.bmf-submit::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); transition: left .6s; }
.bmf-submit:hover { transform: translateY(-1px); box-shadow: 0 18px 30px -12px rgba(134,184,63,1); }
.bmf-submit:hover::after { left: 120%; }
.bmf-submit svg { width: 16px; height: 16px; transition: transform .2s; }
.bmf-submit:hover svg { transform: translateX(3px); }
.bmf-submit[disabled] { opacity: .65; cursor: progress; transform: none; }

.bmf__status { margin-top: 12px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; }
.bmf__status.is-ok  { background: var(--bm-green-t); color: #2E4F0B; }
.bmf__status.is-err { background: #FDECEC; color: #8A1F1F; }
:root[data-theme="dark"] .bmf__status.is-ok  { color: #D6EDB0; }
:root[data-theme="dark"] .bmf__status.is-err { background: #4A1F28; color: #FFD0D0; }
.bmf__fine { display: flex; gap: 8px; margin-top: clamp(12px, 2vh, 18px); font-size: 12px; line-height: 1.55; color: var(--f-sub); }
.bmf__fine svg { width: 14px; height: 14px; margin-top: 2px; color: var(--bm-green-x); }
:root[data-theme="dark"] .bmf__fine svg { color: var(--bm-green); }
.bmf__fine a { color: var(--bm-blue-d); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- RESPONSIVE (by form width, not screen) ---------------- */
/* wide enough: Name + Mobile side by side, Type + Licence side by side */
@container bmf (min-width: 420px) {
    .bmf-f__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* narrow (phones, sidebars): Type + Licence stay on ONE row, compact */
@container bmf (max-width: 419px) {
    .bmf__form { padding: 26px 18px 20px; }
    .bmf-f__row--keep { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
    .bmf-f__row--keep .bmf-f__ic { display: none; }
    .bmf-f__row--keep .bmf-f select { padding-left: 14px; padding-right: 32px; font-size: 14px; background-position: right 10px center; background-size: 15px; }
    .bmf-f__row--keep .bmf-f .bmf-f__lbl { left: 8px; max-width: calc(100% - 40px); font-size: 14px; }
}

/* short laptop screens: slightly more compact */
@media (min-width: 1024px) and (max-height: 760px) {
    .bmf { --f-fh: 48px; }
    .bmf-f { margin-bottom: 14px; }
    .bmf-f textarea { height: 68px; padding-top: 13px; }
    .bmf-f__ctl--area .bmf-f__ic,
    .bmf-f__ctl--area .bmf-f__lbl { top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .bmf * { transition-duration: .01ms !important; }
}