/* ════════════════════════════════════════════════════════════════
   CONTACT PAGE — Polish Layer v1 (2026-05-19)

   Per-page polish overrides loaded AFTER site.css. All rules scoped
   under .contact-page so they cannot leak elsewhere. Goals: tighter
   section rhythm, amber-tinted security notice, sticky sidebar on
   desktop, equal-height clickable route cards, mobile vertical
   review-process pipeline, premium CTA panel, refined form focus
   states, footer transition.
═══════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────────
   1. SECTION RHYTHM
─────────────────────────────────────────────────────────────── */
.contact-page .contact-hero {
  padding: clamp(72px, 8vw, 132px) 0 clamp(64px, 7vw, 112px);
}
.contact-page .contact-section {
  padding: clamp(80px, 9vw, 120px) 0;
  border-top: 1px solid rgba(212,176,94,0.06);
}
.contact-page .contact-security-section {
  padding: clamp(56px, 6vw, 88px) 0;
}
.contact-page .contact-cta {
  padding: clamp(72px, 8vw, 108px) 0;
}

/* ────────────────────────────────────────────────────────────────
   2. SECTION EYEBROW + HEADING POLISH (matches About page)
─────────────────────────────────────────────────────────────── */
.contact-page .section-label {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(212,176,94,0.62);
  margin: 0 0 14px;
  position: relative;
  padding-left: 14px;
}
.contact-page .section-label::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 1px;
  background: rgba(212,176,94,0.62);
}

.contact-page .contact-hero h1 { max-width: 20ch; }
.contact-page .contact-section-head h2,
.contact-page .contact-form-header h2 { max-width: 24ch; }
.contact-page .contact-cta-copy h2 { max-width: 20ch; }

@supports (text-wrap: balance) {
  .contact-page .contact-hero h1,
  .contact-page .contact-section-head h2,
  .contact-page .contact-form-header h2,
  .contact-page .contact-cta-copy h2,
  .contact-page .security-notice-title { text-wrap: balance; }
}

/* ────────────────────────────────────────────────────────────────
   3. HERO — Contact Intelligence card
─────────────────────────────────────────────────────────────── */
.contact-page .contact-hero {
  background:
    radial-gradient(circle at 78% 26%, rgba(212,176,94,0.12), transparent 32%),
    radial-gradient(circle at 12% 76%, rgba(91,143,212,0.06), transparent 28%),
    linear-gradient(180deg, rgba(5,7,11,0.98), #05070B);
}

.contact-page .contact-info-panel {
  position: relative;
  padding: 30px;
  border-radius: 22px;
  box-shadow:
    0 26px 80px rgba(0,0,0,0.45),
    0 0 60px rgba(212,176,94,0.05),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.contact-page .contact-info-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 22px; right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,176,94,0.50), transparent);
  pointer-events: none;
}

/* ────────────────────────────────────────────────────────────────
   3a. CRITICAL FIX — site.css gives .contact-form-success an
   unconditional `display: flex`, which overrides the HTML `hidden`
   attribute. That made the red error panel (and the success panel)
   visible on page load. This rule restores the expected behaviour:
   panels are display:none until JS sets `hidden = false`.
─────────────────────────────────────────────────────────────── */
.contact-page .contact-form-success[hidden],
.contact-page #contact-success[hidden],
.contact-page #contact-error[hidden] {
  display: none !important;
}

/* ────────────────────────────────────────────────────────────────
   4. FORM PANEL — refined focus + states
─────────────────────────────────────────────────────────────── */
.contact-page .contact-form-panel {
  padding: clamp(28px, 3vw, 40px);
  border-radius: 20px;
  position: relative;
}

.contact-page .contact-field input,
.contact-page .contact-field select,
.contact-page .contact-field textarea {
  transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}
.contact-page .contact-field input:focus-visible,
.contact-page .contact-field select:focus-visible,
.contact-page .contact-field textarea:focus-visible {
  outline: none;
  border-color: rgba(212,176,94,0.62);
  box-shadow:
    0 0 0 3px rgba(212,176,94,0.16),
    inset 0 1px 0 rgba(255,255,255,0.04);
  background: rgba(8,11,18,0.78);
}
.contact-page .contact-field--error input,
.contact-page .contact-field--error select,
.contact-page .contact-field--error textarea {
  border-color: rgba(216,92,74,0.55);
  background: rgba(216,92,74,0.04);
}
.contact-page .contact-field-error {
  display: block;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: rgba(232,148,134,0.92);
  margin-top: 6px;
  min-height: 14px;
}

