/* ==========================================================================
   auth.css — Namespaced auth screens (Login + Project Selection)
   Ported from design prototypes:
     - foundry/project/Login.html              → .fauth.fauth--login
     - foundry/project/Project Selection.html  → .fauth.fauth--pick
   Both views render inside a full-screen wrapper:
     Login:   <div class="fauth fauth--login">
     Pick:    <div class="fauth fauth--pick">
   Every prototype selector is strictly scoped so it can't collide with the
   app's global CSS or with the other variant. Keyframes are globally renamed
   with an `auth-` prefix and deduped.
   ========================================================================== */

/* ===== Shared base layer (tokens + base typography + viewport takeover) ===== */
.fauth {
  /* tokens (superset incl. --blue/--violet from Project Selection) */
  --bg: #F7F5F1; --surface: #FFFFFF; --surface-2: #FBFAF7; --surface-3: #F2EFE9;
  --border: #EBE7DF; --border-strong: #DCD7CC;
  --text: #1B1A17; --text-2: #6E6A60; --text-3: #A39E92;
  --red: #E2001A; --red-hover: #C30017; --red-soft: #FCE9EB; --red-tint: #FEF4F5;
  --green: #1E9E5A; --amber: #C9810F; --blue: #2D6FE0; --violet: #6B4FD8;
  --ink: #19171280;
  --sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --shadow-xs: 0 1px 2px rgba(28,24,14,.05);
  --shadow-sm: 0 1px 2px rgba(28,24,14,.04), 0 2px 6px rgba(28,24,14,.05);
  --shadow-md: 0 4px 12px rgba(28,24,14,.07), 0 1px 3px rgba(28,24,14,.06);
  --shadow-lg: 0 24px 60px rgba(28,24,14,.16), 0 4px 14px rgba(28,24,14,.08);

  /* base typography (from body {}) */
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;

  /* full-viewport takeover layer */
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: auto;
}

.fauth, .fauth *, .fauth *::before, .fauth *::after { box-sizing: border-box; }
.fauth button { font-family: inherit; cursor: pointer; }
.fauth input { font-family: inherit; }
.fauth a { color: inherit; }

.fauth *::-webkit-scrollbar { width: 9px; }
.fauth *::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* ==========================================================================
   Keyframes (global, renamed auth-*, deduped across both files)
   ========================================================================== */
@keyframes auth-bgMove {
  0%   { background-position: 0% 50%; }
  25%  { background-position: 60% 18%; }
  50%  { background-position: 100% 50%; }
  75%  { background-position: 40% 82%; }
  100% { background-position: 0% 50%; }
}
@keyframes auth-brandShift {
  0%   { background-position: 0% 0%, 100% 100%; filter: hue-rotate(0deg) saturate(1); }
  50%  { background-position: 8% 12%, 88% 86%; }
  100% { background-position: -6% 6%, 106% 94%; filter: hue-rotate(-8deg) saturate(1.12); }
}
@keyframes auth-drift1 { 0%{transform:translate(0,0) scale(1)} 50%{transform:translate(180px,150px) scale(1.2)} 100%{transform:translate(320px,60px) scale(1.05)} }
@keyframes auth-drift2 { 0%{transform:translate(0,0) scale(1.05)} 50%{transform:translate(-200px,-130px) scale(1)} 100%{transform:translate(-90px,-240px) scale(1.25)} }
@keyframes auth-drift3 { 0%{transform:translate(0,0) scale(1)} 50%{transform:translate(-240px,120px) scale(1.3)} 100%{transform:translate(180px,-110px) scale(.9)} }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-pop2 { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes auth-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes auth-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
@keyframes auth-rpulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(30,158,90,.5); } 50%{ box-shadow: 0 0 0 4px rgba(30,158,90,0); } }

/* ==========================================================================
   LOGIN  (.fauth--login)  — ported from Login.html
   ========================================================================== */
