/* =========================================================
   CONTACT PAGE (contact.html)
   ========================================================= */

/* Hero is above the fold, so its entrance is pure CSS —
   it must never depend on JS to become visible. */
.contact-hero {
  padding-block: 4.5rem 3.5rem;
  text-align: center;
}

.contact-hero h1 {
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 1.5rem;
  animation: heroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.contact-hero p {
  color: var(--text-muted);
  font-size: clamp(1.02rem, 1.9vw, 1.25rem);
  max-width: 48ch;
  margin-inline: auto;
  animation: heroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-hero h1,
  .contact-hero p { animation: none; }
}

/* ---------- FORM ---------- */

.contact-form {
  max-width: 900px;
  margin-inline: auto;
  display: grid;
  gap: 1.75rem;
}

.field { display: flex; flex-direction: column; gap: 0.75rem; }

.field-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.field label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--white);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { min-height: 170px; resize: vertical; }

.field input::placeholder,
.field textarea::placeholder { color: rgba(255, 255, 255, 0.38); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-pink);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 4px rgba(255, 46, 99, 0.14);
}

/* Native select arrow is unstyleable across browsers — draw our own */
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.6) 50%),
                    linear-gradient(135deg, rgba(255,255,255,0.6) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.field select option,
.field select optgroup {
  background: #0A0F1E;
  color: #FFFFFF;
}
/* Firefox/Windows render the open list from the select's own colours */
.field select { color-scheme: dark; }

/* ---------- VALIDATION STATES ---------- */

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 4px rgba(197, 3, 55, 0.16);
}

.field-error {
  font-size: 0.85rem;
  color: var(--accent-pink);
  min-height: 1.1em;
  display: none;
}
.field.has-error .field-error { display: block; }

/* Honeypot — hidden from people, visible to bots that fill everything */
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- SUBMIT ---------- */

.submit-btn {
  width: 100%;
  justify-content: center;
  padding: 1.2rem 2rem;
  font-size: 1rem;
  margin-top: 0.75rem;
}
.submit-btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---------- STATUS MESSAGES ---------- */

.form-status {
  display: none;
  padding: 1.15rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.96rem;
}
.form-status.is-visible { display: block; }
.form-status.is-success {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--accent-pink);
  color: var(--white);
}
.form-status.is-error {
  background: rgba(197, 3, 55, 0.14);
  border: 1px solid var(--accent-red);
  color: var(--white);
}

.contact-section { padding-top: 1rem; }

@media (max-width: 880px) {
  .field-row { grid-template-columns: 1fr; }
  .contact-hero { padding-block: 3rem 2rem; }
}

/* ---------- SUCCESS PANEL (replaces the form) ---------- */

.form-success {
  max-width: 560px;
  margin: 2rem auto 0;
  padding: 3.5rem 2.5rem;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 46, 99, 0.4);
  background: rgba(255, 255, 255, 0.028);
  animation: successIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.form-success[hidden] { display: none; }

.success-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 1.75rem;
  border-radius: 50%;
  background: var(--accent-red);
  color: var(--white);
  box-shadow: 0 0 0 8px rgba(197, 3, 55, 0.16);
}
.success-mark svg {
  width: 34px;
  height: 34px;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* Tick draws itself in */
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawTick 0.5s cubic-bezier(0.65, 0, 0.35, 1) 0.35s forwards;
}

.form-success h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 0.75rem;
}

.form-success p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 38ch;
  margin-inline: auto;
  margin-bottom: 2rem;
}

@keyframes successIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes drawTick {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .form-success { animation: none; }
  .success-mark svg { animation: none; stroke-dashoffset: 0; }
}

/* ---------- CONDITIONAL CONTACT DETAIL ---------- */

.contact-detail[hidden] { display: none; }

/* Eases open rather than snapping in when a method is chosen */
.contact-detail {
  animation: detailIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes detailIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

.detail-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.country-code {
  flex: 0 0 auto;
  width: 140px;
  /* Matches the other selects but sized for a code, not a sentence */
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  padding-right: 2.4rem;
}
.country-code[hidden] { display: none; }

.detail-row input { flex: 1 1 auto; min-width: 0; }

@media (max-width: 560px) {
  .detail-row { flex-direction: column; }
  .country-code { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-detail { animation: none; }
}
/* Keep WhatsApp dial codes compact and give the number room to type. */
.contact-detail.is-phone .detail-row { flex-direction: row; }
.contact-detail.is-phone select.country-code {
  flex: 0 0 125px;
  width: 125px;
  min-width: 0;
  padding-left: 1rem;
  padding-right: 2rem;
}
.contact-detail.is-phone #contact-value {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
}
@media (max-width: 400px) {
  .contact-detail.is-phone select.country-code {
    flex-basis: 105px;
    width: 105px;
    padding-left: 0.65rem;
  }
  .contact-detail.is-phone #contact-value { padding-inline: 0.75rem; }
}

#custom-category-field[hidden] { display: none; }
