/* ══════════════════════════════════════════════
   SX AUTH — auth.css
   Full-screen login / signup surface
══════════════════════════════════════════════ */
:root {
  /* Light (default) — matches settings.css exactly */
  --bg-color:     #f2f2f7;
  --card-bg:      #ffffff;
  --card-border:  rgba(0,0,0,.04);
  --text-primary: #000000;
  --text-secondary: #8e8e93;
  --text-tertiary:  rgba(60,60,67,.3);
  --accent:       #d80201;
  --divider:      rgba(60,60,67,.12);
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);

  /* status colors — iOS system, light */
  --ok:        #34c759;
  --err:       #ff3b30;
  --amber:     #ff9500;
  --cyan:      #32ade6;
  --purple:    #af52de;
  --telegram:  #26a5e4;

  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --font-display: 'Inter', sans-serif;
  --font-body:    'Inter', sans-serif;
}

[data-theme="dark"] {
  --bg-color:     #000000;
  --card-bg:      #1c1c1e;
  --card-border:  rgba(255,255,255,.05);
  --text-primary: #ffffff;
  --text-secondary: #8e8e93;
  --text-tertiary:  rgba(235,235,245,.3);
  --accent:       #bb0000;
  --divider:      rgba(84,84,88,.35);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.4);

  --ok:        #d80201;
  --err:       #ff453a;
  --amber:     #ff9f0a;
  --cyan:      #64d2ff;
  --purple:    #bf5af2;
  --telegram:  #26a5e4;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── Page shell (full-screen) ── */
.page-shell {
  position: fixed; inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-color); /* flat — no decorative radial gradients per design system */
}
 
.top-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  background: var(--card-bg);
  transition: border-color .25s ease;
  border-bottom: 1px solid transparent;
}
.top-bar.scrolled {
  border-bottom-color: var(--divider);
}
.top-bar .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.top-bar .brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: #fff;
}
.top-bar .help-link { color: var(--text-secondary); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.top-bar .help-link:hover { color: var(--text-primary); }
/* ── Main center stage ── */
.stage {
  position: relative; z-index: 5;
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px 64px;
}

.mode-switch {
  display: flex; gap: 4px;
  background: var(--bg-color);
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 4px;
  margin: 0 auto 22px;
  width: fit-content;
}
.mode-switch button {
  border: none; background: transparent; color: var(--text-secondary);
  font-family: var(--font-body); font-weight: 700; font-size: 13.5px;
  padding: 9px 22px; border-radius: 999px; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.mode-switch button:hover { background: var(--divider); }
.mode-switch button.active { background: var(--text-primary); color: var(--card-bg); }
[data-theme="dark"] .mode-switch button.active { color: var(--bg-color); }

.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 34px 30px 28px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 599px) {
  /* Card becomes the screen — no floating panel, no visible edges */
  .stage {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  #mainAuthWrap,
  #accountSwitcher {
    max-width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
.auth-card {
    max-width: 100%;
    flex: 1;
    width: 100%;
    padding: 28px 22px calc(24px + env(safe-area-inset-bottom));
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--divider);
    background: var(--bg-color);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .mode-switch { margin: 18px auto 20px; width: 100%; max-width: 320px; }
  .mode-switch button { flex: 1; padding: 12px 0; font-size: 14.5px; }
  .top-bar { padding: 16px 18px; }
  .auth-headline { font-size: 23px; }
  .auth-input, .btn-primary, .btn-secondary, .btn-accent, .btn-google { height: 54px; font-size: 16px; }
  .code-box { width: 15.5vw; max-width: 50px; height: 60px; font-size: 24px; }
  footer.auth-footer { display: none; } /* keep the screen feeling edge-to-edge; footer just adds scroll noise on mobile */
}
.auth-headline { font-family: var(--font-display); font-weight: 800; font-size: 25px; letter-spacing: -0.02em; text-align: center; color: var(--text-primary); }
.auth-sub { color: var(--text-secondary); font-size: 14px; text-align: center; line-height: 1.5; }
/* ── Steps ── */
html[data-mode="signup"] #loginPanel,
html[data-mode="login"]  #signupPanel { display: none; }

.step { display: none; }
.step.active { display: block; animation: stepIn .32s cubic-bezier(.22,.9,.35,1); }
@keyframes stepIn { from { opacity:0; transform: translateY(6px);} to {opacity:1; transform:none;} }
.slide-in-right { animation: slideRight .32s cubic-bezier(.22,.9,.35,1) !important; }
.slide-in-left  { animation: slideLeft .32s cubic-bezier(.22,.9,.35,1) !important; }
 .auth-card-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 900; font-size: 15px;
  margin-bottom: 16px;
}
.last-method-badge {
  display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent);
  font-size: 12.5px; font-weight: 700;
  padding: 8px 12px; border-radius: 999px;
  width: fit-content; margin: 14px auto 4px;
}
.last-method-badge i, .last-method-badge svg { width: 14px; height: 14px; }

