/* ObdachApp — clickable phone-prototype shell.
   Used by /fsw (v2) and /plus (v3). */

/* ---------- stage: the surface the phone sits on ---------- */

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 32px 20px 40px;
  background:
    radial-gradient(1100px 620px at 50% -8%, #F1F4F6 0%, rgba(241,244,246,0) 70%),
    var(--paper);
}

.stage-head {
  width: 100%;
  max-width: 980px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.stage-head h1 {
  font-family: var(--cond);
  font-weight: 700;
  font-size: clamp(22px, 3.4vw, 30px);
  letter-spacing: .005em;
  margin: 0;
  color: var(--fsw-ink);
}

.stage-head h1 span { color: var(--app); }

.stage-head .meta {
  font-size: 13px;
  color: #7C7C83;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.stage-head .meta a { color: var(--fsw-blue); text-decoration: none; border-bottom: 1px solid #C7D2E6; }
.stage-head .meta a:hover { border-bottom-color: var(--fsw-blue); }

/* ---------- device frame ---------- */

.device-wrap {
  display: flex;
  align-items: flex-start;
  gap: 34px;
  flex-wrap: wrap;
  justify-content: center;
}

.phone {
  position: relative;
  width: 390px;
  height: 844px;
  flex: 0 0 auto;
  background: #0E1418;
  border-radius: 46px;
  padding: 11px;
  box-shadow: var(--shadow-l), 0 0 0 1px rgba(255,255,255,.5) inset;
}

.phone::after {                      /* side button */
  content: '';
  position: absolute;
  right: -2px; top: 190px;
  width: 3px; height: 74px;
  background: #26313A;
  border-radius: 0 3px 3px 0;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: var(--white);
  isolation: isolate;
}

.notch {
  position: absolute;
  top: 9px; left: 50%;
  transform: translateX(-50%);
  width: 112px; height: 27px;
  background: #0E1418;
  border-radius: var(--r-pill);
  z-index: 60;
}

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

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--white);
  overflow: hidden;
}

.screen.is-active { display: flex; animation: screen-in .22s ease-out both; }

@keyframes screen-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: none; }
}

.screen[data-anim="up"].is-active { animation-name: screen-up; }

@keyframes screen-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- status bar ---------- */

.statusbar {
  height: 46px;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 26px 5px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--fsw-ink);
  z-index: 50;
}

.statusbar .icons { display: flex; gap: 5px; align-items: center; }
.statusbar .icons svg { width: 16px; height: 16px; }
.screen.on-brand .statusbar { color: #fff; }

/* ---------- app bar ---------- */

.appbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 16px 12px;
  background: var(--white);
}

.appbar .back {
  width: 38px; height: 38px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border: 0; padding: 0;
  background: var(--fsw-grey);
  border-radius: var(--r-pill);
  cursor: pointer;
  color: var(--fsw-ink);
}
.appbar .back:hover { background: #E7E7E7; }
.appbar .back svg { width: 19px; height: 19px; }

.appbar h2 {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.1;
  margin: 0;
  letter-spacing: .005em;
  flex: 1 1 auto;
  min-width: 0;
}

.appbar .act {
  border: 0; background: none; padding: 6px;
  cursor: pointer; color: var(--app);
  display: grid; place-items: center;
}
.appbar .act svg { width: 22px; height: 22px; }

/* ---------- scrollable body ---------- */

.body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 16px 22px;
  scrollbar-width: thin;
}