/* Required asterisk in gold */
.contact-page .contact-required {
  color: rgba(212,176,94,0.85);
}

/* Radio polish */
.contact-page .contact-radio {
  transition: border-color 220ms ease, background 220ms ease;
}
.contact-page .contact-radio:hover {
  border-color: rgba(212,176,94,0.32);
  background: rgba(212,176,94,0.03);
}

/* ────────────────────────────────────────────────────────────────
   5. SIDEBAR — sticky on large desktop only
─────────────────────────────────────────────────────────────── */
@media (min-width: 1100px) {
  .contact-page .contact-form-sidebar {
    position: sticky;
    top: calc(var(--global-header-height, 84px) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--global-header-height, 84px) - 48px);
    overflow-y: auto;
    /* Themed scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(212,176,94,0.36) rgba(255,255,255,0.025);
  }
  .contact-page .contact-form-sidebar::-webkit-scrollbar {
    width: 6px;
  }
  .contact-page .contact-form-sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.025);
    border-radius: 999px;
  }
  .contact-page .contact-form-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(212,176,94,0.50), rgba(186,152,68,0.20));
    border-radius: 999px;
  }
}

.contact-page .contact-sidebar-card {
  padding: 26px;
  transition: transform 240ms cubic-bezier(.22,1,.36,1), border-color 240ms, box-shadow 240ms;
}
.contact-page .contact-sidebar-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212,176,94,0.28);
  box-shadow: 0 18px 44px rgba(0,0,0,0.36);
}

/* ────────────────────────────────────────────────────────────────
   6. CONTACT ROUTES — equal-height clickable cards
─────────────────────────────────────────────────────────────── */
.contact-page .contact-route-grid {
  grid-auto-rows: 1fr;
}
.contact-page .contact-route-card {
  padding: 28px;
  cursor: pointer;
  transition:
    transform 240ms cubic-bezier(.22,1,.36,1),
    border-color 240ms ease,
    box-shadow 240ms ease,
    background 240ms ease;
  position: relative;
}
.contact-page .contact-route-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212,176,94,0.32);
  box-shadow: 0 22px 56px rgba(0,0,0,0.4), 0 0 36px rgba(212,176,94,0.06);
}
.contact-page .contact-route-card:focus-visible {
  outline: 2px solid rgba(212,176,94,0.62);
  outline-offset: 3px;
}
/* Selected — route card chosen via click */
.contact-page .contact-route-card.is-selected {
  border-color: rgba(212,176,94,0.62);
  background:
    radial-gradient(circle at 100% 0%, rgba(212,176,94,0.08), transparent 40%),
    linear-gradient(145deg, rgba(212,176,94,0.06), rgba(255,255,255,0.012));
  box-shadow:
    0 22px 56px rgba(0,0,0,0.42),
    0 0 40px rgba(212,176,94,0.12),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
.contact-page .contact-route-card.is-selected::after {
  content: "✓";
  position: absolute;
  top: 14px; right: 16px;
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(212,176,94,0.18);
  border: 1px solid rgba(212,176,94,0.55);
  color: rgba(245,224,168,0.96);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.contact-page .contact-route-card.is-selected .contact-route-tag {
  color: rgba(245,224,168,0.92);
  border-color: rgba(212,176,94,0.55);
  background: rgba(212,176,94,0.06);
}

/* ────────────────────────────────────────────────────────────────
   7. REVIEW PROCESS PIPELINE — mobile vertical timeline
─────────────────────────────────────────────────────────────── */
.contact-page .contact-flow-card {
  padding: 20px 14px;
  transition: transform 240ms cubic-bezier(.22,1,.36,1), border-color 240ms, box-shadow 240ms;
}
.contact-page .contact-flow-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.36);
}

@media (max-width: 720px) {
  .contact-page .contact-flow-wrapper {
    overflow: visible;
  }
  .contact-page .contact-process-flow {
    grid-template-columns: 1fr;
    gap: 14px;
    min-width: 0;
  }
  .contact-page .contact-flow-line {
    width: 2px; height: 30px;
    margin: 0 auto;
    background: linear-gradient(180deg, transparent, rgba(212,176,94,0.55), transparent);
  }
  .contact-page .contact-flow-line::after { display: none; }
}