.field label { display:block; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.auth-input {
  width: 100%; height: 50px; padding: 0 16px;
  background: var(--bg-color);
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 15px; font-family: var(--font-body);
  outline: none; transition: border-color .18s ease, background .18s ease;
}
.auth-input::placeholder { color: var(--text-tertiary); }
.auth-input:focus { border-color: var(--accent); background: var(--card-bg); }
.auth-input.valid { border-color: var(--ok); }
.auth-input.invalid { border-color: var(--err); animation: shake .35s cubic-bezier(.36,.07,.19,.97) both; }

.pwd-wrap { position: relative; }
.pwd-wrap .auth-input { padding-right: 44px; }
.pwd-eye { position:absolute; right:14px; top:50%; transform:translateY(-50%); cursor:pointer; color:var(--text-tertiary); background:none; border:none; padding:4px; }
.pwd-eye:hover { color: var(--text-secondary); }
.hidden { display: none !important; }

.err-msg { display:none; align-items:center; gap:6px; color: var(--err); font-size: 12.5px; font-weight: 600; margin-top: 7px; }
.err-msg.show { display: flex; }
.ok-msg { display:none; align-items:center; gap:6px; color: var(--ok); font-size: 12.5px; font-weight: 600; margin-top: 7px; }
.ok-msg.show { display: flex; }

.avail-badge { display:none; font-size:11px; font-weight:800; padding:3px 8px; border-radius:999px; letter-spacing:.02em; }
.avail-badge.show { display: inline-block; }
.avail-badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.avail-badge.no { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.val-icon { display:none; }
.val-icon.show { display:inline-flex; width:16px; height:16px; }
.val-icon.ok svg { stroke: var(--ok); }
.val-icon.err svg { stroke: var(--err); }

.input-row-flex { display: flex; align-items: center; justify-content: space-between; }

/* ── Buttons ── */
.btn-primary, .btn-secondary, .btn-accent, .btn-google, .btn-passkey {
  position: relative; overflow: hidden;
  width: 100%; height: 50px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  cursor: pointer; border: none; transition: opacity .15s ease, transform .15s ease, background .15s ease;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: .9; }

.btn-accent { background: var(--text-primary); color: var(--card-bg); }
[data-theme="dark"] .btn-accent { color: var(--bg-color); }
.btn-accent:hover { opacity: .9; }
.btn-secondary { background: var(--card-bg); color: var(--text-primary); border: 1.5px solid var(--divider); }
.btn-secondary:hover { background: var(--divider); }
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid rgba(0,0,0,0.08); }
.btn-google:hover { background: #f4f4f4; }

.btn-passkey {
  height: auto; padding: 12px 14px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 22%, transparent);
  justify-content: flex-start; text-align: left;
}
.btn-passkey:hover { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.pk-icon-wrap { width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 16%, transparent); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.pk-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pk-title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); display:flex; align-items:center; }
.pk-sub { font-size: 12px; color: var(--text-secondary); font-weight: 500; }


.btn-ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0); opacity: 0.6;
  animation: rippleAnim .55s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(1); opacity: 0; } }

.spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spinAnim .7s linear infinite; }
@keyframes spinAnim { to { transform: rotate(360deg); } }

