/* ============================================================================
 * ARECH Contact Form block — view.css
 *
 * Modern minimalist 2-mode form (Contact / Request a quote). Inspired by
 * the airy underlined-input pattern (colorlib contact-form-05 reference).
 * Light card on the page's dark background, two-column desktop with a
 * factory image on the right.
 *
 * Class prefix: .acf- (ARECH Contact Form) to scope cleanly and avoid
 * collision with the legacy .field / .form-grid / .form-panel rules in
 * application/themes/arech/css/forms.css.
 *
 * Container queries are used for the form layout switch (480px / 720px)
 * so the block adapts whether dropped in a narrow sidebar or a wide
 * hero — independent of viewport.
 *
 * Reduced motion: all transitions disabled.
 * ============================================================================ */

.acf-section {
    container-type: inline-size;
    container-name: acfsection;
    padding-block: var(--space-7, 48px);
    color: var(--ink-1, #0a0a0b);
}

.acf-grid {
    display: grid;
    gap: var(--space-6, 32px);
    grid-template-columns: 1fr;
    /* S69 — align to the single site container + standard gutter so the
       form block starts at the SAME left edge as every other section
       (was max-width 1280 + 24px padding → started ~88px further right). */
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--container-px);
}

@container acfsection (min-width: 1024px) {
    .acf-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        gap: var(--space-7, 48px);
        align-items: stretch;
    }
}

/* ---------- Card ---------- */

.acf-card {
    background: var(--paper-0, #ffffff);
    border-radius: var(--radius-md);
    padding: var(--space-6, 32px);
    box-shadow:
        0 1px 2px rgba(10, 10, 11, 0.04),
        0 12px 32px rgba(10, 10, 11, 0.08);
}

@container acfsection (min-width: 768px) {
    .acf-card {
        padding: var(--space-7, 48px);
    }
}

@container acfsection (min-width: 1024px) {
    .acf-card {
        padding: var(--space-7, 48px) var(--space-8, 64px);
    }
}

.acf-card__header {
    margin-bottom: var(--space-6, 32px);
}

.acf-eyebrow {
    font-family: var(--font-mono, 'DM Mono', ui-monospace, monospace);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--orange-link, #b84a0c);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-3, 12px);
}
.acf-eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--orange-dim, #c4510e);
}

