/* =========================================
   KALSEPADHUNGA — CONTACT PAGE
   Uses the shared application theme variables.
========================================= */

/* PAGE BASE */

.contact-page {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  margin: 0;

  width: min(100% - 2rem, 68.75rem);
  margin-inline: auto;

  color: var(--text-primary);
  background: transparent;
  overflow-x: hidden;
}

.contact-page *,
.contact-page *::before,
.contact-page *::after {
  box-sizing: border-box;
}

.contact-page::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background: var(--gradient-main);
}

.contact-container {
  width: min(100% - clamp(1.25rem, 4vw, 2rem), 1100px);
  margin-inline: auto;
}

/* HEADER */

.contact-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: calc(100% - 1rem);
  min-height: 4.5rem;
  margin: 0 auto;
  padding: 0.75rem 0.85rem;
  background: var(--home-header-bg);
  border: 1px solid var(--home-header-border);
  border-top: 0;
  border-radius: 0 0 1.4rem 1.4rem;
  box-shadow: var(--home-header-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.contact-back {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--text-primary);
  background: var(--home-header-button-bg);
  border: 1px solid var(--home-header-button-border);
  border-radius: 50%;
  box-shadow: var(--home-header-button-shadow);
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease;
}

.contact-back svg {
  width: 1.35rem;
  height: 1.35rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-back:hover {
  transform: translateY(-2px);
}

.contact-back:focus-visible,
.contact-header-brand:focus-visible,
.contact-bottom a:focus-visible {
  outline: 3px solid var(--brand-text-soft);
  outline-offset: 4px;
}

.contact-header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--brand-text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-decoration: none;
  white-space: nowrap;
}

.contact-brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: var(--text-on-primary);
  background: var(--gradient-btn);
  border: 1px solid var(--primary);
  border-radius: 0.7rem;
  box-shadow: var(--card-shadow);
  font-size: 1.1rem;
  font-weight: 800;
}