.divider { display:flex; align-items:center; gap:12px; margin: 18px 0; color: var(--text-tertiary); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.link-row { text-align:center; font-size: 13.5px; color: var(--text-secondary); margin-top: 16px; }
.link-row a, .link-btn { color: var(--accent); font-weight: 700; text-decoration: none; cursor: pointer; background:none; border:none; font-size: inherit; font-family: inherit; }
.link-btn:hover, .link-row a:hover { text-decoration: underline; }

.check-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; cursor: pointer; user-select: none; }
.check-row:hover .check-box:not(.checked) { border-color: var(--accent); }
.check-box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--divider); display:flex; align-items:center; justify-content:center; flex-shrink:0; transition: background .15s ease, border-color .15s ease; }
.check-box.checked { background: var(--accent); border-color: var(--accent); }
.check-box.checked::after { content:'✓'; color:#fff; font-size:12px; font-weight:900; }
.check-label { font-size: 13.5px; color: var(--text-secondary); }
.check-label a { color: var(--text-primary); font-weight: 700; }

/* ── OTP boxes ── */
.code-boxes { display: flex; gap: 8px; justify-content: center; margin: 18px 0; }
.code-box {
  width: 46px; height: 56px; text-align: center;
  font-size: 22px; font-weight: 800;
  background: var(--bg-color);
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-sm);
  color: var(--text-primary); outline: none;
  transition: border-color .18s ease;
}
.code-box:hover { border-color: var(--text-tertiary); }
.code-box:focus { border-color: var(--accent); }
.code-box.filled { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.code-box.invalid { animation: shake .35s cubic-bezier(.36,.07,.19,.97) both; border-color: var(--err); }

.pk-sheet, .code-sheet {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.45); /* flat scrim, no blur */
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease, visibility 0s .25s;
}
.pk-sheet.show, .code-sheet.show { opacity: 1; visibility: visible; pointer-events: all; transition: opacity .25s ease; }
.pk-sheet-panel, .code-sheet-panel {
  width: 100%; max-width: 440px;
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 24px 24px 0 0;
  padding: 28px 24px 32px;
  transform: translateY(20px);
  transition: transform .3s cubic-bezier(.22,.9,.35,1);
}
.pk-sheet.show .pk-sheet-panel, .code-sheet.show .code-sheet-panel { transform: translateY(0); }

.sheet-close { display:flex; justify-content:flex-end; margin-bottom: 6px; }
.sheet-close button { background:none; border:none; color: var(--text-tertiary); font-size: 20px; cursor:pointer; padding: 6px; }
.sheet-close button:hover { color: var(--text-secondary); }

.pk-ring-wrap { display:flex; justify-content:center; margin: 8px 0 18px; }
.pk-ring { width: 88px; height: 88px; border-radius: 50%; display:flex; align-items:center; justify-content:center; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: 34px; transition: all .3s ease; }
.pk-ring.scanning { animation: pkPulse 1.4s ease-in-out infinite; border-color: var(--accent); }
.pk-ring.success { background: color-mix(in srgb, var(--ok) 14%, transparent); border-color: var(--ok); }
.pk-ring.error { background: color-mix(in srgb, var(--err) 12%, transparent); border-color: var(--err); }
@keyframes pkPulse { 0%,100%{box-shadow:0 0 0 0 color-mix(in srgb, var(--accent) 35%, transparent);} 50%{box-shadow:0 0 0 14px transparent;} }

.pk-dots { display:flex; justify-content:center; gap:6px; margin-top:18px; }
.pk-dot-step { width: 7px; height: 7px; border-radius: 50%; background: var(--divider); transition: background .2s ease; }
.pk-dot-step.active { background: var(--accent); }
.pk-dot-step.done { background: var(--ok); }

.method-option { display:flex; align-items:center; gap:12px; padding: 13px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--divider); margin-bottom: 8px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.method-option:hover { background: var(--divider); }
.method-option.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.method-option .mo-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-color); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.method-option .mo-body { flex:1; }
.method-option .mo-title { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.method-option .mo-sub { font-size: 12px; color: var(--text-tertiary); }

/* ── QR ── */
.qr-frame { width: 220px; height: 220px; margin: 0 auto; background: #fff; border-radius: 16px; display:flex; align-items:center; justify-content:center; position: relative; overflow: hidden; }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.qr-status { display:flex; align-items:center; justify-content:center; gap:8px; margin-top: 16px; font-size: 13.5px; font-weight: 600; color: var(--text-secondary); }
.qr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-tertiary); }
.qr-dot.waiting { background: var(--amber); animation: pulseDot 1.4s ease-in-out infinite; }
.qr-dot.scanning { background: var(--accent); animation: pulseDot 1s ease-in-out infinite; }
.qr-dot.verified { background: var(--ok); }
.qr-dot.expired { background: var(--err); }
@keyframes pulseDot { 0%,100%{opacity:1;} 50%{opacity:.35;} }
#qrTokenTxt { text-align:center; font-size: 11px; color: var(--text-tertiary); word-break: break-all; margin-top: 10px; padding: 0 20px; }

