/* ==========================================================================
   SAJ Dental Clinic — "Get In Touch" section
   Scope: every selector is prefixed get-in-touch. Contents:
     1. Section variables        7. Form fields
     2. Base section             8. Buttons + success message
     3. Background decoration    9. Animation helper classes
     4. Header                  10. Responsive (desktop → tablet → mobile)
     5. Feature cards           11. Reduced motion
     6. Form card
   ========================================================================== */

/* Standalone preview page only (get-in-touch.html) */
.get-in-touch-preview {
  margin: 0;
  padding-bottom: 30vh;
  background: #FFFFFF;
}

/* --------------------------------------------------------------------------
   1. Section variables
   -------------------------------------------------------------------------- */
.get-in-touch-section {
  --git-navy: #0B2F6B;
  --git-navy-text: #1D3B66;
  --git-blue: #1F6FD6;
  --git-blue-bright: #2A84F0;
  --git-sky: #EAF4FF;
  --git-orange: #FF6A21;
  --git-orange-deep: #E8540F;
  --git-orange-text: #E2531A;          /* AA on white for the italic heading */
  --git-body: #4A5F80;
  --git-muted: #7A8AA3;
  --git-border: rgba(31, 111, 214, 0.16);
  --git-error: #C2362F;

  --git-font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --git-font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --git-title-size: clamp(2.5rem, 4.1vw, 4.6rem);

  --git-field-h: 58px;
  --git-field-radius: 14px;
  --git-card-radius: 24px;
  --git-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   2. Base section
   -------------------------------------------------------------------------- */
.get-in-touch-section {
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  padding: clamp(64px, 5.6vw, 104px) 0 clamp(72px, 6.4vw, 120px);
  background:
    radial-gradient(55% 40% at 50% 18%, #FFFFFF 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #F2F8FF 0%, var(--git-sky) 55%, #E3EFFC 100%);
  font-family: var(--git-font-body);
  color: var(--git-body);
  -webkit-font-smoothing: antialiased;
}

.get-in-touch-section *,
.get-in-touch-section *::before,
.get-in-touch-section *::after {
  box-sizing: border-box;
}

.get-in-touch__container {
  position: relative;
  z-index: 1;
  width: min(92%, 1100px);
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   3. Background decoration
   Outer element = scroll parallax, inner layer = mouse parallax.
   -------------------------------------------------------------------------- */
.get-in-touch__background {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.get-in-touch__bg-item {
  position: absolute;
}

.get-in-touch__bg-layer {
  display: block;
  width: 100%;
  height: 100%;
}

.get-in-touch__bg-item--glow-left {
  left: -14%;
  top: 26%;
  width: 46vw;
  height: 42vw;
}

.get-in-touch__bg-item--glow-left .get-in-touch__bg-layer {
  border-radius: 62% 38% 55% 45% / 45% 55% 45% 55%;
  background: radial-gradient(closest-side, rgba(186, 214, 246, 0.6), rgba(186, 214, 246, 0));
}

.get-in-touch__bg-item--glow-right {
  right: -12%;
  top: 8%;
  width: 44vw;
  height: 44vw;
}

.get-in-touch__bg-item--glow-right .get-in-touch__bg-layer {
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(196, 222, 250, 0.7), rgba(196, 222, 250, 0));
}

.get-in-touch__bg-item--waves-top {
  left: -4%;
  top: -4%;
  width: 108%;
  height: 46%;
}

.get-in-touch__bg-item--waves-bottom {
  left: -6%;
  bottom: -4%;
  width: 112%;
  height: 40%;
}

.get-in-touch__bg-item--blob {
  right: -10%;
  bottom: 6%;
  width: 34vw;
  height: 28vw;
}

.get-in-touch__bg-item--blob .get-in-touch__bg-layer {
  border-radius: 41% 59% 47% 53% / 58% 42% 58% 42%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
}

.get-in-touch__bg-item--tooth {
  left: clamp(-30px, 1.5vw, 40px);
  top: clamp(24px, 3vw, 56px);
  width: clamp(130px, 14vw, 260px);
  aspect-ratio: 100 / 110;
  opacity: 0.85;
  filter: drop-shadow(0 20px 30px rgba(11, 47, 107, 0.08));
}

/* --------------------------------------------------------------------------
   4. Header
   -------------------------------------------------------------------------- */
.get-in-touch__header {
  max-width: 1040px;
  margin: 0 auto clamp(28px, 2.4vw, 40px);
  text-align: center;
}

.get-in-touch__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 clamp(16px, 1.6vw, 26px);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--git-navy);
}

.get-in-touch__eyebrow-line {
  display: block;
  width: 50px;
  height: 2px;
  border-radius: 2px;
  background: var(--git-orange);
  transform-origin: right center;
}

.get-in-touch__title {
  margin: 0 0 clamp(14px, 1.4vw, 22px);
  font-family: var(--git-font-display);
  font-size: var(--git-title-size);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--git-navy);
}

