/**
 * Product inquiry — trigger button + modal-hosted form.
 *
 * The product page only shows the trigger button. Clicking it opens
 * a centered modal panel with the form inside. The form itself has
 * no border or card styling — the panel provides the container.
 */

.inquiry-form {
    --if-accent:  oklch(39.6% 0.145 261.4);
    --if-fg:      oklch(15% 0.030 261.4);
    --if-muted:   oklch(55% 0.050 261.4);
    --if-border:  oklch(88% 0.005 261.4);
    --if-bg:      #fff;
    --if-success: oklch(55% 0.18 152);
    --if-error:   oklch(58% 0.20 25);

    margin: 1.5rem 0;
}

/* ---------- Trigger button ---------- */

.inquiry-form__trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: 0;
    border-radius: 999px;
    background: var(--if-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.05s ease;
}

.inquiry-form__trigger:hover {
    background: color-mix(in oklch, var(--if-accent) 88%, black);
}

.inquiry-form__trigger:active {
    transform: translateY(1px);
}

.inquiry-form__trigger:focus-visible {
    outline: 3px solid color-mix(in oklch, var(--if-accent) 35%, transparent);
    outline-offset: 2px;
}

/* ---------- Modal ---------- */

.inquiry-form__modal {
    position: fixed;
    inset: 0;
    /* Above the sticky header (z:1020) so the modal overlay actually
       covers the navigation when open. */
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(20, 30, 55, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.18s ease-out;
}

.inquiry-form__modal.is-open {
    opacity: 1;
}

.inquiry-form__panel {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--if-bg);
    border-radius: 18px;
    padding: 24px;
    box-shadow:
        0 24px 60px -16px rgba(20, 30, 55, 0.30),
        0 8px 16px -8px rgba(20, 30, 55, 0.15);
    transform: translateY(12px);
    transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
}

.inquiry-form__modal.is-open .inquiry-form__panel {
    transform: translateY(0);
}

body.inquiry-form-open {
    overflow: hidden;
}

.inquiry-form__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--if-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.inquiry-form__close:hover,
.inquiry-form__close:focus-visible {
    background: color-mix(in oklch, var(--if-fg) 6%, transparent);
    color: var(--if-fg);
    outline: none;
}

/* ---------- Form (no border — the modal panel provides the surface) ---------- */

.inquiry-form__header {
    margin-bottom: 16px;
    padding-right: 36px;
}

.inquiry-form__title {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--if-fg);
}

.inquiry-form__sub {
    margin: 0;
    font-size: 0.85rem;
    color: var(--if-muted);
    line-height: 1.4;
}

.inquiry-form__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inquiry-form__row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inquiry-form__row--two {
    flex-direction: row;
}

@media (max-width: 540px) {
    .inquiry-form__row--two { flex-direction: column; }
}

.inquiry-form__field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inquiry-form__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--if-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.inquiry-form__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--if-border);
    border-radius: 10px;
    background: var(--if-bg);
    color: var(--if-fg);
    font: inherit;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.inquiry-form__input:focus {
    outline: none;
    border-color: color-mix(in oklch, var(--if-accent) 50%, transparent);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--if-accent) 12%, transparent);
}

.inquiry-form__input.is-invalid {
    border-color: var(--if-error);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--if-error) 12%, transparent);
}

.inquiry-form__textarea {
    resize: vertical;
    min-height: 96px;
}

.inquiry-form__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.inquiry-form__submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 0;
    border-radius: 999px;
    background: var(--if-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.inquiry-form__submit:hover:not(:disabled) {
    background: color-mix(in oklch, var(--if-accent) 88%, black);
}

.inquiry-form__submit:disabled {
    opacity: 0.6;
    cursor: progress;
}

.inquiry-form__spinner {
    display: none;
    width: 16px;
    height: 16px;
    animation: if-spin 0.8s linear infinite;
}

.inquiry-form__form.is-submitting .inquiry-form__spinner {
    display: inline-block;
}

@keyframes if-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Feedback ---------- */

.inquiry-form__feedback {
    margin: 4px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.875rem;
    line-height: 1.4;
}

.inquiry-form__feedback.is-success {
    background: color-mix(in oklch, var(--if-success) 12%, transparent);
    color: color-mix(in oklch, var(--if-success) 80%, black);
}

.inquiry-form__feedback.is-error {
    background: color-mix(in oklch, var(--if-error) 12%, transparent);
    color: color-mix(in oklch, var(--if-error) 80%, black);
}

/* Honeypot — visually hidden but still in the DOM and accessible to
   bot crawlers that auto-fill every visible input. Avoids `display:
   none` and `visibility: hidden` which sophisticated bots skip. */
.inquiry-form__honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    left: -10000px;
}

/* ---------- Success state ---------- */
/*
 * The success view replaces the entire form. The check icon draws
 * itself in (circle then tick), then the title and message fade up
 * with a small stagger.
 */

.inquiry-form__panel.is-sent .inquiry-form__form,
.inquiry-form__panel.is-sent .inquiry-form__header {
    display: none;
}

.inquiry-form__success {
    text-align: center;
    padding: 16px 8px 8px;
    animation: if-fade 0.3s ease-out;
}

.inquiry-form__success-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 16px;
    display: block;
    color: var(--if-success);
    transform: scale(0);
    animation: if-pop 0.45s cubic-bezier(0.2, 1.2, 0.5, 1.05) 0.05s forwards;
}

.inquiry-form__success-circle {
    stroke: var(--if-success);
    stroke-dasharray: 176; /* 2 * π * 28 ≈ 176 */
    stroke-dashoffset: 176;
    animation: if-draw-circle 0.55s ease-out 0.15s forwards;
}

.inquiry-form__success-check {
    stroke: var(--if-success);
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: if-draw-check 0.4s ease-out 0.55s forwards;
}

/* Soft halo behind the check — pulses once when the icon lands. */
.inquiry-form__success-icon::before {
    /* SVG can't have ::before; the halo is achieved with an extra
       circle below using box-shadow on a wrapping element if needed.
       Keeping the icon clean for now — the staged drawing is enough. */
}

.inquiry-form__success-title {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--if-fg);
    opacity: 0;
    transform: translateY(8px);
    animation: if-rise 0.4s ease-out 0.7s forwards;
}

.inquiry-form__success-text {
    margin: 0 auto;
    max-width: 36ch;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--if-muted);
    opacity: 0;
    transform: translateY(8px);
    animation: if-rise 0.4s ease-out 0.85s forwards;
}

@keyframes if-pop {
    0%   { transform: scale(0)    rotate(-15deg); }
    60%  { transform: scale(1.08) rotate(0); }
    100% { transform: scale(1)    rotate(0); }
}

@keyframes if-draw-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes if-draw-check {
    to { stroke-dashoffset: 0; }
}

@keyframes if-rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes if-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .inquiry-form__success-icon,
    .inquiry-form__success-circle,
    .inquiry-form__success-check,
    .inquiry-form__success-title,
    .inquiry-form__success-text {
        animation: none;
        transform: none;
        opacity: 1;
        stroke-dashoffset: 0;
    }
}
