/* The contact page (contact.html): the request form, one question at a time, with "Your request"
   filling in next to it. contact.js steps through the questions; without JavaScript they all show
   at once and the form sends as it is. The base and the texture are in page.css. */

/* ------------------------------------------------------------ the yellow card */

.ct-hero {
  position: relative;
  padding: 16px 16px 0;
}

.ct-card {
  position: relative;
  min-height: calc(100vh - 32px);
  min-height: calc(100svh - 32px);
  border-radius: 40px;
  overflow: hidden;
  background: #feeb8d;
  color: #252324;
}

.ct-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 64px;
  align-items: start;
  padding: clamp(132px, 19svh, 210px) 32px 40px 40px;
}

.ct-main {
  position: relative;
  min-width: 0;
  max-width: 860px;
}

.ct-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* the page's heading, for screen readers */
.ct-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ct-count {
  margin: 0;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.06em;
}

.ct-count__all {
  color: rgba(37, 35, 36, 0.5);
}

/* ------------------------------------------------------------ the questions */

.ct-form {
  margin-top: 26px;
}

.ct-step {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

/* one at a time once contact.js runs; all of them, one under the other, without it */
.ct-form.is-stepped .ct-step:not(.is-current) {
  display: none;
}

.ct-form:not(.is-stepped) .ct-step + .ct-step {
  margin-top: 80px;
}

.ct-step.is-entering {
  animation: ct-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ct-step.is-entering.is-back {
  animation-name: ct-in-back;
}

@keyframes ct-in {
  from {
    opacity: 0;
    transform: translate3d(0, 36px, 0);
  }
}

@keyframes ct-in-back {
  from {
    opacity: 0;
    transform: translate3d(0, -28px, 0);
  }
}

/* the question: a legend that behaves like a heading */
.ct-q {
  float: left;
  width: 100%;
  padding: 0;
  font-size: clamp(38px, 3.86vw, 74px);
  font-weight: 550;
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.ct-q + * {
  clear: both;
}

/* right under the question the space is padding: a margin would go into clearing the legend */
.ct-q + .ct-opts,
.ct-q + .ct-fields {
  margin-top: 0;
  padding-top: 36px;
}

/* ------------------------------------------------------------ the options: the three solutions */

.ct-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
}

/* the box itself is out of sight; the card is its label */
.ct-check {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.ct-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 136px;
  padding: 22px 24px 20px;
  box-sizing: border-box;
  border-radius: 24px;
  background: #fffce1;
  color: #252324;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.35s ease, color 0.35s ease, translate 0.35s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.ct-opt:hover {
  translate: 0 -3px;
}

.ct-check:checked + .ct-opt {
  background: #252324;
  color: #fffce1;
}

.ct-check:focus-visible + .ct-opt {
  outline: 2px solid #252324;
  outline-offset: 3px;
}

.ct-opt__no {
  display: block;
  height: 32px;
}

.ct-opt__no svg {
  display: block;
  height: 100%;
  width: auto;
  overflow: visible;
}

.ct-check:checked + .ct-opt .ct-opt__no {
  color: #feeb8d;
}

/* chosen: the numeral draws itself again and its dots pop */
.ct-check:checked + .ct-opt .ct-opt__no path {
  stroke-dasharray: 1 2;
  animation: ct-draw 0.9s cubic-bezier(0.65, 0, 0.35, 1) both;
}

.ct-check:checked + .ct-opt .ct-opt__no circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: ct-pop 0.6s 0.55s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

@keyframes ct-draw {
  from {
    stroke-dashoffset: 1.5;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes ct-pop {
  from {
    transform: scale(0);
  }
}

.ct-opt__name {
  padding-right: 44px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.ct-opt__tick {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(37, 35, 36, 0.3);
  box-sizing: border-box;
  display: grid;
  place-items: center;
  color: transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.ct-opt__tick svg {
  display: block;
}

.ct-check:checked + .ct-opt .ct-opt__tick {
  background: #feeb8d;
  border-color: #feeb8d;
  color: #252324;
}

.ct-check:checked + .ct-opt .ct-opt__tick svg {
  animation: ct-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

/* ------------------------------------------------------------ the fields */

.ct-fields {
  display: grid;
  gap: 26px;
  margin-top: 36px;
}

.ct-field__label {
  display: block;
  font-size: 16px;
  font-weight: 450;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: rgba(37, 35, 36, 0.62);
}

.ct-field__label em {
  font-style: normal;
  color: rgba(37, 35, 36, 0.42);
}

.ct-input {
  display: block;
  width: 100%;
  margin: 6px 0 0;
  padding: 6px 0 10px;
  border: 0;
  border-bottom: 1.5px solid rgba(37, 35, 36, 0.32);
  border-radius: 0;
  background: transparent;
  color: #252324;
  font: inherit;
  font-size: 30px;
  font-weight: 450;
  line-height: 1.2;
  letter-spacing: -0.025em;
  outline: none;
  box-shadow: none;
  appearance: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ct-input:hover {
  border-bottom-color: rgba(37, 35, 36, 0.6);
}

/* in focus the line is whole and twice as thick */
.ct-input:focus {
  border-bottom-color: #252324;
  box-shadow: 0 1.5px 0 #252324;
}

.ct-input--area {
  min-height: 2.6em;
  resize: none;
  overflow: hidden;
  font-size: 26px;
  line-height: 1.25;
}

.ct-error {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.012em;
}

.ct-error:not(:empty) {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
}

.ct-error:not(:empty)::before {
  content: '!';
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #252324;
  color: #feeb8d;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

/* a field that is not right yet: its line is the dark one */
.ct-input[aria-invalid='true'] {
  border-bottom-color: #252324;
}

/* the trap for spam robots, out of sight */
.ct-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------------------ next, back, send */

.ct-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 44px;
}

.ct-pill {
  height: 52px;
  padding: 0 26px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 999px;
  background: #252324;
  font: inherit;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  cursor: pointer;
}

.ct-pill,
.ct-pill:hover {
  color: #fffce1;
}

.ct-pill[disabled] {
  cursor: progress;
  opacity: 0.7;
}

.ct-ic {
  width: 28px;
  height: 28px;
  margin-right: -10px;
  border-radius: 50%;
  background: #feeb8d;
  color: #252324;
  display: grid;
  place-items: center;
  flex: none;
}

.ct-ic svg {
  display: block;
  transition: translate 0.35s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.ct-next:hover .ct-ic svg {
  translate: 2px 0;
}

.ct-back {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #252324;
  font: inherit;
  font-size: 20px;
  font-weight: 450;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.ct-back .ct-ic {
  margin: 0;
  width: 34px;
  height: 34px;
  background: none;
  box-shadow: inset 0 0 0 1.5px rgba(37, 35, 36, 0.6);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.ct-back:hover .ct-ic {
  background: #252324;
  box-shadow: inset 0 0 0 1.5px #252324;
  color: #feeb8d;
}

.ct-back:hover .ct-ic svg {
  translate: -2px 0;
}

.ct-back:focus-visible {
  outline: 2px solid #252324;
  outline-offset: 4px;
  border-radius: 999px;
}

.ct-progress {
  position: relative;
  height: 1.5px;
  margin-top: 40px;
  overflow: hidden;
  background: rgba(37, 35, 36, 0.16);
}

.ct-progress > i {
  position: absolute;
  inset: 0;
  background: #252324;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0.25));
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.ct-status {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.012em;
}

.ct-status:not(:empty) {
  padding-top: 20px;
}

/* ------------------------------------------------------------ sent */

.ct-done {
  outline: none;
}

.ct-done__eagle {
  display: block;
  width: 92px;
  height: 96px;
  color: #252324;
  animation: ct-eagle 1.3s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

@keyframes ct-eagle {
  from {
    opacity: 0;
    transform: translate3d(0, 48px, 0) scale(0.55) rotate(-10deg);
  }
}

.ct-done__title {
  margin: 44px 0 0;
  font-size: clamp(38px, 3.86vw, 74px);
  font-weight: 550;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.ct-done__title > span {
  display: block;
  animation: ct-in 1s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ct-done__title > span + span {
  color: rgba(37, 35, 36, 0.5);
  animation-delay: 0.37s;
}

.ct-done__text {
  margin: 28px 0 0;
  max-width: 30em;
  font-size: 20px;
  font-weight: 450;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: rgba(37, 35, 36, 0.72);
  animation: ct-in 1s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ct-done__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
  margin-top: 40px;
  animation: ct-in 1s 0.62s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ct-link {
  padding-bottom: 6px;
  border-bottom: 1.5px solid #252324;
  color: #252324;
  font-size: 20px;
  font-weight: 450;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.ct-link:hover {
  opacity: 0.6;
}

/* ------------------------------------------------------------ "Your request", filling in */

.ct-summary {
  position: relative;
  padding: 16px 16px 26px;
  border-radius: 40px;
  background: #fffce1;
  color: #000000;
}

/* the chosen solutions, in the colour of the first one, as on the homepage */
.ct-summary__card {
  position: relative;
  overflow: hidden;
  min-height: 124px;
  padding: 26px 28px;
  box-sizing: border-box;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: #252324;
  color: #fffce1;
  transition: background-color 0.45s ease, color 0.45s ease, box-shadow 0.45s ease;
}

.ct-summary__card[data-tone='process'] {
  background: #feeb8d;
  color: #000000;
}

.ct-summary__card[data-tone='tools'] {
  background: #000000;
}

.ct-summary__card[data-tone='none'] {
  background: transparent;
  color: #6f6d60;
  box-shadow: inset 0 0 0 1.5px #d3d1bb;
}

.ct-summary__card[data-tone='none'] > .pg-fx {
  opacity: 0;
}

.ct-summary__card > .pg-fx {
  opacity: 0.085;
}

.ct-summary__sol {
  position: relative;
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: pre-line;
}

.ct-summary__rows {
  margin: 20px 24px 0;
}

.ct-summary__rows > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid #d3d1bb;
  font-size: 17px;
  font-weight: 450;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.ct-summary__rows dt {
  flex: none;
  color: #6f6d60;
}

.ct-summary__rows dd {
  min-width: 0;
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

/* the goals can run long: under their label, as a short text */
.ct-summary__rows > .ct-summary__long {
  display: block;
}

.ct-summary__long dd {
  margin-top: 6px;
  text-align: left;
}

.ct-summary__rows dd.is-empty {
  color: #b3b09a;
}

.ct-summary__rows dd.is-new,
.ct-summary__sol.is-new {
  animation: ct-fill 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ct-fill {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
}

/* ------------------------------------------------------------ smaller screens */

/* "Your request" goes: the form has the room */
@media (max-width: 1100px) {
  .ct-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .ct-summary {
    display: none;
  }
}

@media (max-width: 720px) {
  .ct-body {
    padding: 112px 24px 28px;
  }

  .ct-opts {
    gap: 10px;
    margin-top: 26px;
  }

  .ct-opt {
    min-height: 118px;
    padding: 16px 16px 16px;
    border-radius: 20px;
  }

  .ct-opt__no {
    height: 26px;
  }

  .ct-opt__name {
    padding-right: 0;
    font-size: 18px;
  }

  .ct-opt__tick {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
  }

  .ct-done__text {
    font-size: 18px;
  }

  .ct-fields {
    gap: 22px;
    margin-top: 28px;
  }

  .ct-q + .ct-opts,
  .ct-q + .ct-fields {
    padding-top: 28px;
  }

  .ct-input {
    font-size: 24px;
  }

  .ct-input--area {
    font-size: 22px;
  }

  .ct-nav {
    margin-top: 36px;
  }

  .ct-pill,
  .ct-back {
    font-size: 18px;
  }
}

/* the smallest phones: the options one under the other, numeral and name side by side */
@media (max-width: 380px) {
  .ct-opts {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .ct-opt {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 14px 52px 14px 16px;
  }

  .ct-opt__no {
    flex: none;
    height: 24px;
  }

  .ct-opt__tick {
    top: 50%;
    margin-top: -14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ct-step.is-entering,
  .ct-check:checked + .ct-opt .ct-opt__no path,
  .ct-check:checked + .ct-opt .ct-opt__no circle,
  .ct-check:checked + .ct-opt .ct-opt__tick svg,
  .ct-done__eagle,
  .ct-done__title > span,
  .ct-done__text,
  .ct-done__links,
  .ct-summary__rows dd.is-new,
  .ct-summary__sol.is-new {
    animation: none;
  }

  .ct-opt,
  .ct-progress > i,
  .ct-ic svg {
    transition: none;
  }

  .ct-opt:hover {
    translate: none;
  }
}