/* Line masks — padding leaves room for italic overhang + descenders */
.get-in-touch__title-line {
  display: block;
  overflow: hidden;
  padding: 0 0.1em 0.12em;
  margin-bottom: -0.12em;
}

.get-in-touch__title-text,
.get-in-touch__title-highlight {
  display: inline-block;
  text-wrap: balance;
}

.get-in-touch__title-highlight {
  font-style: italic;
  color: var(--git-orange-text);
}

.get-in-touch__description {
  max-width: 36em;
  margin: 0 auto;
  font-size: clamp(1rem, 1.1vw, 1.1875rem);
  line-height: 1.55;
  color: var(--git-navy-text);
}

/* --------------------------------------------------------------------------
   5. Feature cards
   -------------------------------------------------------------------------- */
.get-in-touch__features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.1vw, 20px);
  max-width: 1020px;
  margin: 0 auto clamp(20px, 1.4vw, 26px);
  padding: 0;
  list-style: none;
}

.get-in-touch__feature {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 22px 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 34px -26px rgba(11, 47, 107, 0.35), inset 0 0 0 1px var(--git-border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.get-in-touch__feature-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #E2EFFD;
  color: var(--git-blue);
}

.get-in-touch__feature-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.get-in-touch__feature-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.get-in-touch__feature-title {
  font-size: clamp(1.0625rem, 1.1vw, 1.1875rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--git-navy);
}

.get-in-touch__feature-text {
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--git-body);
}

/* --------------------------------------------------------------------------
   6. Form card
   -------------------------------------------------------------------------- */
