/* ==========================================================================
   Allied Insurance, contact.html page styles (Pass 1)
   Layers on the LOCKED shared system (styles.css). Reuses tokens + classes;
   adds only the page-hero band variant, the contact grid, form, and map block.
   ========================================================================== */

/* ---- PAGE HERO (variant band: shorter than the home 100vh video hero) ---- */
.page-hero {
  position: relative;
  min-height: clamp(430px, 62vh, 580px);
  display: flex;
  align-items: center;
  background: var(--brand-dark);
  overflow: hidden;
}
.page-hero-media {
  position: absolute;
  inset: 0;
  background: var(--brand-dark) url("../img/webp/contact-hero.webp") center 38% / cover no-repeat;
}
/* same warm dark green-gold grade + left/bottom legibility scrim as the home hero */
.page-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(107deg, rgba(31, 33, 18, 0.92) 0%, rgba(31, 33, 18, 0.62) 46%, rgba(31, 33, 18, 0.34) 100%),
    linear-gradient(180deg, rgba(31, 33, 18, 0.18) 0%, rgba(31, 33, 18, 0.18) 55%, rgba(73, 111, 54, 0.55) 100%),
    radial-gradient(120% 90% at 88% 12%, rgba(217, 138, 43, 0.18) 0%, rgba(217, 138, 43, 0) 55%);
}
.page-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 150px var(--gutter) 70px;
}
.page-hero-eyebrow {
  color: var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.page-hero h1 {
  font-size: clamp(38px, 5.2vw, 60px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.page-hero h1 .beat-gold { color: var(--accent-soft); }
.page-hero h1 .beat-cream { color: var(--on-dark); }
.page-hero-sub {
  color: var(--on-dark-70);
  font-size: 18px;
  line-height: 1.6;
  max-width: 54ch;
  margin-top: 22px;
}

/* ---- CONTACT MAIN (details + form) ---- */
.contact-main {
  background: var(--surface);
  padding-block: clamp(64px, 9vw, 116px);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(36px, 6vw, 84px);
  align-items: start;
}
/* grid-blowout guard: let tracks shrink below intrinsic content width */
.contact-grid > * { min-width: 0; }
.contact-details .headline { max-width: 18ch; }
.contact-lead {
  color: var(--ink-70);
  margin-top: 16px;
  max-width: 42ch;
}

.contact-lines {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.contact-lines li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.contact-lines li:last-child { border-bottom: 1px solid var(--line); }
.cl-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand-green);
  padding-top: 3px;
}
.cl-value { font-size: 17px; line-height: 1.6; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.cl-value a { color: var(--ink); transition: color .2s ease; overflow-wrap: anywhere; }
.cl-value a:hover { color: var(--accent-deep); }

.btn-whatsapp {
  background: var(--brand-green);
  color: var(--on-dark);
  margin-top: 30px;
}
.btn-whatsapp:hover { background: #3c5c2c; }
.btn-whatsapp svg { width: 18px; height: 18px; }

.contact-socials {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
}
.contact-socials .cl-label { padding-top: 0; }
.contact-social-row { margin-top: 0; }
/* dark-on-light social chips for this light section (footer socials are on dark) */
.contact-social-row a {
  border-color: var(--line);
  color: var(--brand-green);
}
.contact-social-row a:hover { background: var(--accent); border-color: var(--accent); color: var(--on-dark); }

/* ---- CONTACT FORM ---- */
.contact-form-wrap {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(24px, 4vw, 40px);
}
.form-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 20px;
}
.contact-form .field { margin-bottom: 18px; }
.contact-form .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.contact-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-70);
  margin-bottom: 7px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  padding: 13px 15px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.contact-form textarea { resize: vertical; min-height: 118px; }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #a2a494; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(175, 95, 5, 0.14);
}
.form-submit { width: 100%; justify-content: center; margin-top: 4px; }
.form-note {
  font-size: 13.5px;
  color: var(--ink-70);
  line-height: 1.55;
  margin-top: 16px;
}
.form-note a { color: var(--accent-deep); font-weight: 500; overflow-wrap: anywhere; }
.form-note a:hover { text-decoration: underline; }

/* ---- VISIT / MAP ---- */
.contact-visit {
  background: var(--canvas);
  padding-block: clamp(56px, 8vw, 96px);
}
.visit-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(28px, 5vw, 60px);
  align-items: stretch;
}
.visit-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.visit-card h3 { font-size: clamp(24px, 3vw, 30px); color: var(--ink); }
.visit-address {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  margin-top: 16px;
}
.visit-note { color: var(--ink-70); margin-top: 12px; max-width: 34ch; }
.visit-card .btn { margin-top: 26px; }

/* Styled static location card (keyless; the OSM tile embed is blocked on the
   build box, so this is the primary treatment. Links out to the live OSM map). */