.contact-header-label {
  justify-self: end;
  padding: 0.45rem 0.75rem;
  color: var(--text-secondary);
  background: var(--background-glass);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

/* SHARED TEXT */

.contact-eyebrow {
  display: inline-block;
  margin: 0 0 1.15rem;
  padding: 0.55rem 1rem;
  color: var(--brand-text);
  background: var(--background-glass);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  line-height: 1.4;
}

.contact-hero h1,
.contact-form-heading h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(2.25rem, 6.5vw, 4.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.contact-hero h1 span,
.contact-form-heading h2 span {
  display: block;
  color: var(--brand-text);
}

.contact-hero-description,
.contact-form-heading > p:last-child {
  max-width: 650px;
  margin: 1.25rem auto 0;
  color: var(--text-secondary);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.8;
}

/* HERO */

.contact-hero {
  position: relative;
  isolation: isolate;
  padding: clamp(4rem, 9vw, 7rem) 1rem clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}

.contact-hero::before {
  position: absolute;
  z-index: -1;
  top: 12%;
  left: 50%;
  width: min(70vw, 32rem);
  aspect-ratio: 1;
  content: "";
  background: var(--about-hero-glow);
  border-radius: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

/* CONTACT REASONS */

.contact-reasons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1.15rem);
  width: min(100%, 950px);
  margin: 0 auto;
}

.contact-reason-card {
  min-width: 0;
  padding: clamp(1.15rem, 3vw, 1.6rem);
  background: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: 1.25rem;
  box-shadow: var(--card-shadow);
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.contact-reason-card:hover {
  transform: translateY(-4px);
  background: var(--card-background-hover);
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
}

.contact-reason-icon {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  margin-bottom: 1.1rem;
  color: var(--brand-text);
  background: var(--background-glass);
  border: 1px solid var(--card-border);
  border-radius: 0.9rem;
}

.contact-reason-icon svg {
  width: 1.4rem;
  height: 1.4rem;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-reason-card h2 {
  margin: 0 0 0.55rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.contact-reason-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.7;
}

/* FORM SECTION */

.contact-form-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: clamp(2rem, 6vw, 5rem);
  width: min(100%, 950px);
  margin: clamp(4rem, 9vw, 7rem) auto 0;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: 1.6rem;
  box-shadow: var(--card-shadow);
}

.contact-form-heading {
  position: sticky;
  top: 2rem;
}

.contact-form-heading h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.contact-form-heading > p:last-child {
  margin-top: 1rem;
  font-size: 0.92rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
}

.contact-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.contact-field label {
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.contact-field label > span:first-child {
  color: var(--brand-text);
}

.contact-optional {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  min-width: 0;
  padding: 0.9rem 1rem;
  color: var(--text-primary);
  background: var(--background-glass);
  border: 1px solid var(--card-border);
  border-radius: 0.85rem;
  outline: none;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.contact-field input,
.contact-field select {
  min-height: 3.15rem;
}

.contact-field textarea {
  min-height: 10rem;
  resize: vertical;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.contact-field select {
  cursor: pointer;
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow-primary);
}

.contact-field input:focus-visible,
.contact-field select:focus-visible,
.contact-field textarea:focus-visible {
  outline: none;
}

.contact-field-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.contact-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.2rem;
}

.contact-privacy-note {
  max-width: 17rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.73rem;
  line-height: 1.6;
}

.contact-submit {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 3.1rem;
  padding: 0.8rem 1.25rem;
  color: var(--text-on-primary);
  background: var(--gradient-btn);
  border: 1px solid var(--primary);
  border-radius: 999px;
  box-shadow: var(--card-shadow);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.contact-submit svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms ease;
}

.contact-submit:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  filter: brightness(1.04);
}

.contact-submit:hover svg {
  transform: translateX(3px);
}

.contact-submit:focus-visible {
  outline: 3px solid var(--brand-text-soft);
  outline-offset: 4px;
}

.contact-submit:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.contact-form-status--success {
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.contact-form-status[hidden] {
  display: none;
}

/* BOTTOM NOTE */

.contact-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: clamp(3rem, 7vw, 5rem) 1rem;
  text-align: center;
}

.contact-bottom p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

.contact-bottom a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--brand-text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.contact-bottom a span {
  transition: transform 180ms ease;
}

.contact-bottom a:hover span {
  transform: translateX(3px);
}

/* RESPONSIVE */

@media (max-width: 760px) {
  .contact-form-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-form-heading {
    position: static;
  }
}

@media (max-width: 600px) {
  .contact-header {
    grid-template-columns: auto 1fr auto;
    min-height: 4rem;
    padding-inline: 0.65rem;
  }

  .contact-header-brand {
    justify-self: center;
    gap: 0.45rem;
    font-size: 0.88rem;
  }

  .contact-brand-mark {
    width: 1.8rem;
    height: 1.8rem;
  }

  .contact-header-label {
    padding: 0.4rem 0.55rem;
    font-size: 0.6rem;
  }

  .contact-hero {
    padding-top: 3.75rem;
  }

  .contact-reasons {
    grid-template-columns: 1fr;
    width: min(100%, 28rem);
  }

  .contact-reason-card {
    display: grid;
    grid-template-columns: 2.8rem minmax(0, 1fr);
    column-gap: 0.9rem;
    align-items: center;
  }

  .contact-reason-icon {
    grid-row: span 2;
    margin: 0;
  }

  .contact-reason-card h2 {
    align-self: end;
    margin-bottom: 0.25rem;
  }

  .contact-reason-card p {
    align-self: start;
  }

  .contact-form-section {
    margin-top: 3.5rem;
    padding: 1.2rem;
    border-radius: 1.25rem;
  }

  .contact-form-row {
    grid-template-columns: 1fr;
  }

  .contact-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-privacy-note {
    max-width: none;
  }

  .contact-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-page *,
  .contact-page *::before,
  .contact-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