/* ────────────────────────────────────────────────────────────────
   8. SECURITY NOTICE — warm gold/amber accent (not red)
─────────────────────────────────────────────────────────────── */
.contact-page .security-notice-card {
  position: relative;
  padding: clamp(28px, 3vw, 44px);
  border-radius: 22px;
  border: 1px solid rgba(240,168,74,0.30);
  background:
    radial-gradient(circle at 18% 0%, rgba(240,168,74,0.08), transparent 36%),
    linear-gradient(145deg, rgba(28,22,12,0.86), rgba(8,11,18,0.95));
  box-shadow:
    0 28px 70px rgba(0,0,0,0.46),
    0 0 60px rgba(240,168,74,0.05),
    inset 0 1px 0 rgba(255,210,140,0.06);
}
.contact-page .security-notice-card::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240,168,74,0.55), transparent);
  pointer-events: none;
}
.contact-page .security-icon {
  background: rgba(240,168,74,0.14);
  border: 1px solid rgba(240,168,74,0.35);
  color: rgba(248,200,130,0.95);
}
.contact-page .security-notice-card .section-label {
  color: rgba(248,200,130,0.92);
}
.contact-page .security-notice-card .section-label::before {
  background: rgba(248,200,130,0.78);
}
.contact-page .security-list li {
  position: relative;
}
.contact-page .security-list li::before {
  background: rgba(240,168,74,0.78) !important;
}

/* ────────────────────────────────────────────────────────────────
   9. FINAL CTA — premium gold-bordered panel
─────────────────────────────────────────────────────────────── */
.contact-page .contact-cta {
  background:
    radial-gradient(circle at 60% 50%, rgba(212,176,94,0.08), transparent 42%),
    linear-gradient(180deg, rgba(212,176,94,0.025), transparent);
}
.contact-page .contact-cta-grid {
  position: relative;
  padding: clamp(36px, 5vw, 56px);
  border-radius: 24px;
  border: 1px solid rgba(212,176,94,0.18);
  background:
    radial-gradient(circle at 90% 0%, rgba(212,176,94,0.06), transparent 38%),
    linear-gradient(145deg, rgba(10,12,17,0.94), rgba(4,6,10,0.98));
  box-shadow:
    0 30px 80px rgba(0,0,0,0.42),
    0 0 70px rgba(212,176,94,0.06),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.contact-page .contact-cta-grid::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,176,94,0.55), transparent);
  pointer-events: none;
}
.contact-page .contact-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
}
.contact-page .contact-cta-actions .btn {
  width: 100%;
  justify-content: center;
}

/* ────────────────────────────────────────────────────────────────
   10. FOOTER TRANSITION
─────────────────────────────────────────────────────────────── */
.contact-page .site-footer {
  position: relative;
  border-top: 1px solid rgba(212,176,94,0.10);
}
.contact-page .site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,176,94,0.36), transparent);
  pointer-events: none;
}

/* ────────────────────────────────────────────────────────────────
   11. RESPONSIVE
─────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .contact-page .contact-wrap { padding: 0 40px; }
  .contact-page .contact-cta-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .contact-page .contact-cta-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .contact-page .contact-cta-actions .btn {
    width: auto;
    flex: 1 1 200px;
  }
}

@media (max-width: 720px) {
  .contact-page .contact-wrap { padding: 0 20px; }
  .contact-page .contact-info-panel { padding: 22px; }
  .contact-page .contact-form-panel { padding: 22px; }
  .contact-page .contact-sidebar-card { padding: 22px; }
  .contact-page .contact-route-card { padding: 22px; }
  .contact-page .security-notice-card { padding: 24px; }
  .contact-page .contact-cta-actions {
    flex-direction: column;
  }
  .contact-page .contact-cta-actions .btn { width: 100%; flex: 1 1 100%; }
  /* Reduce heavy mobile glow for performance */
  .contact-page .contact-hero {
    background: linear-gradient(180deg, rgba(5,7,11,0.98), #05070B);
  }
  .contact-page .contact-cta-grid {
    box-shadow: 0 16px 40px rgba(0,0,0,0.36), inset 0 1px 0 rgba(255,255,255,0.04);
  }
  .contact-page .contact-route-card.is-selected::after {
    top: 12px; right: 12px;
    width: 20px; height: 20px;
    font-size: 0.65rem;
  }
}

/* ────────────────────────────────────────────────────────────────
   12. REDUCED MOTION
─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .contact-page .contact-route-card,
  .contact-page .contact-sidebar-card,
  .contact-page .contact-flow-card,
  .contact-page .contact-field input,
  .contact-page .contact-field select,
  .contact-page .contact-field textarea,
  .contact-page .contact-radio {
    transition: none !important;
  }
  .contact-page .contact-route-card:hover,
  .contact-page .contact-sidebar-card:hover,
  .contact-page .contact-flow-card:hover {
    transform: none !important;
  }
}
