/* =====================================================================
   CZsLazy — Project Brief (phone layout)
   Same system as the links and pricelist pages: a phone-width frame with
   the portrait locked at the top, a headline that pins while the form
   scrolls underneath, and the action buttons locked at the bottom.
   On desktop it stays a phone-width column over a blurred backdrop.
   ===================================================================== */

@font-face{
  font-family: "Afacad";
  src: url("../assets/fonts/afacad-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root{
  --bg: #050606;
  --fg: #fff;
  --label: #b3b3b3;               /* field labels */
  --faint: #8f8f8f;               /* hints, optional tags, placeholders */
  --card: #1a1b1b;                /* card background */
  --field: #0c0c0c;               /* input background */
  --ring: #4d4d4d;                /* card and input borders */
  --error: #ff9b8a;

  /* Widest the frame gets. Phones fill the screen; desktop keeps this width. */
  --frame-max: 430px;
  --frame-w: min(100vw, var(--frame-max));
  --bar-h: 110px;                  /* height of the locked button area */
  --sticky-h: 111.3px;             /* height of the pinned headline */
  --card-gap: 16px;                /* space between the cards */

  --ease: cubic-bezier(.45, .05, .2, 1);       /* gentle start, soft landing */
  --dur: .7s;                                  /* hover and fade speed */

  /* Desktop backdrop: the hero still, blurred, with a 4% white wash */
  --backdrop-blur: 10px;
  --backdrop-wash: rgba(255, 255, 255, .04);
}

*{ box-sizing: border-box; }

html,
body{
  height: 100%;
  margin: 0;
  background: var(--bg);
  overflow: hidden;                            /* the page itself never scrolls */
  overscroll-behavior: none;
}

body{
  font-family: "Afacad", system-ui, sans-serif;
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Desktop backdrop ---------- */
.backdrop{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

.backdrop::before{
  content: "";
  position: absolute;
  inset: -120px;
  background: url("../assets/images/links-bg.webp") center / cover no-repeat;
  filter: blur(var(--backdrop-blur));
}

.backdrop::after{
  content: "";
  position: absolute;
  inset: 0;
  background: var(--backdrop-wash);
}

@media (min-width: 480px){
  .backdrop{ display: block; }
}

/* ---------- Locked frame ---------- */
.frame{
  position: fixed;
  inset: 0;
  margin-inline: auto;
  width: var(--frame-w);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.portrait{
  position: absolute;
  top: 0;
  left: 50%;
  height: 328px;
  width: auto;
  max-width: none;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
}

/* ---------- Logo + headline ---------- */
.top-space{                         /* logo area; scrolls away */
  position: relative;
  flex: none;
  height: 159.2px;
}

.headline{                          /* pinned to the top while the form scrolls underneath */
  position: sticky;
  top: 0;
  z-index: 4;
  flex: none;
  padding: 12px 0 16.4px;
  text-align: center;
}

.headline::before{                  /* soft dark backing, shown only once the headline is pinned */
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: -14.5px;
  right: -14.5px;
  bottom: -22px;
  background: linear-gradient(180deg, rgba(5,6,6,.97) 0, rgba(5,6,6,.94) 70%, rgba(5,6,6,.9) 100%);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 74%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0, #000 74%, transparent 100%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}

.headline.is-stuck::before{ opacity: 1; }

.mark{
  position: absolute;
  top: 12px;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  fill: #fff;
}

.eyebrow{
  margin: 0;
  text-align: center;
  font-size: 20px;
  line-height: 24.4px;
  font-weight: 400;
  letter-spacing: .01em;
}

.title{
  margin: 7.3px 0 0;
  text-align: center;
  font-size: 42px;
  line-height: 51.2px;
  font-weight: 470;
  letter-spacing: -.043em;
  padding-right: .043em;
}

/* ---------- Scrolling form ---------- */
.scroll{
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-padding: calc(var(--sticky-h) + 12px) 0 calc(var(--bar-h) + 24px);

  /* the form dissolves before it reaches the buttons */
  -webkit-mask-image: linear-gradient(to bottom,
    #000 0,
    #000 calc(100% - var(--bar-h) - 10px),
    transparent calc(100% - var(--bar-h) + 28px));
          mask-image: linear-gradient(to bottom,
    #000 0,
    #000 calc(100% - var(--bar-h) - 10px),
    transparent calc(100% - var(--bar-h) + 28px));
}

.scroll::-webkit-scrollbar{ display: none; }

.stack{
  display: flex;
  flex-direction: column;
  padding: 0 14.5px calc(var(--bar-h) + 40px);
}

.intro{
  margin: 14px 10px 22px;
  text-align: center;
  font-size: 15px;
  line-height: 20px;
  color: #c4c4c4;
}

/* ---------- Progress ---------- */
.steps{
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
}

.steps li{ flex: 1; min-width: 0; }

.steps .bar{
  display: block;
  height: 4px;
  border-radius: 2px;
  background: #2e2f2f;
  transition: background-color var(--dur) var(--ease);
}

.steps .lab{
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 16px;
  color: var(--faint);
  transition: color var(--dur) var(--ease);
}

.steps li.is-done .bar{ background: #ababab; }
.steps li.is-done .lab{ color: var(--label); }
.steps li.is-current .bar{ background: #fff; }
.steps li.is-current .lab{ color: #fff; font-weight: 600; }

/* ---------- Steps and cards ---------- */
.step{
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.step[hidden]{ display: none; }

.step.is-active{ animation: step-in .6s var(--ease); }

@keyframes step-in{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: none; }
}

.card{
  padding: 20px;
  border: 1px solid var(--ring);
  border-radius: 12px;
  background: var(--card);
}

.card h2{
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 22px;
  font-weight: 600;
}

.field{ margin-bottom: 20px; }
.field:last-child{ margin-bottom: 0; }

.lbl{
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 18px;
  color: var(--label);
}

.opt{
  margin-left: 6px;
  color: var(--faint);
}

/* ---------- Inputs ---------- */
.inp{
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--ring);
  border-radius: 10px;
  background: var(--field);
  color: #fff;
  font: 400 16px/1.25 "Afacad", system-ui, sans-serif;
  outline: none;
  transition: border-color .5s var(--ease), box-shadow .5s var(--ease);
}

.inp::placeholder{ color: var(--faint); }

.inp:focus{
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .18);
}

.ta{
  height: 96px;
  padding: 12px 14px;
  line-height: 20px;
  resize: none;
}

.pair{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.pair[hidden]{ display: none; }

.inp[aria-invalid="true"]{ border-color: var(--error); }
.chips.is-invalid .chip{ border-color: var(--error); }

.err{
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 17px;
  color: var(--error);
}

.err[hidden]{ display: none; }

.hint{
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 17px;
  color: var(--faint);
}

.hint--max{ color: #fff; }
.hint[hidden]{ display: none; }

.note{
  margin: 4px 8px 0;
  text-align: center;
  font-size: 13px;
  line-height: 17px;
  color: var(--faint);
}

/* ---------- Choice chips ---------- */
.chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip{
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: 500 14px/1 "Afacad", system-ui, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .5s var(--ease), border-color .5s var(--ease), color .5s var(--ease);
}

.chip.on{
  border-color: transparent;
  background: linear-gradient(180deg, #e2e2e2, #ababab);
  color: #0b0c0b;
}

.chip--add{
  margin-top: 4px;
  border-style: dashed;
}

.chip--add[hidden]{ display: none; }

@media (hover: hover){
  .chip:not(.on):hover{ border-color: #fff; }
}

.chip:focus-visible,
.btn:focus-visible{
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ---------- Buttons (locked at the bottom) ---------- */
.actions{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  gap: 12px;
  padding: 0 14.5px calc(20px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.btn{
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 16px/1 "Afacad", system-ui, sans-serif;
  letter-spacing: .01em;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  transition:
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.btn[hidden]{ display: none; }

.btn--primary{ flex: 1; background: #fff; color: #0b0c0b; }
.btn--metal{ flex: 1; background: linear-gradient(180deg, #e2e2e2, #ababab); color: #0b0c0b; }
.btn--ghost{
  flex: 0 0 112px;
  border-color: rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-weight: 500;
}

.btn::before{                       /* white fill that sweeps in on hover and leaves out the other side */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #fff;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform calc(var(--dur) + .2s) var(--ease);
}

.btn-arrow,
.btn-icon{
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform calc(var(--dur) + .2s) var(--ease);
}

.btn-icon{ width: 20px; height: 20px; }

@media (hover: hover){
  .btn:hover{
    transform: translateY(-3px);
    box-shadow: 0 12px 34px rgba(255, 255, 255, .14);
  }

  .btn:hover::before{
    transform: scaleX(1);
    transform-origin: left;
  }

  .btn--ghost:hover{ color: #0b0c0b; border-color: #fff; }
  .btn:hover .btn-arrow{ transform: translateX(6px); }
}

.btn:active{
  transform: translateY(0) scale(.985);
  transition-duration: .2s;
}

/* text for screen readers and search engines only */
.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce){
  .step.is-active{ animation: none; }
  .btn,
  .btn::before,
  .btn-arrow,
  .btn-icon,
  .chip,
  .inp,
  .steps .bar,
  .steps .lab,
  .headline::before{ transition-duration: .01s; }
  .btn:hover{ transform: none; }
}
