/* ============================================================
   Global contact form
   ------------------------------------------------------------
   Markup:    resources/views/frontend/inc/contact-form.blade.php
   Behaviour: public/frontend/js/contact-form.js
   Self-contained and mobile-first; sits inside any card or section.
   ============================================================ */

.cf {
    --cf-blue: #2563eb;
    --cf-blue-d: #1d4ed8;
    --cf-ink: #0f172a;
    --cf-text: #475569;
    --cf-muted: #64748b;
    --cf-line: #dbe3ef;
    --cf-soft: #f5f8fe;
    --cf-red: #dc2626;
    --cf-green: #16a34a;
    --cf-orange: #f97316;
    position: relative;
    color: var(--cf-text);
    /* #contact-form links stop below the sticky header */
    scroll-margin-top: 90px;
}
.cf *, .cf *::before, .cf *::after { box-sizing: border-box; }
.cf [hidden] { display: none !important; }
.cf a { text-decoration: none; }

.cf-head { padding-bottom: 18px; }
.cf-title { margin: 0 0 6px; font-size: 1.35rem; font-weight: 900; line-height: 1.25; color: var(--cf-ink); }
.cf-subtitle { margin: 0; font-size: 14.5px; line-height: 1.6; }

.cf-form { display: grid; gap: 18px; margin: 0; }
.cf-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.cf-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}
.cf-alert i { margin-top: 3px; }
.cf-alert--info { border-color: #bfdbfe; background: #eff6ff; color: #1e40af; }

.cf-label { display: block; margin: 0 0 7px; font-size: 13.5px; font-weight: 800; line-height: 1.4; color: var(--cf-ink); }
.cf-label small { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--cf-muted); }
.cf-label b { color: var(--cf-blue); }
.cf-req { color: var(--cf-red); }

.cf-types,
.cf-methods { min-width: 0; margin: 0; padding: 0; border: 0; }
.cf-types legend,
.cf-methods legend { float: none; width: auto; padding: 0; font-size: 13.5px; }

/* Enquiry type chips */
.cf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-chip { position: relative; margin: 0; cursor: pointer; }
.cf-chip input,
.cf-seg input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cf-chip span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--cf-line);
    border-radius: 999px;
    background: #fff;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--cf-ink);
    transition: border-color .2s, background-color .2s, box-shadow .2s, color .2s;
}
.cf-chip span i { color: var(--cf-muted); transition: color .2s; }
.cf-chip:hover span { border-color: #b8c8e6; }
.cf-chip input:checked + span { border-color: var(--cf-blue); background: #eff5ff; color: var(--cf-blue-d); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.cf-chip input:checked + span i { color: var(--cf-blue); }
.cf-chip input:focus-visible + span,
.cf-seg input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }

/* Inputs */
.cf-grid { display: grid; gap: 16px 14px; }
.cf-field { min-width: 0; }
.cf-input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1.5px solid var(--cf-line);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: var(--cf-ink);
    appearance: none;
    transition: border-color .2s, box-shadow .2s;
}
.cf-input::placeholder { color: #94a3b8; }
.cf-input:hover { border-color: #b8c8e6; }
.cf-input:focus { outline: 0; border-color: var(--cf-blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
.cf-input.is-invalid { border-color: var(--cf-red); box-shadow: 0 0 0 4px rgba(220, 38, 38, .1); }
.cf-textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.cf-input[type="number"]::-webkit-inner-spin-button,
.cf-input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.cf-input[type="number"] { -moz-appearance: textfield; }

.cf-error { margin: 6px 0 0; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--cf-red); }
.cf-error:empty { display: none; }
.cf-help-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 12.5px; line-height: 1.45; color: var(--cf-muted); }
.cf-count { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.cf-count.is-near { color: var(--cf-orange); font-weight: 700; }

/* Reply method segmented control */
.cf-segment { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 100%; padding: 4px; border: 1px solid var(--cf-line); border-radius: 14px; background: var(--cf-soft); }
.cf-seg { position: relative; margin: 0; cursor: pointer; }
.cf-seg span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--cf-text);
    transition: background-color .2s, color .2s, box-shadow .2s;
}
.cf-seg:hover span { color: var(--cf-ink); }
.cf-seg input:checked + span { background: #fff; color: var(--cf-blue-d); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.cf-seg input:checked + span .fa-whatsapp { color: var(--cf-green); }

/* Attachments */
.cf-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 118px;
    padding: 18px;
    border: 2px dashed #c9d6ea;
    border-radius: 14px;
    background: var(--cf-soft);
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
    color: var(--cf-text);
    transition: border-color .2s, background-color .2s;
}
.cf-drop > i { margin-bottom: 4px; font-size: 26px; color: var(--cf-blue); }
.cf-drop b { color: var(--cf-ink); }
.cf-drop u { color: var(--cf-blue); }
.cf-drop small { font-size: 12px; color: var(--cf-muted); }
.cf-drop:hover,
.cf-drop.is-over,
.cf-drop:focus-within { border-color: var(--cf-blue); background: #eff5ff; }
.cf-drop:focus-within { box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
.cf-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.cf-files { display: grid; gap: 6px; margin: 0; padding: 10px 0 0; list-style: none; }
.cf-files:empty { display: none; }
.cf-files li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--cf-line); border-radius: 10px; background: #fff; font-size: 13.5px; }
.cf-files li > i { color: var(--cf-muted); }
.cf-file__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--cf-ink); }
.cf-files small { flex-shrink: 0; color: var(--cf-muted); }
.cf-file__remove { width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--cf-muted); cursor: pointer; }
.cf-file__remove:hover { background: #fef2f2; color: var(--cf-red); }

/* Math quick check */
.cf-captcha { display: flex; gap: 8px; }
.cf-captcha .cf-input { max-width: 170px; }
.cf-icon-btn {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1.5px solid var(--cf-line);
    border-radius: 12px;
    background: #fff;
    color: var(--cf-text);
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.cf-icon-btn:hover { border-color: var(--cf-blue); color: var(--cf-blue); }
.cf-icon-btn:focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
.cf-icon-btn.is-spinning i { animation: cf-spin .5s linear; }

/* Submit */
.cf-submit-row { display: grid; gap: 12px; }
.cf-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    padding: 0 28px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(249, 115, 22, .3);
    transition: transform .2s, box-shadow .2s, filter .2s;
}
.cf-submit:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(249, 115, 22, .36); }
.cf-submit:focus-visible { outline: 3px solid rgba(249, 115, 22, .5); outline-offset: 3px; }
.cf-submit:disabled { cursor: wait; filter: saturate(.85); transform: none; }
.cf-submit__idle,
.cf-submit__busy { display: inline-flex; align-items: center; gap: 10px; }
.cf-submit__busy,
.cf-submit.is-busy .cf-submit__idle { display: none; }
.cf-submit.is-busy .cf-submit__busy { display: inline-flex; }
.cf-note { display: flex; gap: 8px; margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--cf-muted); }
.cf-note i { margin-top: 3px; color: var(--cf-green); }
.cf-note a { margin-left: 2px; font-weight: 700; color: var(--cf-blue); }