.location-card {
  position: relative;
  display: block;
  min-height: 360px;
  border-radius: var(--r-card);
  overflow: hidden;
  color: var(--on-dark);
  background:
    radial-gradient(120% 130% at 82% 10%, #5c8446 0%, #496f36 44%, #31331f 100%);
  transition: transform .25s ease, box-shadow .25s ease;
}
.location-card:hover { transform: translateY(-3px); }
/* abstract brand grid texture (decorative; not a rendered street map) */
.lc-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(254, 252, 246, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(254, 252, 246, 0.10) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 45%, #000 55%, transparent 100%);
  mask-image: radial-gradient(120% 100% at 50% 45%, #000 55%, transparent 100%);
}
.lc-body {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 40px var(--gutter);
}
.lc-pin {
  display: inline-flex;
  color: var(--accent-soft);
  margin-bottom: 10px;
}
.lc-pin svg { width: 46px; height: 46px; }
.lc-place {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--on-dark);
}
.lc-addr { font-size: 16px; color: var(--on-dark-70); margin-top: 4px; }
.lc-coords {
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: rgba(254, 252, 246, 0.55);
  margin-top: 8px;
}
.lc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-soft);
}
.lc-link svg { width: 15px; height: 15px; }
.location-card:hover .lc-link { color: #e8a94a; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 980px) {
  .contact-grid { grid-template-columns: 1fr; gap: 44px; }
  .visit-grid { grid-template-columns: 1fr; gap: 28px; }
  .location-card, .lc-body { min-height: 300px; }
  .page-hero-inner { padding: 132px var(--gutter) 60px; }
}

@media (max-width: 560px) {
  .page-hero { min-height: clamp(400px, 74vh, 520px); }
  .page-hero-inner { padding: 118px var(--gutter) 52px; }
  .page-hero h1 { font-size: clamp(32px, 9vw, 42px); }
  .contact-form .field-row { grid-template-columns: 1fr; gap: 0; }
  .contact-form .field-row .field { margin-bottom: 18px; }
  .contact-lines li { grid-template-columns: 72px 1fr; gap: 12px; }
}

/* ==========================================================================
   PASS-2 FACELIFT, contact-page catalog components (page-specific only;
   the shared/injected components live in styles.css + app.js and are untouched).
   Every motion path honors prefers-reduced-motion.
   ========================================================================== */

/* ---- 161 Modern Dot Grid: static brand-dot texture on the hero (right side) - */
.al-dotgrid {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: radial-gradient(rgba(217, 138, 43, 0.18) 1.4px, transparent 1.6px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(115% 95% at 84% 22%, #000 0%, transparent 62%);
  mask-image: radial-gradient(115% 95% at 84% 22%, #000 0%, transparent 62%);
}

/* ---- 158 AnimatedSVGUnderline: contact links grow an underline on hover ----- */
.al-ulinks .cl-value a {
  position: relative;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size .28s cubic-bezier(.4, 0, .2, 1), color .2s ease;
  padding-bottom: 1px;
}
.al-ulinks .cl-value a:hover,
.al-ulinks .cl-value a:focus-visible {
  background-size: 100% 2px;
  color: var(--accent-deep);
}
@media (prefers-reduced-motion: reduce) {
  .al-ulinks .cl-value a { transition: none; }
}

/* ---- 134 Glass Button: frosted secondary CTA, label slides vertically -------- */
.al-glassbtn {
  position: relative;
  margin-top: 26px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .42));
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
  border: 1px solid rgba(73, 111, 54, .30);
  color: var(--brand-green);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 6px 18px rgba(31, 33, 18, .08);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.al-glassbtn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 10px 26px rgba(31, 33, 18, .12);
}
.gb-slide { position: relative; display: inline-block; height: 1.05em; line-height: 1.05em; overflow: hidden; }
.gb-slide span { display: block; transition: transform .34s cubic-bezier(.4, 0, .2, 1); }
.al-glassbtn:hover .gb-slide span { transform: translateY(-1.05em); }
.gb-arrow { display: inline-flex; align-items: center; }
.gb-arrow svg { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) {
  .al-glassbtn, .gb-slide span { transition: none !important; }
  .al-glassbtn:hover { transform: none; }
  .al-glassbtn:hover .gb-slide span { transform: none; }
}

/* ---- 062 Border Beam: a gold light travels the contact card border ---------- */
@property --beam-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.beam-card { position: relative; isolation: isolate; }
.beam-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--beam-angle),
    transparent 0deg, transparent 236deg,
    rgba(217, 138, 43, .16) 270deg, var(--accent-soft) 306deg,
    var(--accent) 330deg, var(--accent-soft) 350deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  animation: beamRun 5.5s linear infinite;
}
@keyframes beamRun { to { --beam-angle: 360deg; } }

/* ---- 119 Copy Email: click-to-copy chips beside each address ---------------- */
.cl-emails { display: grid; gap: 9px; }
.cl-email { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cl-email a { min-width: 0; overflow-wrap: anywhere; }
.copy-email {
  position: relative; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-input);
  background: var(--surface); color: var(--brand-green); cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
}
.copy-email:hover { background: var(--canvas); border-color: var(--accent); color: var(--accent-deep); }
.copy-email:active { transform: scale(.92); }
.copy-email:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy-email svg { width: 15px; height: 15px; }
.copy-email .ic-check { display: none; }
.copy-email.is-copied { color: var(--brand-green); border-color: var(--brand-green); }
.copy-email.is-copied .ic-copy { display: none; }
.copy-email.is-copied .ic-check { display: block; }
.copy-tip {
  position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: var(--brand-dark); color: var(--on-dark);
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s ease; pointer-events: none;
}
.copy-email:hover .copy-tip, .copy-email:focus-visible .copy-tip, .copy-email.is-copied .copy-tip {
  opacity: 1; visibility: visible;
}

