/* Shift + Alt Events — Onboarding (Exploratory Meeting)
   Visual + motion values measured from the original Paperform guided-mode form
   so the experience is unchanged. */

:root {
  --font-primary: "DM Sans", "Helvetica Neue", Helvetica, Roboto, sans-serif;
  --font-secondary: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  --text: rgb(0, 0, 0);
  --active: rgb(0, 0, 0);
  --muted: rgb(51, 51, 51);
  --surface: rgb(248, 248, 248);
  --warning: rgb(255, 0, 0);

  --content-width: 700px;
  --view-padding-y: 135px;
  --view-padding-x: 18px;
  --bar-height: 94px;

  /* measured: transform .6s cubic-bezier(.65,0,.35,1), opacity .7s ease */
  --slide-ease: cubic-bezier(0.65, 0, 0.35, 1);
  --slide-duration: 0.6s;
  --fade-duration: 0.7s;
}

* { box-sizing: border-box; }

/* Class-level `display` would otherwise beat the browser's [hidden] rule. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Background wallpaper (carries the [shift+alt] mark and the + pattern) ── */
.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.bg__image {
  width: 100%;
  height: 100%;
  background-image: url("/assets/bg-wallpaper.png");
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: repeat;
}

/* ── Progress bar ── */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 10;
  pointer-events: none;
  background: transparent;
}
.progress__fill {
  height: 4px;
  width: 0;
  background: var(--active);
  border-radius: 0 4px 4px 0;
  transition: width 0.4s ease;
}

/* ── Screens ── */
.stage { position: relative; z-index: 1; }

.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  transition: transform var(--slide-duration) var(--slide-ease),
              opacity var(--fade-duration) ease;
  will-change: transform, opacity;
  -webkit-overflow-scrolling: touch;
}
.screen--active   { transform: translateY(0);     opacity: 1; z-index: 1; pointer-events: all;  }
.screen--after    { transform: translateY(100%);  opacity: 0; z-index: 0; pointer-events: none; }
.screen--before   { transform: translateY(-100%); opacity: 0; z-index: 0; pointer-events: none; }
.screen--hidden   { display: none; }

/* 80px shorter than the viewport, matching Paperform's view box, so the
   question lands at the same height on screen. */