/* Success */
.cf-success { padding: 12px 0 4px; text-align: center; outline: 0; }
.cf-success__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #dcfce7;
    color: var(--cf-green);
    font-size: 28px;
    box-shadow: 0 0 0 10px rgba(22, 163, 74, .08);
    animation: cf-pop .4s ease;
}
.cf-success h3 { margin: 0 0 8px; font-size: 1.4rem; font-weight: 900; line-height: 1.3; color: var(--cf-ink); }
.cf-success p { max-width: 460px; margin: 0 auto 12px; line-height: 1.6; }
.cf-success__ref { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px dashed #86efac; border-radius: 999px; background: #f0fdf4; color: #166534; font-size: 14px; }
.cf-success__ref b { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
/* inline-grid keeps the list centred without relying on margins (the site resets list margins) */
.cf-success__steps { display: inline-grid; gap: 8px; max-width: 420px; margin: 0; padding: 16px 0 22px; list-style: none; counter-reset: cf-step; text-align: left; }
.cf-success__steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--cf-ink); counter-increment: cf-step; }
.cf-success__steps li::before {
    content: counter(cf-step);
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eff5ff;
    color: var(--cf-blue);
    font-size: 12px;
    font-weight: 800;
}
.cf-success__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.cf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.cf-btn--wa { border: 0; background: var(--cf-green); color: #fff !important; }
.cf-btn--wa:hover { background: #15803d; }
.cf-btn--ghost { border: 1.5px solid var(--cf-line); background: #fff; color: var(--cf-ink); }
.cf-btn--ghost:hover { border-color: var(--cf-blue); color: var(--cf-blue); }


/* Hire Us variant: ways of working + selects */
.cf-options { display: grid; gap: 8px; }
.cf-option { position: relative; margin: 0; cursor: pointer; }
.cf-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cf-option > span {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    height: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--cf-line);
    border-radius: 14px;
    background: #fff;
    transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.cf-option > span > i {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--cf-soft);
    color: var(--cf-muted);
    font-size: 14px;
    transition: background-color .2s, color .2s;
}
.cf-option b { display: block; font-size: 14px; font-weight: 800; line-height: 1.3; color: var(--cf-ink); }
.cf-option small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--cf-muted); }
.cf-option:hover > span { border-color: #b8c8e6; }
.cf-option input:checked + span { border-color: var(--cf-blue); background: #eff5ff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.cf-option input:checked + span > i { background: var(--cf-blue); color: #fff; }
.cf-option input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
.cf-select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 12 8%27%3E%3Cpath fill=%27none%27 stroke=%27%2364748b%27 stroke-width=%271.8%27 d=%27M1 1.5l5 5 5-5%27/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    cursor: pointer;
}
@media (min-width: 576px) {
    .cf-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Optional wrapper when the form is placed on a plain section */
.cf-card { padding: 22px 18px; border: 1px solid #e6ebf3; border-radius: 22px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 44px rgba(15, 23, 42, .08); text-align: left; }
@media (min-width: 768px) { .cf-card { padding: 32px; } }

@keyframes cf-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes cf-spin { to { transform: rotate(360deg); } }

@media (min-width: 576px) {
    .cf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cf-submit-row { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; }
    .cf-submit { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .cf *, .cf *::before, .cf *::after { transition: none !important; animation: none !important; }
}