/* ---- 128 Chat Messages: a live-chat preview, bubbles reveal in sequence ------ */
.chat-preview {
  margin-top: 26px; max-width: 410px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  padding: 16px 16px 15px; box-shadow: 0 10px 30px rgba(31, 33, 18, .06);
}
.chat-head { display: flex; align-items: center; gap: 11px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.chat-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-green); color: var(--on-dark); font-weight: 700; font-size: 16px;
}
.chat-who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.chat-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.chat-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-70); }
.chat-dot { width: 7px; height: 7px; border-radius: 50%; background: #25d366; animation: chatDot 2.2s ease-out infinite; flex: none; }
@keyframes chatDot { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); } 70%, 100% { box-shadow: 0 0 0 6px rgba(37, 211, 102, 0); } }
.chat-body { display: flex; flex-direction: column; gap: 9px; padding: 14px 0 2px; }
.chat-msg { max-width: 86%; }
.chat-msg p { margin: 0; font-size: 14px; line-height: 1.45; padding: 9px 13px; }
.chat-in { align-self: flex-start; }
.chat-in p { background: var(--canvas); color: var(--ink); border-radius: 3px 14px 14px 14px; }
.chat-out { align-self: flex-end; }
.chat-out p { background: var(--brand-green); color: var(--on-dark); border-radius: 14px 3px 14px 14px; }
.chat-typing { display: inline-flex; gap: 4px; align-self: flex-start; padding: 12px 14px; background: var(--canvas); border-radius: 3px 14px 14px 14px; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-70); opacity: .5; animation: chatType 1.3s ease-in-out infinite; }
.chat-typing span:nth-child(2) { animation-delay: .18s; }
.chat-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes chatType { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: .9; } }
.chat-cta {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 14px;
  font-size: 14px; font-weight: 600; color: var(--accent-deep);
}
.chat-cta svg { width: 16px; height: 16px; transition: transform .2s ease; }
.chat-cta:hover svg { transform: translateX(4px); }
/* bubbles animate in on their own timeline (pure CSS, no JS gate). fill-mode
   backwards holds the "from" state during the delay only; the resting/base state
   is fully visible, so no-JS and unsupported-animation both leave content shown. */
@keyframes chatBubbleIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.chat-msg, .chat-typing { animation: chatBubbleIn .5s ease backwards; }
.chat-msg:nth-of-type(1) { animation-delay: .20s; }
.chat-msg:nth-of-type(2) { animation-delay: .95s; }
.chat-typing { animation-delay: 1.6s; }

/* ---- 033 Social Media Icons: staggered pop-in + springy hover --------------- */
/* entrance uses fill-mode backwards (not forwards) so it does NOT pin the final
   transform; that keeps the base state visible and lets :hover transform win. */
@keyframes socialPop { from { opacity: 0; transform: translateY(10px) scale(.88); } to { opacity: 1; transform: none; } }
.al-socials a { animation: socialPop .5s cubic-bezier(.34, 1.4, .5, 1) backwards;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .25s cubic-bezier(.34, 1.4, .5, 1); }
.al-socials a:nth-child(1) { animation-delay: .05s; }
.al-socials a:nth-child(2) { animation-delay: .13s; }
.al-socials a:nth-child(3) { animation-delay: .21s; }
.al-socials a:nth-child(4) { animation-delay: .29s; }
.al-socials a:hover { transform: translateY(-4px) rotate(-4deg); }

/* ---- 204 Lottie Player: location-ping motif accent in the visit card -------- */
.al-lottie--ping { width: 64px; height: 64px; margin-bottom: 4px; }

/* ---- 155 Multi Location Map: radar ping around the office marker ------------- */
.lc-pin { position: relative; }
.lc-pin svg { position: relative; z-index: 1; }
.lc-ping {
  position: absolute; left: 50%; top: 42%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; border: 2px solid var(--accent-soft); z-index: 0; pointer-events: none;
  opacity: 0; animation: lcPing 3s ease-out infinite;
}
.lc-ping2 { animation-delay: 1.5s; }
@keyframes lcPing {
  0% { transform: scale(.4); opacity: .7; }
  70% { opacity: .12; }
  100% { transform: scale(3.6); opacity: 0; }
}

@media (max-width: 560px) {
  .chat-preview { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .beam-card::before { animation: none; }
  /* animation:none reverts to the base (visible) state instantly, no delay flash */
  .chat-dot, .chat-typing span, .lc-ping,
  .chat-msg, .chat-typing, .al-socials a { animation: none !important; }
  .lc-ping { display: none; }
}
