/* Contact (contact.html) and Quote (quote.html): the scene around the forms (docs/design-atmosphere.md).
 * Quote reuses the hero and the frosted stage with its own picture (the .fm-qt-page block at the end).
 * The hero is two chairs facing each other on the terrace above the clouds, ready for a conversation, with three
 * ways to reach Falmera beneath the copy. The forms sit on frosted glass over a soft sea of mist. This file only
 * styles the scene: the form card, its fields, tabs and booking picker keep their own rules in css/falmera.css.
 * Colours are tokens from css/falmera-palette.css. Moving states run only when js/falmera-contact-scene.js adds
 * .fm-ct-live (JavaScript and motion allowed). */

/* ── Hero ──────────────────────────────────────────────────────────────── */
.fm-ct-hero.fm-page-hero {
  position: relative; isolation: isolate; overflow: clip;
  margin-top: calc(-1 * var(--fm-header-h)); padding: 0;
  background: var(--at-porcelain);
  display: flex; flex-direction: column;
}
.fm-ct-hero__media { position: relative; order: 2; overflow: hidden; aspect-ratio: 5 / 4; background: var(--at-blush); }
.fm-ct-hero__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 70% 60%; }
.fm-ct-hero__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, var(--at-porcelain) 0%, rgb(247 239 234 / 0) 22%),
    linear-gradient(0deg, var(--at-porcelain) 0%, rgb(247 239 234 / 0) 20%);
}
/* On small screens the copy, the picture and the ways to reach us stack in that order. */
.fm-ct-hero__inner { display: contents; }
.fm-ct-hero__copy { order: 1; box-sizing: border-box; width: 100%; max-width: calc(var(--fm-container) + 2 * var(--fm-gutter)); margin-inline: auto; padding: calc(var(--fm-header-h) + clamp(1.5rem, 1rem + 2vw, 2.5rem)) var(--fm-gutter) var(--fm-space-4); }
.fm-ct-hero .fm-ct-hero__copy { gap: var(--fm-space-5); }
.fm-ct-hero .fm-h1 { text-wrap: balance; }

.fm-ct-ways {
  order: 3; list-style: none; margin: 0 auto; padding: 0 var(--fm-gutter) var(--fm-space-6);
  box-sizing: border-box; width: 100%; max-width: calc(var(--fm-container) + 2 * var(--fm-gutter));
  display: grid; gap: 0.75rem; position: relative; z-index: 1;
}
.fm-ct-hero__media + .fm-ct-hero__inner .fm-ct-ways { margin-top: -3.5rem; }
.fm-ct-way {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.9rem; align-items: center;
  padding: 1rem 1.15rem; border-radius: 20px;
  background: rgb(252 246 242 / 0.82); border: 1px solid rgb(255 255 255 / 0.75);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 24px 50px -30px rgb(58 34 54 / 0.45);
  transition: translate 380ms var(--at-ease), box-shadow 380ms var(--at-ease), background-color 380ms var(--at-ease);
}
.fm-ct-way__icon {
  grid-row: span 2; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 14px;
  color: var(--at-snow); background: linear-gradient(135deg, var(--at-action), var(--at-violet) 60%, var(--at-coral));
  box-shadow: 0 10px 22px -12px rgb(118 82 193 / 0.8);
}
.fm-ct-way__icon svg { width: 22px; height: 22px; }
.fm-ct-way__label { margin: 0; font: 500 var(--fm-text-xs)/1.4 var(--fm-font-mono); letter-spacing: var(--fm-tracking-label); text-transform: uppercase; color: var(--at-label); }
.fm-ct-way__link {
  min-height: 24px; font-size: 1.0625rem; font-weight: 600; color: var(--at-ink); text-decoration: none; overflow-wrap: anywhere;
}
/* The whole card is the link's target. */
.fm-ct-way__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.fm-ct-way:focus-within { outline: 2px solid var(--at-action-ink); outline-offset: 3px; }
.fm-ct-way__link:focus-visible { outline: none; }
@media (hover: hover) {
  .fm-ct-way:hover { translate: 0 -3px; background: rgb(252 246 242 / 0.94); box-shadow: 0 30px 60px -30px rgb(58 34 54 / 0.5); }
  .fm-ct-way:hover .fm-ct-way__link { color: var(--at-action-ink); }
}

