/* Frank pro — onboarding screens (Figma Providers 01 Sign in, shared by 02 Apply).
   Mobile frames are 393 wide: 24px gutters, sticky footer with a top rule.
   Desktop (≥960px, Figma P0a–P0l Desktop): top bar with the wordmark, a 560px column 40px below it,
   a "← Back" link atop the column and buttons side by side (240px each). */

.ob-page { background: var(--card); }
.ob {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 480px; margin: 0 auto;
  background: var(--card);
  color: var(--foreground);
}
.ob[hidden] { display: none; }

/* Header: "frank pro" wordmark or a round back button */
.ob-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px 8px; min-height: 48px; }
.ob-brand { font-size: 18px; line-height: 24px; white-space: nowrap; }   /* weight and tracking from the logo rule, 07 §6a */
.ob-back {
  width: 36px; height: 36px; border-radius: 18px; border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; background: var(--card);
  cursor: pointer; transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-ui) var(--ease-out);
}
.ob-back img { width: 24px; height: 24px; }
.ob-back:active { transform: scale(.94); }
@media (hover: hover) { .ob-back:hover { background: var(--muted); } }

/* Language chips (Frequency chip component, selectable) */
.ob-lang { display: flex; gap: 6px; }
.ob-chip {
  display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; border: 0;
  background: var(--muted); color: var(--foreground);
  font: 500 12px/16px "Hanken Grotesk", system-ui, sans-serif; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.ob-chip[aria-pressed="true"] { background: var(--foreground); color: var(--primary-foreground); }
.ob-chip:active { transform: scale(.96); }

/* Body */
.ob-body { flex: 1 0 auto; display: flex; flex-direction: column; gap: 20px; padding: 12px 24px 24px; }
.ob-body--16 { gap: 16px; }
.ob-body--code { padding-top: 16px; }
.ob-step { font: 500 12px/16px "Hanken Grotesk", system-ui, sans-serif; color: var(--muted-foreground); }
.ob-title { font-size: 28px; line-height: 32px; letter-spacing: -0.5px; font-weight: 400; margin: 0; }
.ob-sub { font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.ob-titleblock { display: flex; flex-direction: column; gap: 8px; }
.ob-h2 { font-size: 18px; line-height: 24px; letter-spacing: -0.18px; font-weight: 400; margin: 0; }
.ob-small { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.ob-strong { font-weight: 500; font-size: 14px; line-height: 20px; }
.ob-err { font-size: 12px; line-height: 16px; color: var(--attention); min-height: 0; }
.ob-err:empty { display: none; }

/* Welcome */
.ob-photo { width: 100%; height: 220px; border-radius: 16px; object-fit: cover; background: var(--muted); }
.ob-check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 20px; }
.ob-check img { width: 24px; height: 24px; flex: none; }

/* Footer — sticky */
.ob-foot {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 24px 24px; padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle); background: var(--card);
}
.ob-btn {
  height: 48px; width: 100%; padding: 0 24px; border-radius: 999px; border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 14px/20px "Hanken Grotesk", system-ui, sans-serif; cursor: pointer; text-align: center;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-ui) var(--ease-out), opacity var(--dur-ui) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.ob-btn:active { transform: scale(.97); }
.ob-btn--primary { background: var(--primary); color: var(--primary-foreground); }
.ob-btn--secondary { background: var(--card); color: var(--foreground); border: 1px solid var(--foreground); }
.ob-btn--tertiary { background: transparent; color: var(--foreground); width: auto; max-width: 297px; }
.ob-btn[aria-disabled="true"] { opacity: .45; }
@media (hover: hover) {
  .ob-btn--primary:hover { background: var(--primary-hover); }
  .ob-btn--secondary:hover, .ob-btn--tertiary:hover { background: var(--muted); }
}
.ob-btn:focus-visible, .ob-chip:focus-visible, .ob-back:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Text input (label inside the field, hint below) */
.ob-field { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ob-field__box {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card);
  transition: border-color var(--dur-ui) var(--ease-out), box-shadow var(--dur-ui) var(--ease-out);
}
.ob-field__box:focus-within { border-color: var(--foreground); box-shadow: inset 0 0 0 1px var(--foreground); }
.ob-field__label { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.ob-field__input {
  border: 0; outline: 0; padding: 0; margin: 0; background: transparent; width: 100%;
  font: 400 14px/20px "Hanken Grotesk", system-ui, sans-serif; color: var(--foreground);
}
.ob-field__input::placeholder { color: var(--stone); }
.ob-field__hint { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.ob-field.is-error .ob-field__box { border-color: var(--attention); box-shadow: inset 0 0 0 1px var(--attention); }

/* Code boxes */
.ob-code { display: flex; gap: 8px; width: 100%; }
.ob-code input {
  flex: 1 1 0; min-width: 0; height: 56px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-align: center; font: 400 22px/28px "Hanken Grotesk", system-ui, sans-serif; letter-spacing: -0.3px;
  color: var(--foreground); background: var(--card); padding: 0; caret-color: var(--foreground);
  transition: border-color var(--dur-ui) var(--ease-out), box-shadow var(--dur-ui) var(--ease-out);
}
.ob-code input:focus { outline: 0; border-color: var(--foreground); box-shadow: inset 0 0 0 1px var(--foreground); }
.ob-code.is-error input { border-color: var(--attention); }
.ob-resend { align-self: flex-start; background: none; border: 0; padding: 0; font: 400 12px/16px "Hanken Grotesk", system-ui, sans-serif; color: var(--muted-foreground); }
.ob-resend:not([disabled]) { color: var(--foreground); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* Screen swap */
.ob-anim { animation: ob-in var(--dur-state) var(--ease-out); }
@keyframes ob-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ob-anim { animation: none; } }

.ob-back__txt { display: none; }
@media (max-width: 959px) { .ob-d { display: none !important; } }

/* Desktop (Figma 1280 frames): top bar, 560px column, buttons in a row */
@media (min-width: 960px) {
  .ob-page, .ob { background: var(--card); }
  .ob { max-width: none; min-height: 100vh; position: relative; }
  .ob-head { height: 69px; min-height: 0; padding: 20px 80px; border-bottom: 1px solid var(--border-subtle); }
  .ob-brand { font-size: 22px; line-height: 28px; }
  .ob-head--back .ob-back {
    position: absolute; top: 109px; left: calc(50% - 280px); width: auto; height: auto; border: 0; border-radius: 0; background: none; padding: 0;
    font: 400 14px/18px "Hanken Grotesk", system-ui, sans-serif; color: var(--foreground); text-decoration: underline; text-underline-offset: 2px;
  }
  .ob-head--back .ob-back img { display: none; }
  .ob-head--back .ob-back__txt { display: inline; }
  .ob-head--back .ob-back:active { transform: none; }
  @media (hover: hover) { .ob-head--back .ob-back:hover { background: none; text-decoration-thickness: 2px; } }
  .ob-body, .ob-foot { width: 560px; max-width: calc(100% - 80px); margin: 0 auto; padding-left: 0; padding-right: 0; }
  .ob-body { flex: 0 0 auto; padding-top: 40px; padding-bottom: 0; }
  .ob-head--back ~ .ob-body, .ob-head--back + form > .ob-body { padding-top: 78px; } /* 40 + "← Back" 18 + 20 */
  .ob-head--back + form > .ob-body--16 { padding-top: 74px; } /* 40 + 18 + 16 */
  .ob-body--16 + .ob-foot { padding-top: 16px; }
  .ob-foot { position: static; flex-direction: row; justify-content: flex-start; gap: 12px; border-top: 0; background: none; padding: 20px 0 80px; }
  .ob-foot .ob-btn { width: 240px; max-width: none; flex: none; }
  .ob-photo { height: 220px; }
}

/* P0k Approved — Desktop: the pro app's top bar (tabs + avatar), 77px tall like pro.css .p-top */
.ob-nav, .ob-av { display: none; }
@media (min-width: 960px) {
  .ob-head--app { height: 77px; } /* space-between, as in the frame: the tabs centre between the wordmark and the avatar */
  .ob-nav { display: flex; justify-content: center; gap: 32px; }
  .ob-nav a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
  .ob-nav a::after { content: ""; width: 24px; height: 2px; }
  @media (hover: hover) { .ob-nav a:hover { color: var(--foreground); } }
  .ob-av { display: flex; }
  .ob-av img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
  .ob-nav a:focus-visible, .ob-av:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
}
