/* ==========================================================================
   Contact (Figma "07. Contact"): the message form beside the masthead film,
   then the shared Get in touch + footer from home2.css. Sizes are measured
   from the 1440-wide Figma frame and scale down with the viewport.
   Behaviour (switch, validation, Turnstile check) lives in contact.js.
   ========================================================================== */

[data-page="contact"] main { position: relative; overflow: clip; }
.c-pattern { top: 786px; } /* the Figma pattern starts just under the form and runs behind the footer */
[data-page="contact"] main > section { position: relative; z-index: 1; }

/* ---------- Send us a message ---------- */
.c-enquire {
  max-width: 1440px; margin: 0 auto;
  padding: clamp(120px, 18.9vw, 272px) clamp(16px, 11.1vw, 160px) clamp(64px, 6.39vw, 92px); /* Figma clips the frame 92px under the form */
  display: grid; grid-template-columns: minmax(0, 571fr) minmax(0, 455fr); column-gap: clamp(32px, 6.53vw, 94px);
  grid-template-areas: "head form" "media form"; align-items: start;
  /* The head row keeps its own height, so a taller form (Career adds a field)
     grows the media row instead of pushing the video down. */
  grid-template-rows: auto 1fr;
}
.c-head { grid-area: head; }
.c-head h1 {
  margin: 0; font-family: var(--display); font-weight: 300;
  font-size: clamp(32px, 3.61vw, 52px); line-height: 1.25; letter-spacing: -0.01em;
}
.c-head p { margin: 16px 0 0; font-size: 16px; line-height: 1.2; letter-spacing: -0.01em; opacity: .4; }
.c-media { grid-area: media; margin-top: 64px; aspect-ratio: 571 / 705; border-radius: 16px; overflow: hidden; background: #2f2028; }
.c-media video { display: block; width: 100%; height: 100%; object-fit: cover; }

.form-card { grid-area: form; padding-top: 160px; }
.form-card form { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }

/* Client / career switch: two 200px tabs, the blue thumb slides between them */
.seg { position: relative; display: inline-grid; grid-template-columns: repeat(2, minmax(0, 200px)); max-width: 100%; padding: 2px; border-radius: 24px; background: rgba(255,255,255,.05); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { position: relative; z-index: 1; padding: 16px; text-align: center; cursor: pointer; font-size: 16px; line-height: 20px; letter-spacing: .005em; }
.seg .thumb { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); border-radius: 22px; background: var(--blue); transition: transform .6s var(--ease-out); }
.seg[data-mode="careers"] .thumb { transform: translateX(100%); }
.seg:has(input:focus-visible) { outline: 2px solid rgba(125,152,255,.9); outline-offset: 2px; }

/* Fields */
.field { position: relative; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 16px; line-height: 20px; letter-spacing: .005em; }
.field input, .field textarea, .field select {
  width: 100%; padding: 23px; border-radius: 24px; border: 1px solid transparent; outline: 0; /* 23 + 1px border = Figma's 24px padding */
  background: rgba(255,255,255,.05); color: #fff; font: inherit; font-size: 16px; line-height: 20px; letter-spacing: .005em;
  transition: border-color .3s, background .3s;
}
.field ::placeholder { color: rgba(255,255,255,.24); opacity: 1; }
.field textarea { height: 130px; min-height: 130px; resize: vertical; display: block; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(-45deg, transparent 50%, #fff 50%); background-position: calc(100% - 30px) 52%, calc(100% - 25px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { background: #15161c; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(125,152,255,.6); background: rgba(255,255,255,.07); }
.field .err { position: absolute; top: 0; right: 0; font-size: 12px; line-height: 20px; color: #ff8a8a; opacity: 0; transition: opacity .3s; }
.field.invalid input, .field.invalid textarea { border-color: rgba(255,120,120,.8); }
.field.invalid .err { opacity: 1; }
.field.careers-only { display: none; }
.form-card[data-mode="careers"] .field.careers-only { display: flex; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Turnstile human check (contact.js renders the widget into .turnstile-slot) */
.human { display: flex; flex-direction: column; gap: 8px; min-height: 65px; }
.human-err { font-size: 12px; line-height: 20px; color: #ff8a8a; opacity: 0; transition: opacity .3s; }
.human.invalid .human-err { opacity: 1; }
.human.invalid .turnstile-slot { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.form-status { margin: 0; font-size: 14px; line-height: 1.4; color: #ff8a8a; }
.form-card form[aria-busy="true"] button[type="submit"] { opacity: .5; cursor: progress; }

/* Sent state */
.sent { display: none; }
.sent .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; box-shadow: 0 0 40px rgba(19,64,241,.6); animation: pop .8s var(--ease-out); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.sent h2 { margin: 28px 0 8px; font-family: var(--display); font-weight: 300; font-size: clamp(26px, 2.5vw, 36px); line-height: 1.25; letter-spacing: -0.01em; }
.sent p { margin: 0 0 12px; font-size: 16px; line-height: 1.4; opacity: .7; }
.sent small { display: block; margin-bottom: 28px; font-size: 12px; opacity: .45; }
.form-card.is-sent form { display: none; }
.form-card.is-sent .sent { display: block; }

@media (max-width: 900px) {
  .c-enquire { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "form" "media"; grid-template-rows: none; }
  .form-card { padding-top: 40px; }
  .c-media { margin-top: 64px; }
}

/* Phones (Figma mobile "07. Contact", 1787:26426): 80px under the 89px header,
   48px between heading, switch, fields and film; the switch spans the column */
@media (max-width: 600px) {
  .c-enquire { padding: 169px var(--gutter) 80px; }
  .c-head h1 { font-size: 32px; line-height: 1.2; }
  .form-card { padding-top: 48px; }
  .seg { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
  .human { position: relative; }
  .human-err { position: absolute; top: 100%; left: 0; } /* no empty line held open under the check */
  .form-card .btn { margin-top: 8px; } /* 32px under the human check */
  .c-media { margin-top: 48px; border-radius: 9.6px; }
}