@media (max-width: 599px) {
  .fm-ct-ways { gap: 0.5rem; }
  .fm-ct-way { padding: 0.75rem 0.95rem; border-radius: 16px; }
  .fm-ct-way__icon { width: 2.35rem; height: 2.35rem; border-radius: 12px; }
  .fm-ct-way__icon svg { width: 19px; height: 19px; }
  .fm-ct-way__link { font-size: 1rem; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  .fm-ct-hero__media { aspect-ratio: 16 / 9; }
  .fm-ct-ways { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fm-ct-way { grid-template-columns: minmax(0, 1fr); row-gap: 0.4rem; }
  .fm-ct-way__icon { grid-row: auto; margin-bottom: 0.35rem; }
}

/* Desktop: the picture fills the hero; the copy sits in the open sky and the ways line up along the foot. */
@media (min-width: 1024px) {
  .fm-ct-hero.fm-page-hero { display: block; min-height: clamp(38rem, 88svh, 54rem); }
  .fm-ct-hero__media { position: absolute; inset: 0; aspect-ratio: auto; z-index: -1; }
  .fm-ct-hero__media img { object-position: 72% 58%; }
  .fm-ct-hero__media::after {
    background:
      linear-gradient(90deg, rgb(247 239 234 / 0.9) 0%, rgb(247 239 234 / 0.72) 30%, rgb(247 239 234 / 0.16) 50%, rgb(247 239 234 / 0) 60%),
      linear-gradient(0deg, var(--at-porcelain) 0%, rgb(247 239 234 / 0.6) 12%, rgb(247 239 234 / 0) 34%);
  }
  .fm-ct-hero__inner {
    display: grid; grid-template-rows: 1fr auto; min-height: inherit; box-sizing: border-box;
    width: 100%; max-width: calc(var(--fm-container) + 2 * var(--fm-gutter)); margin-inline: auto; padding-inline: var(--fm-gutter);
  }
  .fm-ct-hero__copy { align-self: center; max-width: min(36rem, 44vw); margin: 0; padding: calc(var(--fm-header-h) + 3rem) 0 2.5rem; }
  .fm-ct-ways { margin: 0; padding: 0 0 clamp(2rem, 1rem + 2vw, 3rem); max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .fm-ct-hero__media + .fm-ct-hero__inner .fm-ct-ways { margin-top: 0; }
  .fm-ct-way { padding: 1.15rem 1.35rem; }
}

/* Phones and tablets: the picture fills the hero behind the copy, as on desktop, and the ways to reach us line up
   along its foot. The sharp picture holds the lower part; above it a soft blur of the same picture carries the sky
   up behind the copy. */
@media (max-width: 1023px) {
  .fm-ct-hero.fm-page-hero { display: block; min-height: max(100svh, 44rem); }
  .fm-ct-hero__media { position: absolute; inset: 0; aspect-ratio: auto; z-index: -1; }
  .fm-ct-hero__media::before {
    content: ""; position: absolute; inset: -8%;
    background: var(--ct-sky, url("../assets/img/contact/talk-960.webp")) 60% 0 / cover no-repeat;
    filter: blur(26px) saturate(1.05);
  }
  /* The chairs sit just above the ways to reach us, which stand on the terrace floor. */
  .fm-ct-hero__media img {
    position: absolute; inset: auto 0 var(--ct-foot, 12rem) 0; height: max(54%, 23rem); object-position: 64% 72%;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 84%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 84%, transparent 100%);
  }
  .fm-ct-hero__media::after {
    background:
      linear-gradient(180deg, rgb(247 239 234 / 0.9) 0%, rgb(247 239 234 / 0.62) 32%, rgb(247 239 234 / 0) 50%),
      linear-gradient(0deg, var(--at-porcelain) 0%, rgb(247 239 234 / 0.5) 10%, rgb(247 239 234 / 0) 26%);
  }
  .fm-ct-hero__inner {
    display: flex; flex-direction: column; min-height: inherit; box-sizing: border-box;
    width: 100%; max-width: calc(var(--fm-container) + 2 * var(--fm-gutter)); margin-inline: auto; padding-inline: var(--fm-gutter);
  }
  .fm-ct-hero__copy { padding-inline: 0; max-width: 40rem; margin: 0; }
  .fm-ct-hero__media + .fm-ct-hero__inner .fm-ct-ways { margin: auto 0 0; padding: max(24svh, 11rem) 0 clamp(1.25rem, 1rem + 2vw, 2rem); max-width: none; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  .fm-ct-hero__media img { object-position: 62% 60%; }
}

/* ── The forms, on frosted glass over the mist ─────────────────────────── */
.fm-section.fm-ct-stage { position: relative; isolation: isolate; overflow: clip; background: var(--at-porcelain); padding-top: var(--fm-space-6); padding-bottom: clamp(4rem, 3rem + 4vw, 7rem); }
.fm-ct-backdrop { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fm-ct-backdrop img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.fm-ct-backdrop::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, var(--at-porcelain) 0%, rgb(247 239 234 / 0.35) 18%, rgb(247 239 234 / 0.2) 60%, var(--at-porcelain) 100%);
}
.fm-ct-page .fm-ct-stage .fm-form-card {
  background: rgb(252 246 242 / 0.9);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-color: rgb(255 255 255 / 0.8);
  box-shadow: 0 50px 100px -50px rgb(58 34 54 / 0.55);
}
.fm-ct-page .fm-ct-stage .fm-contact__aside {
  padding: clamp(1.25rem, 0.9rem + 1.6vw, 2.25rem); border-radius: var(--fm-radius-lg);
  background: rgb(252 246 242 / 0.66); border: 1px solid rgb(255 255 255 / 0.7);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.fm-ct-page .fm-next-steps__num { color: var(--at-action-ink); }

/* Reassurance: the three promises sit as one soft band. */
.fm-ct-page .fm-assurance > li { transition: translate 380ms var(--at-ease); }

/* ── Motion (only with .fm-ct-live) ───────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .fm-ct-live .fm-ct-hero__media img {
    translate: 0 calc(var(--hv, 0) * 9%);
    animation: fm-ct-settle 2.6s var(--at-ease) both;
  }
  @keyframes fm-ct-settle { from { scale: 1.12; } to { scale: 1; } }
  .fm-ct-live .fm-ct-hero__copy > * { animation: fm-ct-rise 1s var(--at-ease) both; }
  .fm-ct-live .fm-ct-hero__copy > :nth-child(2) { animation-delay: 120ms; }
  .fm-ct-live .fm-ct-hero__copy > :nth-child(3) { animation-delay: 260ms; }
  .fm-ct-live .fm-ct-hero__copy > :nth-child(4) { animation-delay: 400ms; }
  .fm-ct-live .fm-ct-way { animation: fm-ct-rise 1s var(--at-ease) both; }
  .fm-ct-live .fm-ct-way:nth-child(1) { animation-delay: 420ms; }
  .fm-ct-live .fm-ct-way:nth-child(2) { animation-delay: 520ms; }
  .fm-ct-live .fm-ct-way:nth-child(3) { animation-delay: 620ms; }
  @keyframes fm-ct-rise { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
  /* The icons breathe a little light, one after another. */
  .fm-ct-live .fm-ct-way__icon { animation: fm-ct-glow 6s var(--at-ease) infinite; }
  .fm-ct-live .fm-ct-way:nth-child(2) .fm-ct-way__icon { animation-delay: 2s; }
  .fm-ct-live .fm-ct-way:nth-child(3) .fm-ct-way__icon { animation-delay: 4s; }
  @keyframes fm-ct-glow {
    0%, 30%, 100% { box-shadow: 0 10px 22px -12px rgb(118 82 193 / 0.8); }
    12% { box-shadow: 0 10px 22px -12px rgb(118 82 193 / 0.8), 0 0 0 6px rgb(118 82 193 / 0.14), 0 0 26px 6px rgb(246 148 119 / 0.45); }
  }
  /* The mist drifts slower than the page behind the forms. */
  .fm-ct-live .fm-ct-backdrop img { scale: 1.15; translate: 0 var(--by, 0px); }
}

/* ── Quote: a balance at rest (quote.html) ────────────────────────────── */
.fm-qt-page { --ct-sky: url("../assets/img/quote/scale-960.webp"); }
.fm-qt-page .fm-ct-hero__media img { object-position: 72% 55%; }
@media (min-width: 600px) { .fm-qt-page .fm-ct-hero__media img { object-position: 70% 55%; } }
@media (max-width: 1023px) {
  .fm-qt-page .fm-ct-hero.fm-page-hero { min-height: max(100svh, 42rem); }
  .fm-qt-page .fm-ct-hero__copy { padding-bottom: max(40svh, 18rem); }
  .fm-qt-page { --ct-foot: 0px; }
  .fm-qt-page .fm-ct-hero__media img {
    height: clamp(19rem, 52%, 30rem); object-position: 72% 60%;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%); mask-image: linear-gradient(180deg, transparent 0, #000 22%);
  }
}
/* Small phones: a shorter picture keeps the balance clear of the buttons. */
@media (max-width: 380px) {
  .fm-qt-page .fm-ct-hero__media img { height: max(44%, 19rem); }
}
@media (min-width: 1024px) {
  .fm-qt-page .fm-ct-hero.fm-page-hero { min-height: clamp(36rem, 82svh, 50rem); }
  .fm-qt-page .fm-ct-hero__media img { object-position: 70% 55%; }
  .fm-qt-page .fm-ct-hero__copy { padding-bottom: 4rem; }
}
.fm-qt-page .fm-pricing { background: linear-gradient(180deg, var(--at-porcelain) 0%, var(--at-rose-mist) 55%, var(--at-porcelain) 100%); }
.fm-qt-page .fm-ct-stage .fm-quote-request__copy {
  padding: clamp(1.25rem, 0.9rem + 1.6vw, 2.25rem); border-radius: var(--fm-radius-lg);
  background: rgb(252 246 242 / 0.66); border: 1px solid rgb(255 255 255 / 0.7);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}


/* Optional SMS consent box on the consultation form: legal wording reads as body text, not a bold label. */
.fm-check--consent { font-weight: 400; font-size: 0.875rem; line-height: 1.5; }
.fm-check--consent input { width: 24px; height: 24px; margin: 0; }