.screen__inner {
  min-height: calc(100% - 80px);
  padding: var(--view-padding-y) var(--view-padding-x);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.screen__content {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
}

/* ── Rich content blocks ── */
.block-h1 {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 60px;
  line-height: 72px;
  color: var(--text);
  margin: 0 0 8px;
}
.block-p {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  margin: 0 0 16px;
}
.block-image { margin: 16px 0; }
.block-image img { display: block; height: auto; border-radius: 0; }
.block-image--full img { width: 100%; }
.block-image--content img { width: 100%; max-width: var(--content-width); }
.block-image a { display: block; }

/* ── Question ── */
.field { padding: 15px 0; }
.field__title {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
  color: var(--text);
}
.field__description {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  opacity: 0.9;
  margin-top: 5px;
  white-space: pre-line;
}
.field__answer { margin-top: 9px; }

/* "Press Shift + Enter…" sits under the textarea, as in the original. */
.field__hint {
  font-family: var(--font-primary);
  font-size: 13px;
  line-height: 20px;
  color: var(--text);
  margin-top: 6px;
  opacity: 0.55;
}

/* An unanswered required question marks its own input rather than
   adding a second message next to the one in the bar. */
.field--invalid .input { border-bottom-color: var(--warning); }
.field--invalid .textarea { box-shadow: inset 0 -1px 0 var(--warning); }

/* ── Single-line input ── */
.input {
  display: block;
  width: 100%;
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0;
  padding: 1px 2px;
  outline: none;
  transition: border-color 0.2s ease;
}
.input:focus { border-bottom-color: rgba(0, 0, 0, 0.45); }
.input::placeholder { color: rgba(0, 0, 0, 0.35); }

/* ── Multi-line textarea ── */
.textarea {
  display: block;
  width: 100%;
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
  border: 0;
  border-radius: 0;
  padding: 5px 10px;
  outline: none;
  resize: none;
  overflow: hidden;
  transition: background-color 0.2s ease;
}
.textarea:focus { background: rgba(0, 0, 0, 0.07); }
.textarea::placeholder { color: rgba(0, 0, 0, 0.35); }

/* ── Choices ── */
.choices { display: flex; flex-wrap: wrap; margin-top: 10px; }
.choices--list { display: block; }

.choice {
  position: relative;
  display: block;
  background: var(--surface);
  color: var(--muted);
  border: 0;
  border-radius: 4px;
  box-shadow: rgba(0, 0, 0, 0.5) 0 2px 6px -2px;
  padding: 15px 16px;
  margin: 0 10px 15px 0;
  cursor: pointer;
  transition: background-color 0.1s ease, color 0.1s ease;
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 18px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.choices--list .choice { margin-right: 0; width: 100%; }
.choice:hover { background: rgba(0, 0, 0, 0.08); }
.choice--selected,
.choice--selected:hover { background: var(--active); color: #fff; }
.choice:focus-visible { outline: 2px solid var(--active); outline-offset: 2px; }

.choice__label { display: block; padding-right: 18px; }
.choice__icon {
  position: absolute;
  right: 15px;
  top: 50%;
  margin-top: -7.5px;
  width: 15px;
  height: 15px;
  color: currentColor;
  opacity: 0.85;
}
.choice__icon svg { display: block; width: 15px; height: 15px; fill: currentColor; }

.other-input { margin-top: 5px; }

/* ── Yes / No ── */
.yesno { display: flex; margin-top: 10px; }
.yesno__button {
  flex: 1 1 50%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--muted);
  border: 0;
  border-radius: 3px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.1s ease, color 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.yesno__button--selected { background: var(--active); color: #fff; }
.yesno__button:focus-visible { outline: 2px solid var(--active); outline-offset: 2px; }

/* ── Bottom bar ── */
.bar {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: var(--bar-height);
  padding: 18px 18px 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
  transition: opacity 0.35s ease;
}

/* Sits beside the button without moving it off centre. */
.bar__hint {
  position: absolute;
  right: 50%;
  margin-right: 60px;
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}
.bar__hint--visible { opacity: 0.6; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  min-width: 84px;
  padding: 0 30px;
  background: var(--active);
  color: #fff;
  border: 0;
  border-radius: 38px;
  box-shadow: rgba(0, 0, 0, 0.3) 0 2px 10px -3px;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: rgba(0, 0, 0, 0.35) 0 4px 14px -3px; }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.btn--busy { pointer-events: none; }

/* back control, mirrors Paperform's quiet up-arrow */
.bar__back {
  position: fixed;
  right: 24px;
  bottom: 30px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  z-index: 11;
}
.bar__back:hover { opacity: 1; background: rgba(0, 0, 0, 0.05); }
.bar__back:disabled { opacity: 0; pointer-events: none; }
.bar__back svg { width: 16px; height: 16px; fill: currentColor; }

/* ── Draft restore pill ── */
.draft {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%) translateY(10px);
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 18px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 30px;
  box-shadow: rgba(0, 0, 0, 0.12) 0 4px 18px -4px;
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--text);
  z-index: 12;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.draft--visible { display: flex; opacity: 1; transform: translateX(-50%) translateY(0); }
.draft__btn {
  font-family: var(--font-primary);
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 0;
  background: var(--active);
  color: #fff;
  cursor: pointer;
}
.draft__dismiss {
  background: transparent;
  border: 0;
  color: rgba(0, 0, 0, 0.45);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}

/* ── Saving / confirmation overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.97);
  padding: 40px 18px;
  text-align: center;
}
.overlay--visible { display: flex; }
.overlay__inner { max-width: 640px; }
.overlay__title {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 44px;
  line-height: 54px;
  margin: 0 0 10px;
}
.overlay__body { font-family: var(--font-primary); font-size: 16px; line-height: 24px; opacity: 0.8; margin: 0; }
.overlay__error { color: var(--warning); margin-top: 14px; font-size: 14px; }
.overlay__retry { margin-top: 20px; }

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 22px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: var(--active);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 900px) {
  :root { --view-padding-y: 90px; }
  .block-h1 { font-size: 40px; line-height: 48px; }
  .overlay__title { font-size: 32px; line-height: 40px; }
}

@media (max-width: 640px) {
  :root { --view-padding-y: 72px; --view-padding-x: 20px; --bar-height: 86px; }
  .block-h1 { font-size: 34px; line-height: 42px; }
  .field__title { font-size: 20px; line-height: 28px; }
  .choice { padding: 13px 14px; margin: 0 8px 10px 0; }
  .bar { padding: 14px 16px 28px; }
  .bar__hint { display: none; }
  .bar__back { right: 16px; bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen { transition: opacity 0.2s ease; }
  .screen--after, .screen--before { transform: none; }
  .progress__fill { transition: none; }
  .spinner { animation-duration: 2s; }
}