.body::-webkit-scrollbar { width: 5px; }
.body::-webkit-scrollbar-thumb { background: #D6DADD; border-radius: 3px; }

.body.flush { padding-left: 0; padding-right: 0; }

/* ---------- tab bar ---------- */

.tabbar {
  flex: 0 0 auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border-top: 1px solid var(--fsw-line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  padding: 7px 4px 22px;
}

.tabbar button {
  border: 0; background: none; padding: 4px 2px 2px;
  display: grid; justify-items: center; gap: 3px;
  cursor: pointer;
  color: #8A9299;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.1;
}

.tabbar button svg { width: 23px; height: 23px; }
.tabbar button.is-on { color: var(--app); font-weight: 600; }

/* ---------- generic app components ---------- */

.eyebrow {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: #8A9299;
  margin: 18px 0 8px;
}

.card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 13px;
  margin-bottom: 9px;
  background: var(--white);
  border: 1px solid var(--fsw-line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-s);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color .14s, transform .14s, box-shadow .14s;
}

.card:hover { border-color: #C9D6DE; transform: translateY(-1px); box-shadow: var(--shadow-m); }
.card:active { transform: translateY(0); }

.card .ico {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--app-xl);
  color: var(--app);
}
.card .ico svg { width: 25px; height: 25px; }

.card .txt { flex: 1 1 auto; min-width: 0; }
.card .txt strong {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--fsw-ink);
}
.card .txt small {
  display: block;
  font-size: 13px;
  color: #7C848A;
  line-height: 1.4;
  margin-top: 2px;
}

.card .chev { flex: 0 0 auto; color: #B6BEC4; align-self: center; }
.card .chev svg { width: 17px; height: 17px; }

/* status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.free  { background: #E4F1E9; color: #10502D; }
.pill.tight { background: #FDECE1; color: #96430F; }
.pill.full  { background: #FBE4E5; color: #98181D; }
.pill.info  { background: var(--app-xl); color: var(--app-d); }

/* big primary button */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;                   /* WCAG-friendly tap target */
  padding: 14px 20px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--app);
  color: #fff;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .005em;
  cursor: pointer;
  transition: background .14s, transform .14s;
}
.btn:hover { background: var(--app-d); }
.btn:active { transform: scale(.985); }
.btn svg { width: 21px; height: 21px; }

.btn.ghost { background: var(--white); color: var(--app); border: 2px solid var(--app-xl); }
.btn.ghost:hover { background: var(--app-xl); }
.btn.danger { background: var(--alert); }
.btn.danger:hover { background: #A51217; }
.btn.light { background: #fff; color: var(--app-d); }
.btn.light:hover { background: #F1F5F7; }

.btn-row { display: flex; gap: 9px; }
.btn-row .btn { flex: 1 1 0; }

/* ---------- desktop chrome around the phone ---------- */

.sidenote {
  flex: 0 1 300px;
  min-width: 240px;
  padding-top: 6px;
}

.sidenote h3 {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: var(--fsw-ink);
}

.sidenote p { font-size: 14px; line-height: 1.6; color: #62696E; margin: 0 0 12px; }

.sidenote ol { margin: 0 0 14px; padding-left: 19px; font-size: 14px; color: #62696E; line-height: 1.6; }
.sidenote li { margin-bottom: 5px; }

.sidenote .key {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  background: #fff;
  border: 1px solid #DDE2E5;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--fsw-ink);
}

.reset-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  color: var(--app);
  background: #fff;
  border: 1px solid #D3DDE3;
  border-radius: var(--r-pill);
  padding: 8px 15px;
  cursor: pointer;
}
.reset-btn:hover { background: var(--app-xl); border-color: var(--app-l); }
.reset-btn svg { width: 15px; height: 15px; }

/* prototype disclaimer, present on every version */
.disclaimer {
  max-width: 980px;
  width: 100%;
  margin: 26px auto 0;
  padding: 12px 15px;
  border-left: 3px solid var(--fsw-orange);
  background: #FFF6F0;
  border-radius: 0 var(--r-s) var(--r-s) 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #7A4A28;
}
.disclaimer strong { color: #62360E; }

/* ---------- phone becomes fullscreen on small viewports ---------- */

@media (max-width: 820px) {
  /* Every .screen is position:absolute, so these wrappers have zero intrinsic
     width — they must be given an explicit one or the phone collapses. */
  .stage { padding: 0; display: block; width: 100%; min-height: 0; }
  .stage-head, .sidenote, .disclaimer { display: none; }
  .device-wrap { display: block; width: 100%; }
  .phone {
    display: block;
    width: 100%; height: calc(100vh - 50px); height: calc(100dvh - 50px);
    border-radius: 0; padding: 0; box-shadow: none; background: #fff;
  }
  .phone-screen { width: 100%; height: 100%; }
  .phone::after { display: none; }
  .phone-screen { border-radius: 0; }
  .notch { display: none; }
  .statusbar { height: 30px; }
}
