/* ==========================================================================
   Work Heights — Member Onboarding
   13-screen mobile flow. Renders inside the Work Heights app webview.
   Design tokens & layout system per the build spec (§2, §3).
   ========================================================================== */

:root {
  --app-bg: #FAFAFA;
  --screen-bg: #FFFFFF;
  --ink: #1C1C1D;
  --body: #313131;
  --muted: #8A887F;
  --muted-2: #9a988f;
  --green: #169156;
  --green-dark: #0F6E41;
  --border: #DCDAD1;
  --divider: #EDEBE4;
  --selfie-bg: #F5F4EF;
  --selfie-dash: #C9C6BC;
  --selfie-dash-2: #B4B1A6;
  --success-bg: #EDF7F1;
  --stripe: #635BFF;
  --stripe-tint: #F1F0FF;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--app-bg);
  font-family: Inter, system-ui, sans-serif;
  color: var(--body);
  -webkit-font-smoothing: antialiased;
}

/* App shell centers the screen; on a phone it fills the viewport. */
.app {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The phone screen. 402×874 design canvas; scales down on smaller viewports. */
.screen {
  position: relative;
  width: 402px;
  height: 874px;
  max-width: 100vw;
  max-height: 100dvh;
  background: var(--screen-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 70px 26px 44px;
}

/* --- Progress bar (§3.2) ------------------------------------------------- */
.progress {
  flex: none;
  height: 4px;
  background: var(--divider);
  border-radius: 999px;
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* --- Title region: FIXED 400px block (§3.3) ----------------------------- */
.title-block {
  height: 400px;
  flex: none;
  overflow: visible;
  /* Flex column so an interactive card fills the space below the H2 (down to
     the paragraph), keeping the 400px block — and thus paragraph/CTA — aligned
     across screens. */
  display: flex;
  flex-direction: column;
}
.title-block--clip { overflow: hidden; }

.title {
  margin: 22px 0 0;
  flex: none;
  font-size: 29px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--ink);
}

/* --- Paragraph region (§3.4) -------------------------------------------- */
.para-region {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.para {
  margin: -10px 0 0;
  font-size: 19px;
  line-height: 1.65;
  text-align: center;
  color: var(--body);
}
.para strong { font-weight: 700; color: var(--body); }
.para a { color: var(--green); text-decoration: none; }
.para a:hover { color: var(--green-dark); }
.para .credit { color: var(--green); font-weight: 700; }

/* Bottom slot: holds the checkbox row just above the CTA (§4.2 placement). */
.bottom-slot { flex: none; }
.bottom-slot:empty { display: none; }

/* --- CTA button (§4.1) -------------------------------------------------- */
.cta {
  flex: none;
  height: 56px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 16px;
}
.cta--open { margin-top: 18px; } /* no-gate screens */
.cta:disabled {
  background: var(--border);
  color: var(--muted-2);
  cursor: not-allowed;
}

/* --- Checkbox row (§4.2) ------------------------------------------------ */
.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 16px;
}
.check-box {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 2px solid var(--ink);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.check-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--body);
  text-align: left;
}

/* --- Location list (§4.3, screen 07) ------------------------------------ */
.loc-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 16px;
  margin-bottom: 26px; /* top gap (16) + 10 to offset the paragraph's -10 nudge */
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.loc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--divider);
}
.loc-row:last-child { border-bottom: 0; }
.loc-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.loc-hood { font-size: 13px; color: var(--muted); }

/* --- Selfie card (§4/§5 screen 11) -------------------------------------- */
.selfie-frame {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-top: 22px;
  margin-bottom: 32px; /* top gap (22) + 10 to offset the paragraph's -10 nudge */
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.selfie-area {
  flex: 1 1 auto;
  min-height: 150px;
  border-radius: 10px;
  background: var(--selfie-bg);
  border: 1.5px dashed var(--selfie-dash);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.selfie-oval {
  width: 100px;
  height: 132px;
  border: 2px dashed var(--selfie-dash-2);
  border-radius: 50%;
}
.selfie-caption { font-size: 11px; color: var(--muted-2); }
.selfie-error { display: block; margin-top: 10px; text-align: center; color: #B4433A; }
.selfie-area--done {
  background: var(--success-bg);
  border: 1.5px solid var(--success-bg);
}
.selfie-done-text { font-size: 13px; font-weight: 600; color: var(--green-dark); }
.selfie-take {
  margin-top: 12px;
  height: 56px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

/* --- Stripe Identity card (screen 12) ----------------------------------- */
.stripe-card {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-top: 22px;
  margin-bottom: 32px; /* top gap (22) + 10 to offset the paragraph's -10 nudge */
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stripe-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.stripe-badge {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--stripe);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stripe-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.stripe-start {
  height: 48px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--stripe);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.stripe-bar {
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}
.stripe-bar--verifying { background: var(--stripe-tint); color: var(--stripe); }
.stripe-bar--verified { background: var(--success-bg); color: var(--green-dark); }
.stripe-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--stripe);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.stripe-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted-2);
}
.stripe-error {
  text-align: center;
  font-size: 13px;
  color: #B4433A;
  margin-bottom: 12px;
  line-height: 1.5;
}
.stripe-error a { color: inherit; text-decoration: underline; }

/* --- Boot / entry overlay ----------------------------------------------- */
.boot {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: var(--screen-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 34px;
}
.boot[hidden] { display: none; }
.boot__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.boot__spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--divider);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.boot__spinner[hidden] { display: none; }
.boot__msg {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--body);
}

/* --- Back control (small, top-left; hidden on screen 1) ----------------- */
.back {
  position: absolute;
  top: 30px;
  left: 22px;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
}
.back[hidden] { display: none; }