.acf-h2 {
    font-family: var(--font-display, 'General Sans', system-ui, sans-serif);
    font-weight: 600;
    font-size: clamp(26px, 3.2vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.005em;
    color: var(--ink-1, #0a0a0b);
    margin: 0 0 var(--space-3, 12px) 0;
}

.acf-lead {
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--ink-3, #54545a);
    max-width: 52ch;
    margin: 0;
}

/* ---------- Tabs (segmented control) ---------- */

.acf-tabs {
    display: inline-flex;
    background: var(--paper-2, #edece7);
    border-radius: var(--radius-pill);
    padding: 4px;
    margin-bottom: var(--space-6, 32px);
    gap: 2px;
}

.acf-tab {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 9px 18px;
    /* Touch target: guarantee 44px independent of theme GAP-2. */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ink-3, #54545a);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}
.acf-tab:hover {
    color: var(--ink-2, #2a2a2d);
}
.acf-tab.is-active {
    background: var(--ink-1, #0a0a0b);
    color: var(--paper-0, #ffffff);
}
.acf-tab:focus-visible {
    outline: 2px solid var(--orange, #e8651a);
    outline-offset: 2px;
}

/* ---------- Form grid ---------- */

.acf-form {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: var(--space-5, 24px);
    row-gap: var(--space-4, 16px);
}

@container acfsection (min-width: 480px) {
    .acf-form {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- Fields (underlined style) ---------- */

.acf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.acf-field--full,
.acf-field--message,
.acf-actions {
    grid-column: 1 / -1;
}

.acf-field label {
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-3, #54545a);
}

.acf-req {
    color: var(--orange-link, #b84a0c);
    font-weight: 700;
    margin-inline-start: 2px;
}

.acf-field input[type='text'],
.acf-field input[type='email'],
.acf-field input[type='tel'],
.acf-field input[type='url'],
.acf-field textarea,
.acf-field select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 10px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--hairline-strong, rgba(10, 10, 11, 0.18));
    border-radius: 0;
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ink-1, #0a0a0b);
    transition: border-color 150ms ease, background-color 150ms ease;
}

.acf-field input::placeholder,
.acf-field textarea::placeholder {
    color: var(--ink-4, #5f5f69);
    opacity: 1;
}

.acf-field input:hover,
.acf-field textarea:hover,
.acf-field select:hover {
    border-bottom-color: var(--ink-3, #54545a);
}

.acf-field input:focus-visible,
.acf-field textarea:focus-visible,
.acf-field select:focus-visible {
    outline: none;
    border-bottom-color: var(--orange, #e8651a);
    border-bottom-width: 2px;
    margin-bottom: -1px; /* keep total height stable */
}

.acf-field textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.55;
}

/* ---------- Select wrap (custom chevron) ---------- */

.acf-select-wrap {
    position: relative;
}
.acf-select-wrap::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 50%;
    width: 10px;
    height: 6px;
    transform: translateY(-50%);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2354545A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    pointer-events: none;
}
.acf-select-wrap select {
    padding-right: 24px;
    cursor: pointer;
}

/* ---------- Quote-only fields hide/show by mode ---------- */

.acf-section[data-form-mode='contact'] .acf-field--quote-only {
    display: none;
}

/* Quote mode auto-routes to Sales department -- hide the dropdown
 * (server still forces department='sales' regardless of DOM value). */
.acf-section[data-form-mode='quote'] .acf-field--department {
    display: none;
}

/* ---------- Honeypot decoy: visually hidden via clip (NOT display:none) ---------- */

.acf-decoy {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    pointer-events: none;
}

/* ---------- Error messages ---------- */

.acf-error {
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    font-size: 12px;
    color: var(--error-ink, #8c2a14);
    margin-top: 2px;
}

.acf-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4, 16px);
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    font-size: 14px;
    line-height: 1.55;
}
.acf-alert--error {
    background: var(--error-bg, #fbeae5);
    border: 1px solid var(--error-border, rgba(140, 42, 20, 0.2));
    color: var(--error-ink, #8c2a14);
}

/* ---------- T&C checkbox row (above Submit) ---------- */

.acf-tc {
    margin-top: var(--space-3, 12px);
}

.acf-tc__label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    /* Touch target: 44px-tall hit area independent of theme GAP-2. */
    min-height: 44px;
    cursor: pointer;
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-3, #54545a);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.acf-tc__checkbox {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    inline-size: 18px;
    block-size: 18px;
    margin: 0;
    margin-block-start: 1px;
    border: 1.5px solid var(--hairline-strong, rgba(10, 10, 11, 0.18));
    border-radius: var(--radius-sm);
    background: var(--paper-0, #ffffff);
    cursor: pointer;
    position: relative;
    transition: border-color 150ms ease, background-color 150ms ease;
}
.acf-tc__checkbox:hover {
    border-color: var(--orange, #e8651a);
}
.acf-tc__checkbox:checked {
    background: var(--orange, #e8651a);
    border-color: var(--orange, #e8651a);
}
.acf-tc__checkbox:checked::after {
    content: '';
    position: absolute;
    inset-block-start: 1px;
    inset-inline-start: 5px;
    inline-size: 5px;
    block-size: 9px;
    border-inline-end: 2px solid #fff;
    border-block-end: 2px solid #fff;
    transform: rotate(45deg);
}
.acf-tc__checkbox:focus-visible {
    outline: 2px solid var(--orange, #e8651a);
    outline-offset: 2px;
}

.acf-tc__text a {
    color: var(--orange-link, #b84a0c);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.acf-tc__text a:hover {
    color: var(--orange, #e8651a);
}

/* ---------- Cloudflare Turnstile widget wrapper ---------- */

.acf-turnstile {
    margin-block-start: var(--space-3, 12px);
    min-block-size: 65px; /* reserve space so layout doesn't jump when widget loads */
}

/* CF widget iframe is rendered by their api.js inside .cf-turnstile div.
 * In Invisible mode shows nothing; in Managed mode shows a 300x65 box.
 * We let it size naturally; just give it room. */
.acf-turnstile .cf-turnstile {
    display: block;
}

/* ---------- Actions row (Submit + hint) ---------- */

.acf-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4, 16px);
    margin-top: var(--space-4, 16px);
    padding-top: var(--space-5, 24px);
    border-top: 1px solid var(--hairline, rgba(10, 10, 11, 0.1));
}

.acf-submit {
    appearance: none;
    border: 0;
    background: var(--ink-1, #0a0a0b);
    color: var(--paper-0, #ffffff);
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 13px 22px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background-color 150ms ease, transform 150ms ease, opacity 150ms ease;
}
.acf-submit:not(:disabled):hover,
.acf-submit:not(:disabled):focus-visible {
    background: var(--orange, #e8651a);
    transform: translateY(-1px);
}
.acf-submit:focus-visible {
    outline: 2px solid var(--orange, #e8651a);
    outline-offset: 3px;
}
.acf-submit:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}
.acf-submit__arrow {
    transition: transform 150ms ease;
}
.acf-submit:hover .acf-submit__arrow {
    transform: translateX(3px);
}

.acf-actions__hint {
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    font-size: 13px;
    color: var(--ink-3, #54545a);
    margin: 0;
}

/* ---------- Success state ---------- */

.acf-thanks {
    padding: var(--space-5, 24px);
    background: var(--success-bg, #e6f3eb);
    border: 1px solid var(--success-border, rgba(27, 94, 44, 0.2));
    border-radius: var(--radius-md);
    color: var(--success-ink, #1b5e2c);
}
.acf-thanks__h3 {
    font-family: var(--font-display, 'General Sans', system-ui, sans-serif);
    font-weight: 600;
    font-size: 22px;
    line-height: 1.2;
    margin: 0 0 var(--space-3, 12px) 0;
    color: inherit;
}
.acf-thanks__body {
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    font-size: 15px;
    line-height: 1.55;
    margin: 0 0 var(--space-3, 12px) 0;
    color: inherit;
}
.acf-thanks__body a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.acf-thanks__restart {
    display: inline-flex;
    align-items: center;
    margin-top: var(--space-3, 12px);
    font-family: var(--font-mono, 'DM Mono', ui-monospace, monospace);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ---------- Image column ---------- */

.acf-image {
    display: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--ink-1, #0a0a0b);
    min-height: 480px;
    position: relative;
}

@container acfsection (min-width: 1024px) {
    .acf-image {
        display: block;
    }
}

.acf-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.acf-image__placeholder {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(232, 101, 26, 0.15), transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(232, 101, 26, 0.08), transparent 60%),
        linear-gradient(135deg, #0a0a0b 0%, #1a1a1d 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--paper-0, #ffffff);
}
.acf-image__placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0);
    background-size: 16px 16px;
    opacity: 0.4;
    pointer-events: none;
}
.acf-image__brand {
    font-family: var(--font-display, 'General Sans', system-ui, sans-serif);
    font-weight: 700;
    font-size: clamp(48px, 8cqi, 96px);
    letter-spacing: -0.02em;
    color: var(--orange, #e8651a);
    position: relative;
}
.acf-image__eyebrow {
    font-family: var(--font-mono, 'DM Mono', ui-monospace, monospace);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-4, #5f5f69);
    position: relative;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .acf-tab,
    .acf-field input,
    .acf-field textarea,
    .acf-field select,
    .acf-submit,
    .acf-submit__arrow {
        transition: none;
    }
    .acf-submit:hover {
        transform: none;
    }
    .acf-submit:hover .acf-submit__arrow {
        transform: none;
    }
}
