/* ==========================================================================
   ZedHome — Contact page (public/contact.php). Everything is .cx-*.
   Page header (site standard) → contact channels overlapping it (call,
   WhatsApp, email, visit; only those set in admin Settings) → the message
   form as the main surface, with a side panel routing listing questions to
   the right place and the support hours.
   Type: Bricolage Grotesque (display, 500-600) + Manrope (body).
   ========================================================================== */

.page-header { padding-bottom: clamp(88px, 9vw, 120px); }

/* ---- Channels: cards that overlap the header ---- */
.cx-channels { position: relative; z-index: 2; margin-top: calc(-1 * clamp(56px, 6vw, 76px)); }
.cx-channels__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.cx-channel {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 14px; row-gap: 2px;
  height: 100%; padding: 20px; border-radius: 16px; background: var(--color-surface); color: inherit;
  box-shadow: 0 0 0 1px rgba(30, 27, 26, 0.06), 0 20px 44px -28px rgba(30, 27, 26, 0.45);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 300ms ease;
}
.cx-channel__icon { grid-row: 1 / span 3; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--color-brand-50); color: var(--color-brand-dark); transition: background-color 250ms, color 250ms; }
.cx-channel__icon svg { width: 20px; height: 20px; }
.cx-channel__label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-soft); }
.cx-channel__value { font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; color: var(--color-ink); overflow-wrap: anywhere; }
.cx-channel__go { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--color-brand-dark); }
.cx-channel__go svg { width: 14px; height: 14px; transition: transform 250ms ease; }
.cx-channel:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(30, 27, 26, 0.1), 0 26px 50px -28px rgba(30, 27, 26, 0.55); }
.cx-channel:hover .cx-channel__icon { background: var(--color-ink); color: var(--color-brand); }
.cx-channel:hover .cx-channel__go svg { transform: translateX(3px); }
.cx-channel:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

/* ---- Main: form + side panel ---- */
.cx { padding-block: clamp(48px, 6vw, 88px) clamp(64px, 8vw, 112px); }
.cx__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }

.cx-form { padding: clamp(24px, 3.5vw, 44px); border: 1px solid var(--color-border); border-radius: 22px; background: var(--color-surface); box-shadow: 0 30px 60px -44px rgba(30, 27, 26, 0.4); scroll-margin-top: 110px; }
.cx-form__head h2 { margin: 10px 0 0; font-family: var(--font-display); font-size: clamp(1.6rem, 1.25rem + 1.2vw, 2.25rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.025em; }
.cx-form__reply { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-size: var(--fs-md); color: var(--color-text); }
.cx-dot { position: relative; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--color-verified); }
.cx-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: cx-pulse 2.2s ease-out infinite; }
@keyframes cx-pulse { from { transform: scale(1); opacity: 0.6; } to { transform: scale(3); opacity: 0; } }

.cx-form__form { margin-top: 28px; }