.get-in-touch__form-card {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(24px, 2.2vw, 36px) clamp(22px, 2.1vw, 36px) clamp(24px, 2.2vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--git-card-radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 30px 60px -38px rgba(11, 47, 107, 0.38), inset 0 0 0 1px var(--git-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.get-in-touch__form-title {
  margin: 0 0 6px;
  font-family: var(--git-font-display);
  font-size: clamp(1.75rem, 2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--git-navy);
}

.get-in-touch__form-text {
  margin: 0 0 clamp(20px, 1.6vw, 28px);
  font-size: clamp(0.9375rem, 1vw, 1.0625rem);
  line-height: 1.5;
  color: var(--git-navy-text);
}

.get-in-touch__form {
  position: relative;
  margin: 0;
}

/* --------------------------------------------------------------------------
   7. Form fields (floating labels: they sit like placeholders when empty
      and lift above the value on focus / when filled)
   -------------------------------------------------------------------------- */
.get-in-touch__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.get-in-touch__field {
  position: relative;
  min-width: 0;
}

.get-in-touch__field--textarea {
  grid-column: 1 / -1;
}

.get-in-touch__control {
  display: block;
  width: 100%;
  height: var(--git-field-h);
  margin: 0;
  padding: 22px 18px 6px 62px;
  border: 1.5px solid var(--git-border);
  border-radius: var(--git-field-radius);
  background: rgba(255, 255, 255, 0.8);
  color: var(--git-navy);
  font: 500 1rem/1.3 var(--git-font-body);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease;
}

.get-in-touch__control::placeholder {
  color: transparent;
}

.get-in-touch__field--select .get-in-touch__control {
  padding-right: 52px;
  cursor: pointer;
}

.get-in-touch__field--textarea .get-in-touch__control {
  height: auto;
  min-height: 140px;
  padding-top: 30px;
  resize: vertical;
}

.get-in-touch__field-icon {
  position: absolute;
  top: calc(var(--git-field-h) / 2);
  left: 20px;
  z-index: 1;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  color: #5D7396;
  pointer-events: none;
  transition: color 0.35s ease, transform 0.35s var(--git-ease);
}

.get-in-touch__field--textarea .get-in-touch__field-icon {
  top: 30px;
}

.get-in-touch__field-icon svg,
.get-in-touch__chevron svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.get-in-touch__label {
  position: absolute;
  top: calc(var(--git-field-h) / 2);
  left: 62px;
  right: 18px;
  overflow: hidden;
  color: var(--git-muted);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
  transform: translateY(-50%);
  transform-origin: left center;
  transition: transform 0.35s var(--git-ease), color 0.35s ease, top 0.35s var(--git-ease);
}

.get-in-touch__field--textarea .get-in-touch__label {
  top: 30px;
}

/* Floated state */
.get-in-touch__field:focus-within .get-in-touch__label,
input.get-in-touch__control:not(:placeholder-shown) + .get-in-touch__label,
textarea.get-in-touch__control:not(:placeholder-shown) + .get-in-touch__label,
select.get-in-touch__control:valid + .get-in-touch__label {
  top: 16px;
  transform: translateY(-50%) scale(0.78);
  color: var(--git-blue);
}

.get-in-touch__field--textarea:focus-within .get-in-touch__label,
.get-in-touch__field--textarea .get-in-touch__control:not(:placeholder-shown) + .get-in-touch__label {
  top: 14px;
}

.get-in-touch__chevron {
  position: absolute;
  top: calc(var(--git-field-h) / 2);
  right: 20px;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  color: var(--git-navy);
  pointer-events: none;
  transition: transform 0.35s var(--git-ease), color 0.35s ease;
}

/* Hover / focus */
.get-in-touch__control:hover {
  border-color: rgba(31, 111, 214, 0.3);
}

.get-in-touch__control:focus,
.get-in-touch__control:focus-visible {
  border-color: var(--git-blue-bright);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(42, 132, 240, 0.12);
}

.get-in-touch__field:focus-within .get-in-touch__field-icon {
  color: var(--git-blue-bright);
  transform: scale(1.06);
}

.get-in-touch__field--select:focus-within .get-in-touch__chevron {
  color: var(--git-blue-bright);
  transform: translateY(1px);
}

/* Validation */
.get-in-touch__error {
  min-height: 0;
  margin: 0;
  padding-left: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--git-error);
}

.get-in-touch__error:not(:empty) {
  margin-top: 6px;
}

.get-in-touch__field.is-invalid .get-in-touch__control {
  border-color: rgba(194, 54, 47, 0.6);
  box-shadow: 0 0 0 4px rgba(194, 54, 47, 0.08);
}

.get-in-touch__field.is-invalid .get-in-touch__field-icon,
.get-in-touch__field.is-invalid .get-in-touch__label {
  color: var(--git-error);
}

.get-in-touch__field.is-valid .get-in-touch__control {
  border-color: rgba(31, 111, 214, 0.32);
}

/* --------------------------------------------------------------------------
   8. Buttons + success message
   -------------------------------------------------------------------------- */
.get-in-touch__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 18px;
}

.get-in-touch__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 40px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #FF7A30, var(--git-orange) 55%, #F25A14);
  color: #FFFFFF;
  font: 600 1.0625rem/1 var(--git-font-body);
  cursor: pointer;
  box-shadow: 0 14px 28px -16px rgba(242, 90, 20, 0.8);
  transition: transform 0.35s var(--git-ease), box-shadow 0.35s ease, filter 0.35s ease;
}

.get-in-touch__submit:hover {
  transform: translateY(-2px);
  filter: saturate(1.08) brightness(0.96);
  box-shadow: 0 20px 32px -16px rgba(232, 84, 15, 0.85);
}

.get-in-touch__submit:active {
  transform: translateY(0);
}

.get-in-touch__submit:focus-visible {
  outline: 2px solid var(--git-navy);
  outline-offset: 4px;
}

.get-in-touch__submit[disabled] {
  cursor: progress;
  opacity: 0.85;
}

