/* Riku Web Studio: the brief form. Uses the tokens, header, pill and buttons of studio.css. */

/* hidden means hidden, also for elements that set their own display (buttons) */
.bf [hidden] {
  display: none !important;
}

/* the candy-cane edge of the promo bar stays above the header */
.season-bar {
  z-index: 31;
}

/* the header stays on top: a frosted background from the start (no studio.js here) */
.top {
  padding-block: 12px;
  background: rgba(244, 236, 228, .86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 6px 24px rgba(74, 51, 40, .06);
}

.bf-back {
  margin-left: auto;
  color: var(--brown);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.bf-back:hover {
  text-decoration: underline;
}

.bf {
  max-width: 860px;
  padding-block: 40px 80px;
}

.bf-intro h1 {
  font-size: clamp(40px, 6vw, 64px);
}

.bf-lead {
  max-width: 640px;
  margin: 18px 0 0;
  font-size: 18px;
}

.bf-restored {
  margin: 28px 0 0;
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 15px;
}

.bf-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- the card that holds the form ---------- */
.bf-form {
  scroll-margin-top: 100px;
  margin-top: 36px;
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 32px;
  background: linear-gradient(170deg, #fcf8f4, var(--card) 50%);
  box-shadow: 0 20px 50px rgba(74, 51, 40, .09);
}

/* progress: a bar and the six step names */
.bf-bar {
  height: 6px;
  border-radius: 6px;
  background: var(--chip);
  overflow: hidden;
}

.bf-bar span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--accent);
  transition: width .45s cubic-bezier(.22, .8, .24, 1);
}

.bf-dots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.bf-dots li.done {
  color: var(--accent);
}

.bf-dots li.now {
  color: var(--ink);
  font-weight: 600;
}

.bf-count {
  margin: 26px 0 4px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bf-count b {
  color: var(--accent);
}

.bf-step h2 {
  font-size: clamp(32px, 4.4vw, 44px);
}

.bf-step h2:focus {
  outline: none;
}

.bf-sub {
  margin: 8px 0 26px;
  color: var(--muted);
}

.bf-sub a {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- fields ---------- */
.bf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}

.bf-field {
  display: block;
  min-width: 0;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.bf-field > span,
.bf-field legend {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 500;
}

.bf-field i {
  color: var(--accent);
  font-style: normal;
}

.bf-field small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.bf input[type="text"],
.bf input[type="tel"],
.bf input[type="email"],
.bf input[type="date"],
.bf textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fffdfb;
  color: var(--ink);
  font: inherit;
  font-size: 16px;   /* 16px: phones do not zoom in */
  transition: border-color .2s, box-shadow .2s;
}

.bf textarea {
  resize: vertical;
  line-height: 1.5;
}

.bf input::placeholder,
.bf textarea::placeholder {
  color: #b9a497;
}

.bf input:focus,
.bf textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px rgba(185, 118, 91, .15);
}

.bf-short input {
  max-width: 260px;
}

.bf-other,
.bf-other-group {
  margin-top: 12px;
}

.bf-other-group {
  display: grid;
  gap: 10px;
}

.bf-other-group[hidden],
.bf-other[hidden] {
  display: none;
}

/* ---------- chips: radio and checkbox answers ---------- */
.bf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  position: relative;
  cursor: pointer;
}

.chip input,
.bf-card input,
.bf-consent input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1.5px solid var(--line);
  border-radius: 30px;
  background: #fffdfb;
  color: var(--ink);
  font-size: 15px;
  transition: background .2s, border-color .2s, color .2s;
}

.chip:hover span {
  border-color: #d9a38f;
}

.chip input:checked + span {
  border-color: var(--brown);
  background: var(--brown);
  color: #fbf3ec;
}

.chip input[type="checkbox"]:checked + span::before {
  content: "✓";
  font-weight: 600;
}

.chip input:focus-visible + span,
.bf-card input:focus-visible + span,
.bf-consent input:focus-visible + span::before {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.chip.off {
  cursor: not-allowed;
}

.chip.off span {
  opacity: .45;
}

/* bigger answer cards: package and domain */
.bf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.bf-card {
  position: relative;
  cursor: pointer;
}

.bf-card span {
  display: block;
  height: 100%;
  box-sizing: border-box;
  padding: 16px 16px 14px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: #fffdfb;
  transition: border-color .2s, background .2s, transform .2s;
}

.bf-card b {
  display: block;
  font-size: 16px;
}

.bf-card small {
  display: block;
  margin: 4px 0 0;
  font-size: 13px;
}

.bf-card:hover span {
  border-color: #d9a38f;
  transform: translateY(-2px);
}

.bf-card input:checked + span {
  border-color: var(--brown);
  background: var(--brown);
  color: #ead7c9;
}

.bf-card input:checked + span b {
  color: #fbf3ec;
}

.bf-card input:checked + span small {
  color: #ead7c9;
}

/* consent */
.bf-consent {
  position: relative;
  display: block;
  margin: 8px 0 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--accent-soft);
  cursor: pointer;
}