.cx-alert { display: flex; gap: 12px; margin-top: 22px; padding: 14px 16px; border-radius: 12px; font-size: var(--fs-md); line-height: 1.5; }
.cx-alert strong { display: block; font-weight: 600; }
.cx-alert p, .cx-alert ul { margin: 2px 0 0; padding: 0; list-style: none; }
.cx-alert__icon { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; font-weight: 700; }
.cx-alert__icon svg { width: 14px; height: 14px; stroke-width: 3; }
.cx-alert--ok { background: var(--color-verified-light); color: #125c32; }
.cx-alert--ok .cx-alert__icon { background: var(--color-verified); color: #fff; }
.cx-alert--err { background: var(--color-danger-light); color: #8e2a1f; }
.cx-alert--err .cx-alert__icon { background: var(--color-danger); color: #fff; }

/* subject as selectable chips (radio inputs, keyboard friendly) */
.cx-topics { margin: 0 0 22px; padding: 0; border: 0; }
.cx-topics legend { margin-bottom: 10px; padding: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--color-ink); }
.cx-topics__list { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-topic { position: relative; cursor: pointer; }
.cx-topic input { position: absolute; opacity: 0; pointer-events: none; }
.cx-topic span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--color-border-strong); border-radius: 999px; background: var(--color-surface); font-size: var(--fs-md); font-weight: 500; color: var(--color-text); transition: background-color 200ms, border-color 200ms, color 200ms; }
.cx-topic:hover span { border-color: var(--color-ink); color: var(--color-ink); }
.cx-topic input:checked + span { background: var(--color-ink); border-color: var(--color-ink); color: #fff; }
.cx-topic input:focus-visible + span { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.cx-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cx-field { display: grid; gap: 7px; margin-bottom: 16px; }
.cx-field label { display: flex; align-items: baseline; justify-content: space-between; font-size: var(--fs-sm); font-weight: 600; color: var(--color-ink); }
.cx-field label span { font-size: var(--fs-xs); font-weight: 500; color: var(--color-text-soft); }
.cx-field input, .cx-field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--color-border-strong); border-radius: 12px;
  background: var(--color-paper); font: inherit; font-size: var(--fs-base); color: var(--color-ink);
  transition: border-color 200ms, background-color 200ms, box-shadow 200ms;
}
.cx-field textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.cx-field input::placeholder, .cx-field textarea::placeholder { color: var(--color-text-soft); }
.cx-field input:hover, .cx-field textarea:hover { border-color: var(--color-text-soft); }
.cx-field input:focus, .cx-field textarea:focus { outline: none; border-color: var(--color-brand); background: var(--color-surface); box-shadow: 0 0 0 4px rgba(233, 122, 26, 0.14); }

.cx-form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--color-border); }
.cx-form__foot p { margin: 0; font-size: var(--fs-sm); color: var(--color-text-soft); }
.cx-submit { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--color-brand); font: inherit; font-size: var(--fs-base); font-weight: 600; color: var(--color-on-brand); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); transition: background-color 200ms, transform 200ms, box-shadow 250ms; }
.cx-submit svg { width: 17px; height: 17px; transition: transform 250ms ease; }
.cx-submit:hover { background: #F08A2C; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 26px -12px rgba(233, 122, 26, 0.7); }
.cx-submit:hover svg { transform: translateX(3px); }
.cx-submit:active { transform: translateY(0) scale(0.98); }
.cx-submit:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

/* side panel */
.cx-side { position: sticky; top: 112px; display: grid; gap: 16px; }
.cx-side__card { padding: 24px; border-radius: 20px; background: var(--color-ink); color: #fff; }
.cx-side__title { margin: 0; color: #fff; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.015em; }
.cx-side__text { margin: 6px 0 0; font-size: var(--fs-md); line-height: 1.6; color: rgba(255, 255, 255, 0.68); }
.cx-routes { margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.cx-routes li { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.cx-routes a { display: grid; grid-template-columns: 38px minmax(0, 1fr) 16px; align-items: center; gap: 12px; padding: 14px 4px; color: #fff; transition: background-color 200ms; border-radius: 10px; }
.cx-routes__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); color: var(--color-brand); transition: background-color 200ms, color 200ms; }
.cx-routes__icon svg { width: 18px; height: 18px; }
.cx-routes__txt { display: grid; gap: 1px; font-size: var(--fs-sm); line-height: 1.45; color: rgba(255, 255, 255, 0.65); }
.cx-routes__txt strong { font-size: var(--fs-md); font-weight: 600; color: #fff; }
.cx-routes__go { width: 16px; height: 16px; color: rgba(255, 255, 255, 0.4); transition: transform 250ms ease, color 200ms; }
.cx-routes a:hover .cx-routes__icon { background: var(--color-brand); color: var(--color-ink); }
.cx-routes a:hover .cx-routes__go { color: var(--color-brand); transform: translateX(3px); }
.cx-routes a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.cx-side__hours { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface); }
.cx-side__hours-icon { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; background: var(--color-brand-50); color: var(--color-brand-dark); }
.cx-side__hours-icon svg { width: 19px; height: 19px; }
.cx-side__hours-label { margin: 0; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-soft); }
.cx-side__hours-value { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; color: var(--color-ink); }

/* ---- Smaller screens ---- */
@media (max-width: 980px) {
  .cx__grid { grid-template-columns: minmax(0, 1fr); }
  .cx-side { position: static; }
}
@media (max-width: 560px) {
  .cx-channels__list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cx-channel { padding: 16px; }
  .cx-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cx-form { border-radius: 18px; }
  .cx-submit { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-channel, .cx-channel__go svg, .cx-submit, .cx-submit svg, .cx-routes__go { transition: none; }
  .cx-channel:hover, .cx-submit:hover { transform: none; }
  .cx-dot::after { animation: none; }
}

/* ==========================================================================
   Motion. Sections fade and rise in with the site-wide [data-reveal] hook;
   route rows cascade with [data-stagger]. On load the contact cards rise one
   after another into their place over the header; the side panel follows the
   form a beat later; alerts slide in; the submit button shows a sending
   state. Static under prefers-reduced-motion.
   ========================================================================== */
.cx-anim-channels > li { animation: cx-rise 800ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.cx-anim-channels > li:nth-child(1) { animation-delay: 150ms; }
.cx-anim-channels > li:nth-child(2) { animation-delay: 240ms; }
.cx-anim-channels > li:nth-child(3) { animation-delay: 330ms; }
.cx-anim-channels > li:nth-child(4) { animation-delay: 420ms; }
@keyframes cx-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

.cx [data-reveal] { transition-duration: 0.8s; transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
.cx-side[data-reveal] { transition-delay: 160ms; }
.cx-routes[data-stagger] > li { transform: translateX(-10px); }

.cx-channel__icon svg { transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.cx-channel:hover .cx-channel__icon svg { transform: scale(1.12) rotate(-8deg); }

.cx-topic span { transition: background-color 200ms, border-color 200ms, color 200ms, transform 150ms ease; }
.cx-topic:active span { transform: scale(0.96); }
.cx-topic input:checked + span { animation: cx-pop 300ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cx-pop { 0% { transform: scale(0.94); } 100% { transform: none; } }

.cx-field label { transition: color 200ms; }
.cx-field:focus-within label { color: var(--color-brand-dark); }

.cx-alert { animation: cx-alert 500ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes cx-alert { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.cx-submit.is-sending { pointer-events: none; opacity: 0.85; }
.cx-submit.is-sending svg { display: none; }
.cx-submit.is-sending::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: cx-spin 700ms linear infinite; }
@keyframes cx-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .cx-anim-channels > li, .cx-alert, .cx-topic input:checked + span { animation: none; }
  .cx-channel:hover .cx-channel__icon svg, .cx-topic:active span { transform: none; }
  .cx-routes[data-stagger] > li { transform: none; }
  .cx-submit.is-sending::after { animation-duration: 1.6s; }
}