.get-in-touch__submit-arrow {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--git-ease);
}

.get-in-touch__submit:hover .get-in-touch__submit-arrow {
  transform: translateX(4px);
}

.get-in-touch__required-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--git-muted);
}

.get-in-touch__success {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px 20px;
  border: 1px solid rgba(31, 111, 214, 0.22);
  border-radius: 16px;
  background: linear-gradient(135deg, #EEF6FF, #F7FBFF);
}

.get-in-touch__success[hidden] {
  display: none;
}

.get-in-touch__success-icon {
  flex: none;
  width: 32px;
  height: 32px;
  color: var(--git-blue);
}

.get-in-touch__success-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.get-in-touch__success-text {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--git-navy);
}

/* --------------------------------------------------------------------------
   9. Animation helper classes
   Elements marked data-git-reveal start hidden only until JS takes over
   (.is-animated); the fail-safe shows them if GSAP never loads.
   -------------------------------------------------------------------------- */
.get-in-touch-section:not(.is-animated) [data-git-reveal] {
  opacity: 0;
  animation: get-in-touch-failsafe 0.8s ease 1.8s forwards;
}

@keyframes get-in-touch-failsafe {
  to { opacity: 1; }
}

/* ==========================================================================
   10. Responsive
   ========================================================================== */

/* iPad landscape */
@media (max-width: 1199px) {
  .get-in-touch-section {
    --git-title-size: clamp(2.4rem, 5vw, 3.6rem);
  }

  .get-in-touch__feature {
    gap: 14px;
    padding: 14px 16px;
  }

  .get-in-touch__feature-icon {
    width: 54px;
    height: 54px;
  }

  .get-in-touch__feature-icon svg {
    width: 26px;
    height: 26px;
  }

  .get-in-touch__bg-item--tooth {
    width: 140px;
    left: -24px;
    opacity: 0.65;
  }
}

/* iPad portrait: features 2 + 1 (third centred), form stays two-column */
@media (max-width: 899px) {
  .get-in-touch-section {
    --git-title-size: clamp(2.3rem, 6.4vw, 3.2rem);
  }

  .get-in-touch__features {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .get-in-touch__feature {
    grid-column: span 2;
  }

  .get-in-touch__feature:last-child:nth-child(odd) {
    grid-column: 2 / span 2;
  }

  .get-in-touch__bg-item--blob {
    display: none;
  }
}

/* Mobile: single column throughout */
@media (max-width: 639px) {
  .get-in-touch-section {
    --git-title-size: clamp(2.1rem, 9.6vw, 2.75rem);
    --git-field-h: 56px;
    padding-top: 56px;
  }

  .get-in-touch__eyebrow {
    gap: 12px;
    font-size: 0.75rem;
  }

  .get-in-touch__eyebrow-line {
    width: 34px;
  }

  .get-in-touch__description {
    font-size: 0.9375rem;
  }

  .get-in-touch__features {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .get-in-touch__feature,
  .get-in-touch__feature:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .get-in-touch__form-card {
    padding: 22px 18px 24px;
    border-radius: 20px;
  }

  .get-in-touch__fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .get-in-touch__field--textarea .get-in-touch__control {
    min-height: 150px;
  }

  .get-in-touch__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .get-in-touch__submit {
    width: 100%;
  }

  .get-in-touch__required-note {
    text-align: center;
  }

  .get-in-touch__bg-item--tooth {
    width: 90px;
    top: 10px;
    left: -22px;
    opacity: 0.45;
  }
}

/* ==========================================================================
   11. Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .get-in-touch-section:not(.is-animated) [data-git-reveal] {
    animation-delay: 0.6s;
  }

  /* Only the elements that actually transition — a blanket * rule would also
     give opacity a transition and break GSAP reading the start values. */
  .get-in-touch__control,
  .get-in-touch__field-icon,
  .get-in-touch__label,
  .get-in-touch__chevron,
  .get-in-touch__submit,
  .get-in-touch__submit-arrow {
    transition: none !important;
  }

  .get-in-touch__submit:hover,
  .get-in-touch__submit:hover .get-in-touch__submit-arrow,
  .get-in-touch__field:focus-within .get-in-touch__field-icon {
    transform: none;
  }
}