.fauth--login .wrap { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

/* ===== Brand panel ===== */
.fauth--login .brand {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(125deg, #3a0a14 0%, #160f0d 22%, #7c0f26 50%, #160f0d 78%, #4a0a18 100%);
  background-size: 340% 340%;
  animation: auth-bgMove 9s ease-in-out infinite;
  display: flex; flex-direction: column; padding: 48px 56px;
}
.fauth--login .brand::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(640px 520px at 18% 8%, rgba(255,45,65,.6), transparent 60%),
    radial-gradient(680px 600px at 92% 100%, rgba(255,30,50,.4), transparent 62%);
  animation: auth-brandShift 6s ease-in-out infinite alternate;
}
/* drifting orbs */
.fauth--login .fx { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.fauth--login .orb { position: absolute; border-radius: 50%; filter: blur(42px); opacity: .85; mix-blend-mode: screen; will-change: transform; }
.fauth--login .orb.o1 { width: 440px; height: 440px; left: -120px; top: -80px; background: radial-gradient(circle at 40% 40%, #ff6a3d, #e2001a 46%, transparent 70%); animation: auth-drift1 8s ease-in-out infinite alternate; }
.fauth--login .orb.o2 { width: 380px; height: 380px; right: -100px; bottom: 4%; background: radial-gradient(circle at 50% 50%, #ff2a44, #b00018 50%, transparent 72%); animation: auth-drift2 10s ease-in-out infinite alternate; }
.fauth--login .orb.o3 { width: 320px; height: 320px; left: 36%; top: 44%; background: radial-gradient(circle at 50% 50%, #ff3b5c, #5a0012 54%, transparent 70%); opacity: .7; animation: auth-drift3 12s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) {
  .fauth--login .brand, .fauth--login .brand::before, .fauth--login .orb { animation: none !important; }
}
.fauth--login .brand::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(160deg, rgba(0,0,0,.9), transparent 75%);
}
.fauth--login .brand > * { position: relative; z-index: 1; }
.fauth--login .blogo { display: flex; align-items: center; gap: 11px; }
.fauth--login .blogo .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--red); display: grid; place-items: center; font-weight: 800; font-size: 18px; box-shadow: 0 4px 16px rgba(226,0,26,.5); }
.fauth--login .blogo .word { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.fauth--login .bmid { margin-top: auto; margin-bottom: auto; max-width: 460px; }
.fauth--login .bmid .eyebrow { font: 600 12.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-bottom: 22px; }
.fauth--login .bmid h1 { font-size: 38px; line-height: 1.12; letter-spacing: -.025em; font-weight: 800; margin: 0 0 2px; }
.fauth--login .bmid p { font-size: 16px; line-height: 1.6; color: rgba(255,255,255,.66); margin: 22px 0 0; max-width: 40ch; }
.fauth--login .bquote { margin-top: 34px; padding: 18px 20px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(6px); }
.fauth--login .bquote p { font-size: 14.5px; color: rgba(255,255,255,.8); margin: 0; line-height: 1.55; }
.fauth--login .bquote .by { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.fauth--login .bquote .av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #E2001A, #8a1f2c); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.fauth--login .bquote .by div { line-height: 1.3; }
.fauth--login .bquote .by b { font-size: 13px; }
.fauth--login .bquote .by span { font-size: 12px; color: rgba(255,255,255,.5); display: block; }
.fauth--login .btrust { display: flex; gap: 26px; flex-wrap: wrap; }
.fauth--login .btrust .ti { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255,255,255,.6); font-weight: 500; white-space: nowrap; }
.fauth--login .btrust .ti svg { color: rgba(255,255,255,.5); }

/* ===== Form panel ===== */
.fauth--login .form { display: flex; flex-direction: column; padding: 40px 56px; position: relative; overflow-y: auto; }
.fauth--login .form-top { display: flex; justify-content: flex-end; }
.fauth--login .pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-xs); }
.fauth--login .pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(30,158,90,.15); }
.fauth--login .form-mid { margin: auto; width: 100%; max-width: 392px; padding: 28px 0; }
.fauth--login .mlogo { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.fauth--login .mlogo .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.fauth--login .mlogo .word { font-weight: 800; font-size: 17px; }
.fauth--login .heading { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.fauth--login .subhead { font-size: 14.5px; color: var(--text-2); margin: 9px 0 28px; }

.fauth--login .sso { display: flex; flex-direction: column; gap: 10px; }
.fauth--login .ssobtn {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 48px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface);
  font-size: 14.5px; font-weight: 600; color: var(--text); box-shadow: var(--shadow-xs); white-space: nowrap;
  transition: background .14s, border-color .14s, transform .05s, box-shadow .14s; position: relative;
}
.fauth--login .ssobtn:hover { background: var(--surface-2); border-color: var(--text-3); box-shadow: var(--shadow-sm); }
.fauth--login .ssobtn:active { transform: translateY(.5px); }
.fauth--login .ssobtn .label { flex: 1; text-align: left; }
.fauth--login .ssobtn .tag { font-size: 11px; font-weight: 600; color: var(--text-3); background: var(--surface-3); border: 1px solid var(--border); padding: 3px 7px; border-radius: 6px; }
.fauth--login .ssobtn .chev { color: var(--text-3); }
.fauth--login .ssobtn:disabled { opacity: .6; cursor: default; }
.fauth--login .ssobtn.loading .glogo, .fauth--login .ssobtn.loading .chev, .fauth--login .ssobtn.loading .tag { opacity: 0; }
.fauth--login .spin { position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border: 2.5px solid var(--surface-3); border-top-color: var(--red); border-radius: 50%; animation: auth-spin .7s linear infinite; opacity: 0; }
.fauth--login .ssobtn.loading .spin { opacity: 1; }

.fauth--login .ssomore { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fauth--login .ssomini { display: flex; align-items: center; justify-content: center; gap: 9px; height: 44px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-xs); transition: background .14s, border-color .14s; }
.fauth--login .ssomini:hover { background: var(--surface-2); border-color: var(--text-3); }

.fauth--login .divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.fauth--login .divider::before, .fauth--login .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.fauth--login .field { margin-bottom: 15px; }
.fauth--login .field label { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; margin-bottom: 7px; white-space: nowrap; }
.fauth--login .field label a { font-size: 12.5px; font-weight: 600; color: var(--red); text-decoration: none; }
.fauth--login .field label a:hover { text-decoration: underline; }
.fauth--login .inp { position: relative; }
.fauth--login .inp input {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 11px;
  background: var(--surface); font-size: 14.5px; color: var(--text); outline: none; transition: border-color .14s, box-shadow .14s;
}
.fauth--login .inp input::placeholder { color: var(--text-3); }
.fauth--login .inp input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(226,0,26,.1); }
.fauth--login .inp.has-icon input { padding-right: 44px; }
.fauth--login .inp .eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: none; background: transparent; color: var(--text-3); display: grid; place-items: center; border-radius: 8px; }
.fauth--login .inp .eye:hover { background: var(--surface-3); color: var(--text-2); }

.fauth--login .ssohint { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 11px; background: var(--red-tint); border: 1px solid var(--red-soft); font-size: 13px; color: var(--text-2); margin-bottom: 15px; animation: auth-pop .2s ease; }
.fauth--login .ssohint b { color: var(--text); font-weight: 600; }
.fauth--login .ssohint .ic { color: var(--red); flex-shrink: 0; }

.fauth--login .err { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: 11px; background: var(--red-soft); border: 1px solid #f3c6cc; font-size: 13px; color: #9a1420; font-weight: 500; margin-bottom: 15px; animation: auth-shake .35s; }

.fauth--login .remember { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; }
.fauth--login .cbx { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); font-weight: 500; user-select: none; white-space: nowrap; }
.fauth--login .cbx .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; transition: all .12s; }
.fauth--login .cbx .box.on { background: var(--red); border-color: var(--red); }
.fauth--login .cbx .box svg { color: #fff; opacity: 0; }
.fauth--login .cbx .box.on svg { opacity: 1; }

.fauth--login .submit {
  width: 100%; height: 48px; border: 1px solid var(--red); border-radius: 12px; background: var(--red); color: #fff;
  font-size: 15px; font-weight: 700; box-shadow: 0 4px 14px rgba(226,0,26,.3); display: flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap;
  transition: background .14s, transform .05s, box-shadow .14s; position: relative;
}
.fauth--login .submit:hover { background: var(--red-hover); box-shadow: 0 6px 18px rgba(226,0,26,.36); }
.fauth--login .submit:active { transform: translateY(1px); }
.fauth--login .submit.loading span, .fauth--login .submit.loading svg { opacity: 0; }
.fauth--login .submit .spin2 { position: absolute; width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: auth-spin .7s linear infinite; opacity: 0; }
.fauth--login .submit.loading .spin2 { opacity: 1; }

.fauth--login .switchmode { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--text-2); }
.fauth--login .switchmode button { border: none; background: transparent; color: var(--red); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.fauth--login .switchmode button:hover { text-decoration: underline; }

.fauth--login .form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--text-3); padding-top: 16px; }
.fauth--login .form-foot a { color: var(--text-3); text-decoration: none; }
.fauth--login .form-foot a:hover { color: var(--text-2); }
.fauth--login .form-foot .links { display: flex; gap: 18px; }