/* ── Password strength ── */
.strength-track { height: 5px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; margin-top: 8px; }
.strength-fill { height: 100%; width: 0; border-radius: 999px; transition: width .25s ease, background .25s ease; }
.strength-label { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }

/* ── Signup progress ── */
.signup-progress { display:flex; align-items:center; justify-content:center; gap: 6px; margin: 4px 0 22px; position: relative; height: 4px; }
.sp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--divider); transition: background .25s ease; z-index:1; }
.sp-dot.active { background: var(--accent); }
.sp-dot.done { background: var(--ok); }
.sp-line { flex: 1; height: 2px; background: var(--divider); max-width: 40px; }
.sp-line.done { background: var(--ok); }
.step-num-label { text-align:center; font-size: 11.5px; color: var(--text-tertiary); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 18px; }

.avatar-upload-wrap { display:flex; justify-content:center; margin: 6px 0 20px; }
.avatar-preview { width: 88px; height: 88px; border-radius: 50%; background: var(--bg-color); border: 2px dashed var(--divider); display:flex; align-items:center; justify-content:center; font-size: 26px; font-weight: 800; color: var(--text-tertiary); position: relative; cursor: pointer; }
.avatar-preview:hover { border-color: var(--accent); }
.avatar-preview input[type=file] { position:absolute; inset:0; opacity:0; cursor:pointer; }

.review-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--divider); font-size: 13.5px; }
.review-row:last-child { border-bottom: none; }
.review-key { color: var(--text-tertiary); font-weight: 600; }
.review-val { color: var(--text-primary); font-weight: 700; text-align: right; max-width: 60%; word-break: break-word; }

.su-nav-row { display: flex; gap: 10px; margin-top: 22px; }
.su-nav-row .btn-secondary { width: auto; padding: 0 18px; flex-shrink: 0; }

 /* =======================================================
   Account Switcher — flat cards, iOS Settings style
=======================================================*/

#accountSwitcher{
    width:100%;
    max-width:430px;
}

.acct-row{
    position:relative;
    display:flex;
    align-items:center;
    gap:15px;
    padding:15px 18px;
    margin-bottom:14px;
    border-radius:var(--radius-lg);
    background:var(--card-bg);
    border:1px solid var(--card-border);
    box-shadow:var(--shadow-sm);
    cursor:pointer;
    transition:background .15s ease;
}

.acct-row:hover{
    background:var(--divider);
}

.acct-row:active{
    transform:scale(.985);
}

.acct-avatar{
    width:52px;
    height:52px;
    border-radius:50%;
    overflow:hidden;
    flex-shrink:0;
    background:var(--bg-color);
    border:1px solid var(--card-border);
}

.acct-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.acct-body{
    flex:1;
    min-width:0;
}

