/* ============================================================================
   ZakERP site - the demo enquiry modal.

   Replaces a raw mailto: link. A bare mailto makes the operating system throw
   up an "choose an app" dialog before the visitor has written a word, and a
   good proportion of people abandon there. This composes the enquiry first,
   then offers three ways to send it - one of which (copy) needs no app at all.
   ========================================================================== */

.enq-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: grid; place-items: center; padding: 1.2rem;
    background: rgba(6, 5, 14, .72);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.enq-overlay.open { opacity: 1; pointer-events: auto; }
.enq-overlay[hidden] { display: none; }

.enq {
    width: min(100%, 720px); max-height: min(92vh, 900px);
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface-solid); border: 1px solid var(--border-strong);
    border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
    transform: translateY(14px) scale(.985);
    transition: transform .3s var(--ease);
}
:root[data-theme="light"] .enq { background: #fff; }
.enq-overlay.open .enq { transform: none; }

/* ---------------------------------------------------------------- header -- */
.enq-head {
    display: flex; align-items: flex-start; gap: 1rem;
    padding: 1.4rem 1.5rem 1.1rem; border-bottom: 1px solid var(--border);
}
.enq-head h2 { font-size: 1.3rem; margin: 0 0 .25rem; }
.enq-head p { font-size: .9rem; margin: 0; }
.enq-close {
    margin-left: auto; flex-shrink: 0;
    width: 34px; height: 34px; border-radius: var(--r-sm);
    display: grid; place-items: center; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2);
    transition: all .2s;
}
.enq-close:hover { color: var(--ink); border-color: var(--border-strong); }

/* ------------------------------------------------------------------ body -- */
.enq-body { padding: 1.3rem 1.5rem; overflow-y: auto; flex: 1; }
.enq-body::-webkit-scrollbar { width: 9px; }
.enq-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }

.enq-sec + .enq-sec { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px dashed var(--border); }
.enq-sec > h3 {
    font-family: var(--font); font-size: .74rem; letter-spacing: .13em; text-transform: uppercase;
    color: var(--ink-3); font-weight: 700; margin-bottom: .9rem;
    display: flex; align-items: center; gap: .5rem;
}
.enq-sec > h3 i { font-size: .95rem; color: var(--brand-light); }
:root[data-theme="light"] .enq-sec > h3 i { color: var(--brand-dark); }