/* success overlay */
.fauth--login .success { position: fixed; inset: 0; background: rgba(247,245,241,.96); backdrop-filter: blur(6px); z-index: 50; display: grid; place-items: center; animation: auth-pop .25s ease; }
.fauth--login .success .card { text-align: center; }
.fauth--login .success .ring { width: 72px; height: 72px; border-radius: 50%; background: var(--green); display: grid; place-items: center; margin: 0 auto 22px; color: #fff; box-shadow: 0 10px 30px rgba(30,158,90,.35); animation: auth-pop2 .4s cubic-bezier(.2,.9,.3,1.4); }
.fauth--login .success h2 { margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.fauth--login .success p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.fauth--login .success .who { font-weight: 600; color: var(--text); }

@media (max-width: 880px) {
  .fauth--login .wrap { grid-template-columns: 1fr; }
  .fauth--login .brand { display: none; }
  .fauth--login .mlogo { display: flex; }
  .fauth--login .form { padding: 28px 22px; }
  .fauth--login .form-mid { padding: 12px 0; }
}

/* ==========================================================================
   PROJECT SELECTION  (.fauth--pick)  — ported from Project Selection.html
   ========================================================================== */
.fauth--pick .wrap { display: grid; grid-template-columns: 1.05fr 1.25fr; min-height: 100vh; }

/* ===== Brand panel (shared with Login) ===== */
.fauth--pick .brand {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(125deg, #3a0a14 0%, #160f0d 22%, #7c0f26 50%, #160f0d 78%, #4a0a18 100%);
  background-size: 340% 340%;
  animation: auth-bgMove 9s ease-in-out infinite;
  display: flex; flex-direction: column; padding: 48px 56px;
}
.fauth--pick .brand::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(640px 520px at 18% 8%, rgba(255,45,65,.6), transparent 60%),
    radial-gradient(680px 600px at 92% 100%, rgba(255,30,50,.4), transparent 62%);
  animation: auth-brandShift 6s ease-in-out infinite alternate;
}
.fauth--pick .fx { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.fauth--pick .orb { position: absolute; border-radius: 50%; filter: blur(42px); opacity: .85; mix-blend-mode: screen; will-change: transform; }
.fauth--pick .orb.o1 { width: 440px; height: 440px; left: -120px; top: -80px; background: radial-gradient(circle at 40% 40%, #ff6a3d, #e2001a 46%, transparent 70%); animation: auth-drift1 8s ease-in-out infinite alternate; }
.fauth--pick .orb.o2 { width: 380px; height: 380px; right: -100px; bottom: 4%; background: radial-gradient(circle at 50% 50%, #ff2a44, #b00018 50%, transparent 72%); animation: auth-drift2 10s ease-in-out infinite alternate; }
.fauth--pick .orb.o3 { width: 320px; height: 320px; left: 36%; top: 44%; background: radial-gradient(circle at 50% 50%, #ff3b5c, #5a0012 54%, transparent 70%); opacity: .7; animation: auth-drift3 12s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { .fauth--pick .brand, .fauth--pick .brand::before, .fauth--pick .orb { animation: none !important; } }
.fauth--pick .brand::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 26px 26px; mask-image: linear-gradient(160deg, rgba(0,0,0,.9), transparent 75%);
}
.fauth--pick .brand > * { position: relative; z-index: 1; }
.fauth--pick .blogo { display: flex; align-items: center; gap: 11px; }
.fauth--pick .blogo .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--red); display: grid; place-items: center; font-weight: 800; font-size: 18px; box-shadow: 0 4px 16px rgba(226,0,26,.5); }
.fauth--pick .blogo .word { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.fauth--pick .bmid { margin-top: auto; margin-bottom: auto; max-width: 460px; }
.fauth--pick .bmid .eyebrow { font: 600 12.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-bottom: 22px; }
.fauth--pick .bmid h1 { font-size: 38px; line-height: 1.12; letter-spacing: -.025em; font-weight: 800; margin: 0 0 2px; }
.fauth--pick .bmid p { font-size: 16px; line-height: 1.6; color: rgba(255,255,255,.66); margin: 22px 0 0; max-width: 40ch; }
.fauth--pick .bstats { display: flex; gap: 30px; margin-top: 36px; }
.fauth--pick .bstats .s b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; display: block; }
.fauth--pick .bstats .s span { font-size: 12.5px; color: rgba(255,255,255,.55); font-weight: 500; }
.fauth--pick .btrust { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 40px; }
.fauth--pick .btrust .ti { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255,255,255,.6); font-weight: 500; white-space: nowrap; }
.fauth--pick .btrust .ti svg { color: rgba(255,255,255,.5); }

/* ===== Picker panel ===== */
.fauth--pick .panel { display: flex; flex-direction: column; padding: 36px 52px 28px; position: relative; overflow-y: auto; height: 100vh; }
.fauth--pick .ptop { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.fauth--pick .who { display: flex; align-items: center; gap: 12px; }
.fauth--pick .who .av { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #E2001A, #8a1f2c); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; box-shadow: var(--shadow-sm); }
.fauth--pick .who .meta b { font-size: 15px; font-weight: 700; display: block; line-height: 1.25; }
.fauth--pick .who .meta span { font-size: 12.5px; color: var(--text-3); }
.fauth--pick .ptop-right { display: flex; align-items: center; gap: 10px; }
.fauth--pick .pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-xs); }
.fauth--pick .pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(30,158,90,.15); }
.fauth--pick .signout { height: 34px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-xs); display: inline-flex; align-items: center; gap: 7px; transition: background .14s, color .14s, border-color .14s; }
.fauth--pick .signout:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }

.fauth--pick .phead { margin: 38px 0 22px; }
.fauth--pick .mlogo { display: none; align-items: center; gap: 10px; margin-bottom: 22px; }
.fauth--pick .mlogo .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.fauth--pick .mlogo .word { font-weight: 800; font-size: 17px; }
.fauth--pick .phead h1 { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.fauth--pick .phead p { font-size: 14.5px; color: var(--text-2); margin: 9px 0 0; }

.fauth--pick .ptools { display: flex; gap: 11px; margin-bottom: 18px; }
.fauth--pick .psearch { flex: 1; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-xs); color: var(--text-3); transition: border-color .14s, box-shadow .14s; }
.fauth--pick .psearch:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(226,0,26,.1); }
.fauth--pick .psearch input { border: none; outline: none; background: transparent; width: 100%; font-size: 14.5px; color: var(--text); }
.fauth--pick .psearch input::placeholder { color: var(--text-3); }
.fauth--pick .segwrap { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 3px; gap: 2px; }
.fauth--pick .segwrap button { border: none; background: transparent; height: 38px; padding: 0 14px; border-radius: 8px; color: var(--text-2); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; transition: all .13s; }
.fauth--pick .segwrap button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

.fauth--pick .plist { display: flex; flex-direction: column; gap: 11px; flex: 1; }
.fauth--pick .plist.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; align-content: start; }
/* grid card: stack contents vertically */
.fauth--pick .plist.grid .pcard { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px; }
.fauth--pick .plist.grid .pcard .picon { width: 46px; height: 46px; }
.fauth--pick .plist.grid .pbody .desc { white-space: normal; max-width: none; min-height: 34px; }
.fauth--pick .plist.grid .pbody .sub { flex-wrap: wrap; gap: 10px 14px; }
.fauth--pick .plist.grid .pright { position: absolute; top: 16px; right: 16px; }
.fauth--pick .plist.grid .pcreate { flex-direction: row; }
.fauth--pick .plist.grid .pcreate { grid-column: 1 / -1; }
.fauth--pick .pcard {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .08s; position: relative; width: 100%;
}
.fauth--pick .pcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.fauth--pick .pcard:active { transform: translateY(0); }
.fauth--pick .pcard.loading { border-color: var(--red); box-shadow: 0 0 0 3px rgba(226,0,26,.1); }
.fauth--pick .picon { width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.fauth--pick .pbody { flex: 1; min-width: 0; }
.fauth--pick .pbody .nm { display: flex; align-items: center; gap: 9px; }
.fauth--pick .pbody .nm b { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.fauth--pick .pbody .desc { font-size: 13px; color: var(--text-2); margin: 3px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46ch; }
.fauth--pick .pbody .sub { display: flex; align-items: center; gap: 14px; margin-top: 9px; }
.fauth--pick .av-stack { display: flex; }
.fauth--pick .av-stack .a { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -7px; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; color: #fff; }
.fauth--pick .av-stack .a:first-child { margin-left: 0; }
.fauth--pick .av-more { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -7px; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; font-size: 9.5px; font-weight: 700; }
.fauth--pick .metatxt { font-size: 12px; color: var(--text-3); font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
.fauth--pick .runpill { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.fauth--pick .runpill .rdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.fauth--pick .runpill .rdot.pulse { animation: auth-rpulse 1.6s ease-in-out infinite; }
.fauth--pick .role-badge { height: 22px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; }
.fauth--pick .rb-owner { background: var(--red); color: #fff; }
.fauth--pick .rb-admin { background: var(--text); color: #fff; }
.fauth--pick .rb-member { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.fauth--pick .pright { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.fauth--pick .penv { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.fauth--pick .parrow { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; transition: background .14s, color .14s; flex-shrink: 0; }
.fauth--pick .pcard:hover .parrow { background: var(--red); color: #fff; }
.fauth--pick .pcard .pspin { width: 20px; height: 20px; border: 2.5px solid var(--surface-3); border-top-color: var(--red); border-radius: 50%; animation: auth-spin .7s linear infinite; }

.fauth--pick .pcreate { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border: 1.5px dashed var(--border-strong); border-radius: 15px; background: transparent; width: 100%; text-align: left; color: var(--text-2); transition: border-color .15s, background .15s, color .15s; }
.fauth--pick .pcreate:hover { border-color: var(--red); background: var(--red-tint); color: var(--red); }
.fauth--pick .pcreate .plus { width: 50px; height: 50px; border-radius: 13px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); flex-shrink: 0; transition: background .15s, color .15s; }
.fauth--pick .pcreate:hover .plus { background: var(--red); color: #fff; }
.fauth--pick .pcreate b { font-size: 14.5px; font-weight: 700; }
.fauth--pick .pcreate span { font-size: 12.5px; display: block; color: var(--text-3); margin-top: 2px; }

.fauth--pick .empty { padding: 50px; text-align: center; color: var(--text-3); font-size: 14px; }

.fauth--pick .pfoot { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--text-3); padding-top: 22px; margin-top: 14px; border-top: 1px solid var(--border); }
.fauth--pick .pfoot a { color: var(--text-3); text-decoration: none; }
.fauth--pick .pfoot a:hover { color: var(--text-2); }
.fauth--pick .pfoot .links { display: flex; gap: 18px; }

.fauth--pick .success { position: fixed; inset: 0; background: rgba(247,245,241,.96); backdrop-filter: blur(6px); z-index: 50; display: grid; place-items: center; animation: auth-fade .25s ease; }
.fauth--pick .success .card { text-align: center; }
.fauth--pick .success .ring { width: 70px; height: 70px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 22px; color: #fff; box-shadow: var(--shadow-lg); animation: auth-pop2 .4s cubic-bezier(.2,.9,.3,1.4); }
.fauth--pick .success h2 { margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.fauth--pick .success p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.fauth--pick .success .who2 { font-weight: 700; color: var(--text); }

@media (max-width: 980px) {
  .fauth--pick .wrap { grid-template-columns: 1fr; }
  .fauth--pick .brand { display: none; }
  .fauth--pick .mlogo { display: flex; }
  .fauth--pick .panel { padding: 26px 22px; height: auto; min-height: 100vh; }
  .fauth--pick .pbody .desc { max-width: 30ch; }
}

/* The login / project-selection screens are full takeovers — hide the app's
   persistent live-agents dock while either is mounted. */
body:has(.fauth) .dock { display: none !important; }

/* The app's global `h1…h6 { color: var(--ink-1) }` (base.css) directly colors
   headings, which beats the white the brand-panel headline should inherit from
   `.brand`. Restore the design: brand headings are white on the dark panel. */
.fauth--login .brand h1, .fauth--pick .brand h1 { color: #fff; }

/* The success overlay's inner uses class `card`, which collides with the app's
   global `.card` component (white box, border, shadow, padding) and crunches
   the content. The design intends a plain centered block — neutralize the box. */
.fauth--login .success .card, .fauth--pick .success .card {
  background: transparent; border: none; border-radius: 0; box-shadow: none;
  overflow: visible; padding: 0;
}