.acct-name{
    font-size:15px;
    font-weight:700;
    color:var(--text-primary);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.acct-email{
    margin-top:3px;
    font-size:13px;
    color:var(--text-secondary);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.active-account{
    border-color:var(--accent);
    box-shadow:0 0 0 1px var(--accent), var(--shadow-sm);
}

.acct-badge{
    background:var(--bg-color);
    border:1px solid var(--card-border);
    padding:6px 12px;
    border-radius:999px;
    font-size:11px;
    font-weight:700;
    color:var(--text-primary);
}

.acct-chevron{
    color:var(--text-tertiary);
    transition:color .15s ease, transform .15s ease;
}

.acct-row:hover .acct-chevron{
    transform:translateX(4px);
    color:var(--text-secondary);
}

/* =========================
   Add Account
=========================*/

.add-account-row{
    display:flex;
    align-items:center;
    gap:15px;
    padding:16px 18px;
    margin-top:10px;
    border-radius:var(--radius-lg);
    cursor:pointer;
    color:var(--text-primary);
    font-weight:700;
    background:var(--card-bg);
    border:1px solid var(--card-border);
    transition:background .15s ease;
}

.add-account-row:hover{
    background:var(--divider);
}

.plus-circle{
    width:44px;
    height:44px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--bg-color);
    border:1px solid var(--card-border);
    font-size:20px;
    color:var(--text-primary);
}

/* =========================
   Loading Screen
=========================*/

.loading-screen{
    position:fixed;
    inset:0;
    z-index:9999;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:20px;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .25s ease, visibility 0s .25s;
    background:var(--bg-color);
}

.loading-screen.on{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transition:opacity .25s ease;
}

.loading-ring{
    width:60px;
    height:60px;
    border-radius:50%;
    border:4px solid var(--divider);
    border-top-color:var(--accent);
    animation:spin .8s linear infinite;
}

@keyframes spin{
    to{ transform:rotate(360deg); }
}

/* =========================
   Toast
=========================*/

.toast-item{
    background:var(--card-bg);
    border:1px solid var(--card-border);
    border-radius:999px;
    color:var(--text-primary);
    padding:13px 22px;
    box-shadow:var(--shadow-sm);
}

/* Position: bottom-center mobile default */
.toast-wrap {
  position: fixed;
  left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 500;
  display: flex; flex-direction: column; gap: 8px;
}

/* =========================
   User Pill
=========================*/

.user-pill{
    display:flex;
    align-items:center;
    gap:12px;
    padding:9px 15px;
    border-radius:999px;
    background:var(--card-bg);
    border:1px solid var(--card-border);
    box-shadow:var(--shadow-sm);
}
.user-pill .up-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-color); overflow:hidden; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:13px; color: var(--text-primary); }
.user-pill .up-avatar img { width:100%; height:100%; object-fit:cover; }
.user-pill .up-email { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.user-pill .up-change { font-size: 12px; color: var(--accent); font-weight: 700; cursor: pointer; margin-left: 4px; }
.user-pill .up-change:hover { text-decoration: underline; }

footer.auth-footer { text-align:center; padding: 24px 20px 32px; color: var(--text-tertiary); font-size: 12px; position: relative; z-index: 5; }
footer.auth-footer a { color: var(--text-tertiary); text-decoration:none; margin: 0 8px; }
footer.auth-footer a:hover { color: var(--text-secondary); }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
/* =======================================================
   Desktop layout (≥900px)
=======================================================*/
@media (min-width: 900px) {
  .stage { padding: 48px 20px 80px; }

  .auth-card { max-width: 460px; }

  /* Toasts move bottom-right on desktop */
  .toast-wrap {
    left: auto; right: 32px; bottom: 32px;
    transform: none;
  }

  /* Sheets: centered dialogs, not bottom sheets */
  .pk-sheet, .code-sheet {
    align-items: center;
  }
  .pk-sheet-panel, .code-sheet-panel {
    border-radius: var(--radius-lg);
    max-width: 420px;
  }
  .pk-sheet:not(.show) .pk-sheet-panel,
  .code-sheet:not(.show) .code-sheet-panel {
    transform: scale(.96);
  }
  .pk-sheet.show .pk-sheet-panel,
  .code-sheet.show .code-sheet-panel {
    transform: scale(1);
  }

  /* Account switcher as centered dialog */
  #accountSwitcher {
    max-width: 460px;
  }
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }

@media (min-width: 900px) {
  /* Sheets become centered dialogs, not bottom sheets */
  .pk-sheet, .code-sheet,
  #accountSwitcherModal /* adjust selector to whatever wraps #accountSwitcher as a modal, if any */ {
    align-items: center;
  }
  .pk-sheet-panel, .code-sheet-panel {
    border-radius: var(--radius-lg);
    /* closed state: still governed by .show above (opacity/visibility) — panel itself needs no transform-based hide since parent handles it */
  }
  .pk-sheet:not(.show) .pk-sheet-panel,
  .code-sheet:not(.show) .code-sheet-panel {
    transform: translateY(0) scale(.96);
  }
  .pk-sheet.show .pk-sheet-panel,
  .code-sheet.show .code-sheet-panel {
    transform: translateY(0) scale(1);
  }
}
.top-bar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:16px 20px;
    background:var(--card-bg);
    border-bottom:1px solid var(--divider);
}

.top-actions{
    display:flex;
    align-items:center;
    gap:12px;
}

.theme-btn{
    width:40px;
    height:40px;
    border:none;
    border-radius:50%;
    background:var(--bg-color);
    color:var(--text-primary);
    cursor:pointer;
    font-size:18px;
    transition:.25s;
    box-shadow:var(--shadow-sm);
}

.theme-btn:hover{
    transform:scale(1.05);
}

.help-link{
    color:var(--accent);
    text-decoration:none;
}
html,
body,
*{
    transition:
        background-color .25s ease,
        color .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
}