/* Sign in, sign up, password recovery, the welcome tour and the not-found page (views/auth.js, onboarding.js, not-found.js).
   The first two are "focus" pages: while they are open the shell's chrome is hidden (the views put .shell--focus on the shell). */

/* --- Focus layout ------------------------------------------------------------ */
.shell--focus .sidebar, .shell--focus .topbar, .shell--focus .mobile-bar { display: none; }
.shell--focus .shell-body { margin-left: 0; }
.shell--focus .shell-content { max-width: none; padding: 0; }
body:has(.shell--focus) #toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* --- Sign in, sign up, recovery ---------------------------------------------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--paper); }
.auth-panel { display: flex; flex-direction: column; min-width: 0; padding: 40px clamp(20px, 7vw, 110px) 32px; }
.auth-wordmark { align-self: flex-start; font-size: 30px; }
.auth-body { width: 100%; max-width: 440px; margin: auto 0; padding: 48px 0; }
.auth-body h1 { font-size: clamp(38px, 5vw, 60px); line-height: .98; letter-spacing: -.05em; margin: 14px 0 16px; }
.auth-body h1:focus { outline: none; }
.auth-lede { color: var(--muted); line-height: 1.7; max-width: 42ch; margin-bottom: 28px; }
.auth-foot { margin-top: auto; font-size: 9px; letter-spacing: .14em; }
.auth-notice { margin-bottom: 22px; }
.auth-notice p + p { margin-top: 8px; }

.auth-form { display: block; }
.auth-form .field { margin-bottom: 16px; }
.auth-show { margin: -4px 0 18px; font-size: 13px; color: var(--muted); }
.auth-show input { width: 18px; }
.auth-submit { width: 100%; margin-top: 6px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; margin-top: 24px; }
.auth-links .text-link { font-size: 10px; }
.auth-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; }
.auth-extra:empty { display: none; }
.auth-extra-text { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.auth-status { min-height: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.auth-status:empty { display: none; }
.auth-status.is-error { color: var(--danger); }
.auth-extra .auth-status { flex-basis: 100%; }

.auth-sent { display: grid; gap: 16px; }
.auth-address { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--rule); background: var(--white); overflow-wrap: anywhere; }
.auth-address svg { color: var(--bronze); }
.auth-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.auth-sent .auth-links { margin-top: 8px; }

.auth-picture { position: relative; margin: 0; overflow: hidden; border-left: 1px solid var(--rule); background: var(--wash); min-height: 100%; }
.auth-picture img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.auth-picture figcaption { position: absolute; left: 28px; bottom: 26px; color: var(--white); text-shadow: 0 1px 12px rgb(0 0 0 / .45); }

/* --- Welcome tour ------------------------------------------------------------ */
.onboard { min-height: 100dvh; display: flex; flex-direction: column; padding: 28px clamp(20px, 6vw, 72px) 48px; background: var(--paper); }
.onboard-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.onboard-head .wordmark { font-size: 28px; }
.onboard-skip { min-height: 44px; padding: 0 4px; font-size: 12px; color: var(--muted); }
.onboard-body { width: 100%; max-width: 640px; margin: 0 auto; padding: 36px 0 24px; }
.onboard-body h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1; letter-spacing: -.05em; margin: 28px 0 14px; }
.onboard-body h1:focus { outline: none; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.steps li { display: grid; gap: 2px; padding-top: 10px; border-top: 2px solid var(--rule); color: var(--muted); }
.steps li.is-done { border-top-color: var(--bronze); }
.steps li.is-current { border-top-color: var(--ink); color: var(--ink); }
.steps-label { font-size: 13px; }
.onboard-form { margin-top: 8px; }
.onboard-form .form-actions { margin-top: 30px; }
.avatar-picker { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; }
.avatar-preview { display: inline-flex; flex-shrink: 0; }
.avatar-controls { min-width: 0; display: grid; gap: 8px; }
.interest-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.interest { min-height: 44px; padding: 10px 18px; border: 1px solid var(--rule); background: var(--paper); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; transition: background .18s, color .18s, border-color .18s; }
.interest:hover { border-color: var(--ink); }
.interest[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.suggest-list { display: grid; margin-top: 10px; border-top: 1px solid var(--rule); }
.suggest-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.suggest-text { flex: 1; min-width: 0; }
.suggest-name { font-size: 16px; font-weight: 500; letter-spacing: -.02em; overflow-wrap: anywhere; }
.suggest-name .badge { margin-left: 6px; vertical-align: 2px; }
.suggest-line { font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.onboard-count { margin-top: 18px; font-size: 13px; color: var(--muted); }
.onboard-form .empty, .onboard-form .error-state { margin-top: 10px; }

/* --- Not found ---------------------------------------------------------------- */
.not-found-path { padding: 1px 6px; background: var(--wash); font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .9em; overflow-wrap: anywhere; }
.not-found-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.not-found-links { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--rule); }
.not-found-links ul { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 14px; }

/* --- Narrow screens ----------------------------------------------------------- */
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-picture { display: none; }
  .auth-panel { padding: 28px 20px 24px; }
  .auth-body { max-width: none; padding: 36px 0; }
}

@media (max-width: 520px) {
  .avatar-picker { align-items: flex-start; flex-direction: column; }
  .suggest-row { flex-wrap: wrap; }
  .suggest-row .follow-button { margin-left: 64px; }
  .onboard-form .form-actions .button { flex: 1 1 100%; }
  .steps-label { font-size: 12px; }
}

@media (pointer: coarse) {
  .text-button, .onboard-skip { min-height: 44px; }
  .auth-show input { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .interest { transition: none; }
}