.bf-consent span {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  color: var(--ink);
  font-size: 15px;
}

.bf-consent span::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.5px solid var(--accent);
  border-radius: 7px;
  background: #fffdfb;
}

.bf-consent input:checked + span::before {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: var(--brown);
  background: var(--brown);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- errors ---------- */
.bf-msg {
  margin: 8px 0 0;
  color: #b23b2e;
  font-size: 14px;
}

.bad input[type="text"],
.bad input[type="tel"],
.bad input[type="email"],
.bad textarea,
.bf-other.bad {
  border-color: #c9584a;
}

fieldset.bad .chip span,
fieldset.bad .bf-card span {
  border-color: #e3a59a;
}

.bf-consent.bad {
  box-shadow: inset 0 0 0 1.5px #c9584a;
}

.bf-error {
  margin: 0 0 16px;
  color: #b23b2e;
}

.bf-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- step buttons ---------- */
.bf-nav {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 2px dashed var(--line);
}

.bf-nav .btn {
  border: 0;
  font-family: var(--sans);
  cursor: pointer;
}

.bf-nav .btn.ghost {
  border: 1.5px solid var(--brown);
}

.bf-next,
.bf-send {
  margin-left: auto;
}

.bf-send.loading {
  opacity: .8;
  cursor: progress;
}

.bf-nav .btn:disabled {
  cursor: progress;
}

/* ---------- after sending ---------- */
.bf-done,
.bf-fallback {
  scroll-margin-top: 100px;
  margin-top: 36px;
  padding: 44px 40px;
  border-radius: 32px;
  background: var(--card);
  box-shadow: 0 20px 50px rgba(74, 51, 40, .09);
  text-align: center;
}

.bf-done h2,
.bf-fallback h2 {
  font-size: clamp(34px, 5vw, 48px);
}

.bf-done p,
.bf-fallback p {
  max-width: 560px;
  margin: 14px auto 26px;
}

.bf-done-ic svg {
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  padding: 16px;
  border-radius: 50%;
  background: var(--brown);
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bf-next-steps {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.bf-next-steps li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border-radius: 30px;
  background: #fffdfb;
  color: var(--ink);
  font-size: 14.5px;
}

.bf-next-steps b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
}

.bf-done .bf-link,
.bf-fallback .bf-link {
  display: block;
  width: fit-content;
  margin: 18px auto 0;
}

/* the robot check box (shown only when Cloudflare asks for a tap) */
.human-check {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 1000;
  transform: translateX(-50%);
  text-align: center;
}

.human-check p {
  display: none;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
}

.human-check.show {
  padding: 12px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(63, 47, 39, .22);
}

.human-check.show p {
  display: block;
}

/* ---------- Christmas (season.js) ---------- */
.season-on .bf-bar span,
.season-on .chip input:checked + span,
.season-on .bf-card input:checked + span,
.season-on .bf-consent input:checked + span::before,
.season-on .bf-done-ic svg {
  border-color: var(--season-dark);
  background: var(--season-dark);
}

.season-on .bf-form {
  position: relative;
  background:
    repeating-linear-gradient(-45deg, var(--season-red) 0 8px, #fbf7f1 8px 16px) top / 100% 6px no-repeat,
    linear-gradient(170deg, #fcf8f4, var(--card) 50%);
}

.season-on .bf-form::before {
  content: "";
  position: absolute;
  top: -14px;
  right: 28px;
  width: 74px;
  height: 46px;
  background: var(--holly) center / contain no-repeat;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2));
}

.season-on .bf-nav .btn:not(.ghost) {
  background-color: var(--season-red);
  background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .1) 0 10px, transparent 10px 20px);
}

.season-on .bf-nav .btn.ghost {
  border-color: var(--season-red);
}

/* ---------- phones ---------- */
@media (max-width: 720px) {
  .bf {
    padding-block: 20px 60px;
  }

  .bf-form {
    padding: 24px 18px;
    border-radius: 26px;
  }

  .bf-grid {
    grid-template-columns: 1fr;
  }

  .bf-dots {
    display: none;
  }

  .bf-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chip span {
    padding: 9px 15px;
    font-size: 14.5px;
  }

  .bf-nav .btn {
    padding: 12px 18px;
    font-size: 16px;
  }

  .bf-done,
  .bf-fallback {
    padding: 34px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bf-bar span,
  .bf-card span {
    transition: none;
  }
}