/* ---------------------------------------------------------------- fields -- */
.enq-grid { display: grid; gap: .8rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .enq-grid { grid-template-columns: 1fr; } }
.enq-field { display: grid; gap: .32rem; }
.enq-field.full { grid-column: 1 / -1; }
.enq-field label { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.enq-field label .opt { font-weight: 400; color: var(--ink-3); }

.enq-input {
    width: 100%; padding: .62rem .8rem; border-radius: var(--r-sm);
    border: 1px solid var(--border); background: var(--surface); color: var(--ink);
    font-size: .93rem; transition: border-color .2s, background .2s;
}
:root[data-theme="light"] .enq-input { background: var(--bg-2); }
.enq-input::placeholder { color: var(--ink-3); }
.enq-input:focus { outline: none; border-color: var(--brand); background: var(--surface-2); }
textarea.enq-input { resize: vertical; min-height: 92px; line-height: 1.6; }

/* ------------------------------------------------------- feature picker -- */
.enq-pick { position: relative; }
.enq-pick > i.bi-search {
    position: absolute; left: .72rem; top: .72rem; color: var(--ink-3); font-size: .95rem; pointer-events: none;
}
.enq-pick .enq-input { padding-left: 2.2rem; }

.enq-sugg {
    position: absolute; z-index: 5; inset: calc(100% + .4rem) 0 auto 0;
    max-height: 230px; overflow-y: auto; padding: .3rem;
    background: var(--surface-solid); border: 1px solid var(--border-strong);
    border-radius: var(--r); box-shadow: var(--shadow-lg);
}
:root[data-theme="light"] .enq-sugg { background: #fff; }
.enq-sugg[hidden] { display: none; }
.enq-sugg button {
    display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
    padding: .5rem .65rem; border: 0; border-radius: var(--r-sm);
    background: none; cursor: pointer; color: var(--ink); font-size: .9rem;
}
.enq-sugg button:hover, .enq-sugg button.sel { background: var(--surface-2); }
.enq-sugg button .grp {
    margin-left: auto; font-size: .72rem; color: var(--ink-3);
    border: 1px solid var(--border); padding: .1rem .45rem; border-radius: var(--r-full);
}
.enq-sugg .none { padding: .75rem .65rem; font-size: .86rem; color: var(--ink-3); }

/* quick suggestion row shown before typing */
.enq-quick { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.enq-quick button {
    font-size: .8rem; padding: .3rem .7rem; border-radius: var(--r-full); cursor: pointer;
    background: none; border: 1px dashed var(--border-strong); color: var(--ink-2);
    transition: all .2s;
}
.enq-quick button:hover { color: var(--brand-light); border-color: var(--brand); border-style: solid; }
:root[data-theme="light"] .enq-quick button:hover { color: var(--brand-dark); }

/* chosen items */
.enq-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .8rem; }
.enq-chips:empty { display: none; }
.enq-chip {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .84rem; font-weight: 500; padding: .32rem .4rem .32rem .7rem;
    border-radius: var(--r-full); color: var(--brand-light);
    background: color-mix(in srgb, var(--brand) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
}
:root[data-theme="light"] .enq-chip { color: var(--brand-dark); }
.enq-chip button {
    display: grid; place-items: center; width: 18px; height: 18px; padding: 0;
    border: 0; border-radius: 50%; cursor: pointer; font-size: .7rem;
    background: color-mix(in srgb, var(--brand) 24%, transparent); color: inherit;
}
.enq-chip button:hover { background: var(--rose); color: #fff; }

/* ---------------------------------------------------------------- preview */
.enq-prev summary {
    cursor: pointer; list-style: none; font-size: .84rem; font-weight: 600; color: var(--ink-2);
    display: flex; align-items: center; gap: .45rem;
}
.enq-prev summary::-webkit-details-marker { display: none; }
.enq-prev summary::before { content: "\25B8"; transition: transform .25s var(--ease); font-size: .8rem; }
.enq-prev[open] summary::before { transform: rotate(90deg); }
.enq-prev pre {
    margin-top: .7rem; padding: .9rem 1rem; border-radius: var(--r-sm);
    background: var(--code-bg); border: 1px solid var(--code-border);
    color: rgba(255,255,255,.86); font-family: var(--font-mono); font-size: .78rem;
    line-height: 1.65; white-space: pre-wrap; word-break: break-word;
    max-height: 220px; overflow-y: auto;
}

/* ---------------------------------------------------------------- footer -- */
.enq-foot {
    padding: 1.1rem 1.5rem 1.3rem; border-top: 1px solid var(--border);
    background: var(--surface); display: grid; gap: .8rem;
}
:root[data-theme="light"] .enq-foot { background: var(--bg-2); }
.enq-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.enq-actions .btn { flex: 1 1 auto; min-width: 140px; }
.enq-actions .btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.enq-hint { font-size: .8rem; color: var(--ink-3); margin: 0; line-height: 1.55; }
.enq-hint b { color: var(--ink-2); }

.enq-flash {
    display: flex; align-items: center; gap: .5rem;
    font-size: .85rem; font-weight: 600; color: var(--mint);
    opacity: 0; transform: translateY(-4px); transition: all .25s var(--ease);
}
.enq-flash.show { opacity: 1; transform: none; }

@media (max-width: 560px) {
    .enq-overlay { padding: 0; align-items: end; }
    .enq { max-height: 96vh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
    .enq-head, .enq-body, .enq-foot { padding-inline: 1.1rem; }
    .enq-actions .btn { flex: 1 1 100%; }
}

/* the real submit, above the three self-send fallbacks */
.enq-submit { width: 100%; justify-content: center; }
.enq-submit[disabled] { opacity: .55; cursor: default; pointer-events: none; }
.enq-flash.bad { color: var(--rose); }
