/* ==========================================================================
   OPELOGY — Contact Page Styles
   Loaded via the `extra_css` block in templates/pages/contact.html.
   Provides the split-screen layout, info cards, inquiry form with inline
   validation, success toast and the map placeholder.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Compact page hero
   Page-specific override of the shared .page-hero (style.css, 12b).
   Tightens vertical spacing so the split-screen form starts above the fold.
   -------------------------------------------------------------------------- */
.page-hero {
  padding-block: calc(var(--nav-height) + 32px) 24px;
}

.page-hero-title {
  font-size: var(--fs-2xl);
  line-height: 1.2;
  margin: 0 auto var(--space-2);
}

.page-hero-subtitle {
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto 0;
}

.page-hero .section-eyebrow {
  margin-bottom: var(--space-2);
}

/* Pull the split-screen form up above the fold */
.contact-section {
  padding-block: var(--space-12) var(--space-16);
}

/* --------------------------------------------------------------------------
   1. Split-screen layout
   Two columns on desktop, stacked on mobile. Columns stretch to the same
   height so the left panel's bottom edge aligns with the form's.
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 64rem) {
  .contact-grid { grid-template-columns: 1fr 1.2fr; gap: var(--space-12); }
}

/* --------------------------------------------------------------------------
   2. Left column — direct contact info
   Flex column keeps the header+items grouped at the top while
   justify-content: space-between pushes the SLA card down to the bottom,
   so it lines up with the bottom of the form on the right.
   -------------------------------------------------------------------------- */
.contact-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.panel-head h2 {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-2);
}

.panel-head p {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-8);
}

/* Individual info row */
.info-list { display: grid; gap: var(--space-6); }

.info-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.info-item .icon-box {
  margin-bottom: 0;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
}
.info-item .icon-box svg { width: 1.4rem; height: 1.4rem; }

.info-item h3 {
  font-size: var(--fs-sm);
  margin-bottom: var(--space-1);
}

.info-item p,
.info-item a {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.info-item a:hover { color: var(--accent); }

/* WhatsApp quick-chat gets a green treatment */
.info-item--whatsapp .icon-box {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #34d399;
}
.info-item--whatsapp a { color: #34d399; font-weight: var(--fw-semibold); }
.info-item--whatsapp a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   2b. Trust / SLA card ("What to Expect")
   Sits at the bottom of the left panel thanks to the panel's flex column.
   -------------------------------------------------------------------------- */
.sla-card {
  margin-top: var(--space-8);
  background: linear-gradient(160deg, rgba(0, 210, 255, 0.07), rgba(0, 210, 255, 0.02));
  border: 1px solid rgba(0, 210, 255, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.sla-head { margin-bottom: var(--space-6); }

.sla-head h3 {
  font-size: var(--fs-lg);
  margin-top: var(--space-3);
}

.sla-list { display: grid; gap: var(--space-5); }

.sla-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.sla-item .icon-box {
  margin-bottom: 0;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
}
.sla-item .icon-box svg { width: 1.2rem; height: 1.2rem; }

.sla-item strong {
  display: block;
  font-size: var(--fs-sm);
  margin-bottom: 2px;
}

.sla-item span:not(.icon-box) {
  display: block;
  font-size: var(--fs-xs);
  line-height: 1.55;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   3. Right column — inquiry form
   -------------------------------------------------------------------------- */
.contact-form {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.contact-form h2 {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-2);
}

.contact-form > p {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-8);
}

/* Form field grid — name + email + phone stack, or pair up on wider cards */
.form-grid { display: grid; gap: var(--space-6); }

@media (min-width: 40rem) {
  .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
}

.form-group { display: grid; gap: var(--space-2); }

.form-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}
.form-label .req { color: var(--accent); }

.form-control {
  width: 100%;
  padding: 0.75rem var(--space-4);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

/* Remove the native select arrow in favour of a custom one */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 1.25rem) 55%, calc(100% - 0.9rem) 55%;
  background-size: 8px 8px, 8px 8px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}
select.form-control option { background: var(--bg-surface); color: var(--text-primary); }

textarea.form-control { min-height: 9rem; resize: vertical; }

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Invalid state — red border + message */
.form-control.is-invalid {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.field-error {
  display: none;
  font-size: var(--fs-xs);
  color: #f87171;
}
.form-group.has-error .field-error { display: block; }

/* --------------------------------------------------------------------------
   4. Submit button
   Inherits .btn-primary hover from the global stylesheet.
   -------------------------------------------------------------------------- */
.form-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  padding: 0.85rem 2rem;
  margin-top: var(--space-2);
}

.form-submit svg { width: 1.15rem; height: 1.15rem; transition: transform var(--transition); }
.form-submit:hover svg { transform: translate(3px, -3px); }

/* --------------------------------------------------------------------------
   6. Success toast
   Fixed to the bottom-right corner, slides in when visible.
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  max-width: 22rem;
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid rgba(52, 211, 153, 0.5);
  border-left: 4px solid #34d399;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  translate: 0 1rem;
  transition: opacity var(--transition), visibility var(--transition),
              translate var(--transition);
}

.toast.is-visible { opacity: 1; visibility: visible; translate: 0 0; }

.toast-icon {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}
.toast-icon svg { width: 1rem; height: 1rem; }

.toast-title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.toast-message { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 0.15rem; }

.toast-close {
  margin-left: auto;
  color: var(--text-muted);
  font-size: var(--fs-lg);
  line-height: 1;
  padding: 0 var(--space-1);
}
.toast-close:hover { color: var(--text-primary); }

/* --------------------------------------------------------------------------
   7. Map / location placeholder
   -------------------------------------------------------------------------- */
.map-section { margin-top: var(--space-16); }

.map-placeholder {
  position: relative;
  aspect-ratio: 16 / 6;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    radial-gradient(60% 120% at 50% 40%, rgba(0, 210, 255, 0.12), transparent 70%),
    var(--bg-surface);
  background-size: 2.25rem 2.25rem, 2.25rem 2.25rem, auto, auto;
}

/* Pulsing map pin */
.map-pin {
  position: absolute;
  left: 50%;
  top: 45%;
  translate: -50% -50%;
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  color: var(--accent);
  border-radius: 50%;
  box-shadow: var(--shadow-glow);
}
.map-pin svg { width: 1.75rem; height: 1.75rem; }

.map-pin::before,
.map-pin::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 210, 255, 0.35);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.map-pin::after { animation-delay: 1s; }

@keyframes ping {
  0%   { transform: scale(1); opacity: 0.6; }
  80%, 100% { transform: scale(2.4); opacity: 0; }
}

/* Overlay label */
.map-overlay {
  position: absolute;
  left: 50%;
  bottom: var(--space-6);
  translate: -50% 0;
  text-align: center;
  padding: var(--space-3) var(--space-6);
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.map-overlay strong { display: block; }
.map-overlay span { color: var(--text-muted); font-size: var(--fs-xs); }

/* --------------------------------------------------------------------------
   8. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .map-pin::before,
  .map-pin::after { animation: none; }
}
