/* ── Contact dst overrides ── */
.contact-dst .sph-top {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  color: var(--dark);
}

.contact-dst .sph-bottom {
  font-size: clamp(2.8rem, 6vw, 4.2rem);
}

/* ══════════════════════════════════════════
   Contact Section
   ══════════════════════════════════════════ */
.contact-section {
  background: var(--white);
  padding: 80px var(--pad-x) 100px;
}

.contact-card {
  max-width: 1020px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 60px;
  align-items: center;
}

/* ── Left panel ── */
.contact-left {
  position: relative;
  padding: 60px 40px;
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: none;
}

.contact-shape { display: none; }

/* JS-drawn process-style polygon background */
.contact-left-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
}

/* Left content */
.contact-left-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 280px;
}

/* Icon colors for contact panel elements */
.contact-msg-icon { color: var(--white); }
.contact-msg-icon .material-symbols-outlined { font-size: 28px; }
.contact-btn-email .material-symbols-outlined { font-size: 16px; }
.contact-submit .material-symbols-outlined { font-size: 18px; }
.form-success-icon { color: var(--white); }
.form-success-icon .material-symbols-outlined { font-size: 32px; }

.contact-msg-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--grad-diag);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.contact-left-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.contact-left-content > p {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 32px;
}

.contact-left-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.contact-btn-email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--grad);
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: opacity var(--t);
}

.contact-btn-email:hover {
  opacity: 0.88;
}

/* ── Right panel: form ── */
.contact-form-wrap {
  padding: 0;
}

.contact-form {
  scroll-margin-top: 88px; /* keeps #contactForm clear of the sticky header if linked to */
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-md);
}

.form-group label .req {
  color: var(--teal);
  margin-left: 2px;
}

.form-group input,
.form-group textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--dark);
  background: var(--bg);
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(var(--teal-rgb), 0.10);
  background: var(--white);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9ca3af;
}

.contact-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(90deg, var(--green) 0%, var(--teal) 100%);
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: opacity var(--t), transform var(--t);
}

.contact-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.form-privacy {
  font-size: 0.78rem;
  color: #9ca3af;
  text-align: center;
  line-height: 1.6;
}

.form-privacy a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-privacy a:hover {
  color: var(--teal);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .contact-section {
    padding: 60px 16px 80px;
  }

  .contact-card {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-left {
    padding: 48px 32px;
  }
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  /* hello@deepstacktechnologies.com is long — reclaim panel padding and
     tighten the button so the address never clips on small phones */
  .contact-left {
    padding: 40px 18px;
  }

  .contact-btn-email {
    padding: 11px 12px;
    font-size: 0.78rem;
    gap: 6px;
  }

  .contact-btn-email .material-symbols-outlined {
    flex-shrink: 0;
  }
}

/* ── Field validation error ── */
.field-error {
  font-size: 0.78rem;
  color: #ef4444;
  min-height: 1em;
}

.form-group input.input-error,
.form-group textarea.input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10);
}

/* ── Submit button states ── */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.40);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.contact-submit.is-loading .btn-spinner { display: block; }
.contact-submit.is-loading .btn-icon    { display: none; }
.contact-submit.is-loading .btn-label   { opacity: 0.7; }
.contact-submit:disabled                { cursor: not-allowed; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Success panel ── */
.form-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  gap: 16px;
}

.form-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--grad-diag);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(var(--teal-rgb), 0.35);
}

.form-success h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
}

.form-success p {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
  max-width: 340px;
}

.form-success-reset {
  margin-top: 8px;
  background: var(--white);
  color: var(--dark);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  box-shadow: none;
  font-size: 0.9rem;
  padding: 12px 28px;
  width: auto;
}

.form-success-reset:hover {
  border-color: rgba(var(--teal-rgb), 0.40);
  box-shadow: 0 2px 10px rgba(var(--teal-rgb), 0.12);
  opacity: 1;
  transform: none;
}

/* ── Honeypot ──
   Kept out of sight and out of the tab order, but still a real focusable
   input so naive bots fill it. Do not switch to display:none — some bots
   skip those. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ── reCAPTCHA row ── */
.captcha-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.captcha-row #recaptchaBox[hidden] {
  display: none;
}

/* Shrink the widget on narrow phones so it never overflows the card */
@media (max-width: 400px) {
  .captcha-row #recaptchaBox {
    transform: scale(0.87);
    transform-origin: 0 0;
    height: 66px;
  }
}

/* ── reCAPTCHA unavailable notice ──
   Shown when the Google script is blocked, so the visitor is told why
   there is no checkbox and given a way to reach us instead. */
.captcha-fallback {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff8e6;
  border: 1px solid #f5d98a;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #7a5b12;
}

.captcha-fallback[hidden] {
  display: none;
}

.captcha-fallback .material-symbols-outlined {
  font-size: 18px;
  flex-shrink: 0;
}

.captcha-fallback a {
  color: #7a5b12;
  font-weight: 600;
  word-break: break-word;
}
