/* Auth pages (login, signup, recovery, verification) — ported from ogboost frontend/static/css/auth.css:
   brand stage + borderless form shell, white submit, lime focus, 2-column social buttons. */
:root {
  --auth-bg: #121212;
  --auth-field: #121212;
  --auth-border: rgb(var(--ink-rgb) / .16);
  --auth-border-strong: rgb(var(--ink-rgb) / .32);
  --auth-text: #fff;
  --auth-muted: #a1a1aa;
  --auth-soft: #e4e4e7;
  --auth-danger: #fb7185;
  --auth-ok: #4ade80;
  --auth-accent: #d4ff00;
  --auth-submit-bg: #fff;
  --auth-submit-ink: #0a0a0c;
  --auth-submit-hover: #eaecef;
  --auth-radius: 14px;
  --auth-ease: cubic-bezier(.22, 1, .36, 1);
}

.auth-body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--auth-bg); color: var(--auth-text); font-family: "Outfit", system-ui, sans-serif; overflow-x: hidden; }
html[dir="rtl"] .auth-body { font-family: "Cairo", "Outfit", system-ui, sans-serif; }
.auth-layout { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, 1.08fr) minmax(360px, .92fr); }

/* Brand stage */
.auth-stage { position: relative; overflow: hidden; isolation: isolate; }
.auth-stage-watermark { position: absolute; right: -6%; bottom: -10%; z-index: 0; margin: 0; font-family: "Outfit", sans-serif; font-size: clamp(11rem, 24vw, 19rem); font-weight: 800; letter-spacing: -.08em; line-height: .78; color: transparent; -webkit-text-stroke: 1px rgb(var(--ink-rgb) / .055); user-select: none; pointer-events: none; transform: rotate(-10deg); }
.auth-constellation { position: absolute; right: -6%; top: 50%; z-index: 0; width: min(70%, 440px); color: rgb(var(--ink-rgb) / .7); transform: translateY(-50%); opacity: .5; pointer-events: none; }
.auth-constellation-lines path { stroke-dasharray: 7 11; animation: auth-dash 20s linear infinite; }
.auth-constellation-lines path:nth-child(odd) { animation-duration: 26s; animation-direction: reverse; }
.auth-node { opacity: .5; }
.auth-node-core { opacity: 1; transform-box: fill-box; transform-origin: center; animation: auth-core 3.4s ease-in-out infinite; }
.auth-stage-inner { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; padding: clamp(2rem, 5vw, 3.5rem); animation: auth-rise .9s var(--auth-ease) both; }
.auth-logo { display: inline-flex; align-items: center; gap: .6rem; width: fit-content; font-size: clamp(1.35rem, 2vw, 1.6rem); font-weight: 700; letter-spacing: -.03em; color: var(--auth-text); line-height: 1; border-bottom: 2px solid rgb(var(--ink-rgb) / .22); padding-bottom: .45rem; transition: border-color .2s ease; }
.auth-logo:hover { color: var(--auth-text); border-bottom-color: var(--auth-text); }
.auth-logo-img { width: 44px; height: 44px; border-radius: 11px; display: block; flex: none; }
.auth-stage-body { max-width: 440px; margin: auto 0; }
.auth-stage-kicker { margin: 0 0 .9rem; font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #8f8f98; }
.auth-stage-headline { margin: 0 0 1.1rem; font-size: clamp(2.15rem, 3.6vw, 3rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.1; color: var(--auth-text); max-width: 14ch; }
.auth-stage-copy { margin: 0 0 1.5rem; max-width: 36ch; color: #9a9aa3; font-size: 1.02rem; line-height: 1.55; }
.auth-orbit { display: flex; flex-wrap: wrap; gap: .5rem; }
.auth-orbit .cat-logo { width: 2.55rem; height: 2.55rem; border-radius: 999px; border: 0; background: rgb(var(--ink-rgb) / .06); transition: background .2s ease, transform .2s var(--auth-ease); }
.auth-orbit .cat-logo:hover { background: rgb(var(--ink-rgb) / .1); transform: translateY(-2px); }
.auth-stage-foot { margin: 0; color: #6f6f78; font-size: .8rem; font-weight: 500; }
html[dir="rtl"] .auth-stage-kicker { letter-spacing: 0; font-size: .85rem; }
html[dir="rtl"] .auth-stage-headline, html[dir="rtl"] .auth-title { letter-spacing: 0; line-height: 1.3; }

/* Form shell */
.auth-shell { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(1.5rem, 4vw, 3rem); }
.auth-panel, .auth-panel-lang, .auth-shell .flash-stack { width: min(100%, 420px); }
.auth-panel { animation: auth-rise .85s var(--auth-ease) .08s both; }
.auth-panel-lang { display: flex; justify-content: flex-start; margin: 0 0 1rem; }
.auth-panel-head { margin-bottom: 1.5rem; text-align: start; }
.auth-panel-logo { display: none; }
.auth-title { margin: 0 0 .4rem; font-size: clamp(1.7rem, 2.6vw, 2rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--auth-text); }
.auth-subtitle { margin: 0; color: var(--auth-muted); font-size: .92rem; line-height: 1.5; }
.auth-form { width: 100%; }
.auth-group { margin-bottom: 1rem; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.auth-label { display: block; margin-bottom: .5rem; color: var(--auth-soft); font-size: .84rem; font-weight: 600; }
.auth-link { color: var(--auth-muted); font-size: .85rem; font-weight: 500; transition: color .2s ease; }
.auth-link:hover { color: var(--auth-text); }
.auth-field { position: relative; }
.auth-field-icon { position: absolute; inset-inline-start: .95rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--auth-muted); pointer-events: none; z-index: 2; transition: color .2s ease; }
.auth-field:focus-within .auth-field-icon { color: var(--auth-text); }
.auth-field-toggle { position: absolute; inset-inline-end: .55rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--auth-muted); width: 2.1rem; height: 2.1rem; border-radius: 50%; display: inline-grid; place-items: center; z-index: 2; cursor: pointer; transition: color .2s ease, background .2s ease; }
.auth-field-toggle:hover { color: var(--auth-text); background: rgb(var(--ink-rgb) / .05); }
.auth-input { width: 100%; appearance: none; background: var(--auth-field); border: 1px solid var(--auth-border); border-radius: var(--auth-radius); color: var(--auth-text); font: inherit; font-size: .95rem; font-weight: 500; line-height: 1.4; padding: .95rem 2.7rem; box-shadow: none; transition: border-color .2s ease, box-shadow .2s ease; }
.auth-input::placeholder { color: #71717a; font-weight: 400; }
.auth-input:hover { border-color: var(--auth-border-strong); }
.auth-input:focus { outline: none; border-color: var(--auth-accent); box-shadow: 0 0 16px rgb(var(--accent-rgb) / .15); }
.auth-input:-webkit-autofill, .auth-input:-webkit-autofill:hover, .auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--auth-field) inset; -webkit-text-fill-color: var(--auth-text); caret-color: var(--auth-text); transition: background-color 5000s ease-in-out 0s;
}
.auth-hint { display: block; margin-top: .45rem; color: var(--auth-muted); font-size: .78rem; }
.auth-hint.ok { color: var(--auth-ok); }
.auth-hint.bad { color: var(--auth-danger); }
.auth-form .caps-hint { display: block; margin-top: .45rem; }
.auth-form .strength { margin-top: .55rem; }
.auth-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }

.auth-check { display: inline-flex; align-items: center; gap: .65rem; margin: .25rem 0 0; color: var(--auth-muted); font-size: .88rem; font-weight: 500; cursor: pointer; user-select: none; transition: color .2s ease; }
.auth-check:hover { color: var(--auth-text); }
.auth-check input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 19px; height: 19px; min-width: 19px; margin: 0; border-radius: 6px; background: rgb(var(--ink-rgb) / .05); border: 1.5px solid rgb(var(--ink-rgb) / .22); display: inline-grid; place-content: center; cursor: pointer; transition: all .2s cubic-bezier(.16, 1, .3, 1); }
.auth-check input[type="checkbox"]::before { content: ""; width: 9px; height: 9px; transform: scale(0); transition: 120ms transform ease-in-out; box-shadow: inset 1em 1em var(--auth-bg); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
.auth-check input[type="checkbox"]:hover { border-color: rgb(var(--ink-rgb) / .45); background: rgb(var(--ink-rgb) / .08); }
.auth-check input[type="checkbox"]:checked { background: #fff; border-color: var(--auth-text); box-shadow: 0 0 14px rgb(var(--ink-rgb) / .35); }
.auth-check input[type="checkbox"]:checked::before { transform: scale(1); }
.auth-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--auth-text); outline-offset: 2px; }

.auth-submit { position: relative; display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; overflow: hidden; border: 1px solid rgb(var(--ink-rgb) / .22); border-radius: var(--auth-radius); background: var(--auth-submit-bg); color: var(--auth-submit-ink); font: inherit; font-size: .98rem; font-weight: 700; letter-spacing: -.015em; padding: .95rem 1.25rem; margin-top: 1.35rem; cursor: pointer; box-shadow: 0 4px 20px rgb(var(--ink-rgb) / .12); transition: transform .2s var(--auth-ease), background .2s ease, box-shadow .2s ease; }
.auth-submit::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 20%, rgb(var(--ink-rgb) / .5) 45%, transparent 70%); transform: translateX(-120%); transition: transform .55s var(--auth-ease); }
.auth-submit:hover { background: var(--auth-submit-hover); box-shadow: 0 6px 28px rgb(var(--ink-rgb) / .22); transform: translateY(-1px); }
.auth-submit:hover::after { transform: translateX(120%); }
.auth-submit:active { transform: scale(.985); }
.auth-submit:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 3px; }

.auth-footer { margin: 1.35rem 0 0; text-align: center; color: var(--auth-muted); font-size: .9rem; }
.auth-footer a, .auth-footer .link-btn { color: var(--auth-text); font-weight: 700; position: relative; }
.auth-footer a::after { content: ""; position: absolute; inset-inline: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: inline-start; transition: transform .25s var(--auth-ease); }
.auth-footer a:hover::after { transform: scaleX(1); }

/* Social sign-in */
.auth-social { margin-top: 1.35rem; }
.auth-social-divider { display: flex; align-items: center; gap: .75rem; margin: 0 0 .95rem; color: var(--auth-muted); font-size: .8rem; }
.auth-social-divider::before, .auth-social-divider::after { content: ""; flex: 1; height: 1px; background: var(--auth-border); }
.auth-social-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.auth-social-row > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.auth-social-btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 48px; width: 100%; padding: .65rem .85rem; border-radius: var(--auth-radius); border: 1px solid var(--auth-border); background: var(--auth-field); color: var(--auth-text); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s var(--auth-ease); }
.auth-social-btn:hover { border-color: var(--auth-border-strong); color: var(--auth-text); transform: translateY(-1px); }
.auth-social-btn:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 2px; }
.auth-social-btn:disabled { opacity: .6; cursor: progress; transform: none; }
.auth-social-btn svg { flex: none; }
.auth-social-btn--discord svg { color: #5865f2; }
.auth-social-btn--telegram svg { color: #229ed9; }
.auth-social-row + .auth-social-row { margin-top: .65rem; }
.auth-social-btn--passkey svg, .auth-social-btn--email svg { color: var(--auth-accent); }
.auth-social-btn--email { border-color: rgb(var(--accent-rgb) / .22); background: rgb(var(--accent-rgb) / .04); }
.auth-social-btn--email:hover { border-color: rgb(var(--accent-rgb) / .45); }

/* Flash messages in the auth shell */
.auth-shell .flash-stack { margin: 0 0 .85rem; animation: auth-rise .6s var(--auth-ease) both; }
.auth-shell .flash { border-radius: 12px; border: 1px solid var(--auth-border); background: rgb(var(--panel-rgb) / .95); color: var(--auth-soft); padding: .8rem .95rem; font-size: .86rem; font-weight: 500; }
.auth-shell .flash-error { border-color: rgba(251, 113, 133, .35); color: #fecdd3; }
.auth-shell .flash-success { border-color: rgba(74, 222, 128, .35); color: #bbf7d0; }
.auth-shell .flash-warning { border-color: rgba(251, 191, 36, .35); color: #fde68a; }
.auth-shell .flash-info { border-color: rgb(var(--accent-rgb) / .25); background: rgb(var(--accent-rgb) / .05); color: #e4e4e7; }
.auth-shell .notice { margin: 0 0 1rem; }

@keyframes auth-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-dash { to { stroke-dashoffset: -240; } }
@keyframes auth-core { 0%, 100% { opacity: 1; r: 10; } 50% { opacity: .75; r: 12; } }

@media (max-width: 960px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-stage { display: none; }
  .auth-shell { min-height: 100vh; min-height: 100dvh; align-items: stretch; padding: 1.75rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom, 0px)); }
  .auth-panel, .auth-panel-lang, .auth-shell .flash-stack { width: 100%; max-width: 400px; margin-inline: auto; }
  .auth-panel-lang { justify-content: center; margin-bottom: 1.15rem; }
  .auth-panel-head { text-align: center; }
  .auth-panel-logo { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; margin: 0 auto 1.35rem; font-size: 1.35rem; font-weight: 700; letter-spacing: -.03em; color: var(--auth-text); line-height: 1; }
  .auth-panel-logo .auth-logo-img { width: 41px; height: 41px; border-radius: 9px; }
  .auth-title { font-size: 1.55rem; font-weight: 600; }
  .auth-subtitle { margin: .4rem 0 0; font-size: .9rem; color: #8b8b93; }
  .auth-input { font-size: 16px; min-height: 48px; padding: .85rem 2.7rem; }
  .auth-field-toggle { width: 44px; height: 44px; }
  .auth-submit { min-height: 44px; font-size: .92rem; margin-top: 1.1rem; padding: .7rem 1rem; }
  .auth-check { min-height: 44px; }
  .auth-footer a, .auth-footer .link-btn { display: inline-flex; align-items: center; min-height: 44px; padding-inline: .15rem; }
}
@media (max-width: 520px) {
  .auth-grid-2 { grid-template-columns: 1fr; gap: 0; }
  .auth-shell { padding-inline: 1.15rem; }
}

/* Arabic keeps the brand | form column order; only text and icons mirror */
html[dir="rtl"] .auth-layout { direction: ltr; }
html[dir="rtl"] .auth-stage, html[dir="rtl"] .auth-shell { direction: rtl; }
html[dir="rtl"] .auth-stage-watermark { right: auto; left: -6%; transform: rotate(10deg); }
html[dir="rtl"] .auth-constellation { right: auto; left: -6%; }

@media (prefers-reduced-motion: reduce) {
  .auth-panel, .auth-stage-inner, .auth-shell .flash-stack, .auth-constellation-lines path, .auth-node-core { animation: none !important; }
  .auth-submit::after { display: none; }
}
.auth-group-top { margin-top: 1rem; }

/* Saved accounts, username suggestion, password checklist, referral disclosure (ported from ogboost login/signup) */
.auth-panel-lang .dd-menu { inset-inline: 0 auto; }
.saved-accounts { margin: 0 0 1.1rem; padding: .7rem; border: 1px solid var(--auth-border); border-radius: var(--auth-radius); background: rgb(var(--ink-rgb) / .02); }
.saved-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 .15rem .45rem; color: var(--auth-muted); font-size: .8rem; font-weight: 600; }
.saved-head span { display: inline-flex; align-items: center; gap: .4rem; }
.saved-head .link-btn { color: var(--auth-accent); font-size: .78rem; }
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.saved-list li { display: flex; align-items: center; gap: .35rem; }
.saved-pick { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border: 1px solid transparent; border-radius: 11px; background: none; color: var(--auth-soft); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-align: start; }
.saved-pick span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-pick .avatar { width: 30px; height: 30px; border-radius: 9px; font-size: .82rem; flex: none; }
.saved-pick:hover, .saved-pick:focus-visible { border-color: var(--auth-border); background: rgb(var(--ink-rgb) / .04); color: var(--auth-text); outline: none; }
.saved-remove { flex: none; width: 30px; height: 30px; border: 0; border-radius: 9px; background: none; color: var(--auth-muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.saved-remove:hover, .saved-remove:focus-visible { background: rgba(251, 113, 133, .1); color: var(--auth-danger); outline: none; }
.suggest-pill { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .5rem; padding: .2rem .55rem; border: 1px solid rgb(var(--accent-rgb) / .25); border-radius: 999px; background: rgb(var(--accent-rgb) / .06); color: var(--auth-soft); font: inherit; font-size: .74rem; cursor: pointer; }
.suggest-pill b { color: var(--auth-accent); font-weight: 700; }
.suggest-pill:hover { border-color: rgb(var(--accent-rgb) / .45); }
.pw-rules { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .75rem; color: var(--auth-muted); font-size: .78rem; }
.pw-rules li { display: flex; align-items: center; gap: .4rem; transition: color .2s ease; }
.pw-rules li .ic { opacity: .35; transition: opacity .2s ease, color .2s ease; }
.pw-rules li.ok { color: var(--auth-soft); }
.pw-rules li.ok .ic { opacity: 1; color: var(--auth-ok); }
.pw-strength-label:empty { display: none; }
.auth-referral { margin-top: 1rem; border: 1px solid var(--auth-border); border-radius: var(--auth-radius); background: rgb(var(--ink-rgb) / .02); }
.auth-referral > summary { display: flex; align-items: center; gap: .5rem; padding: .75rem .9rem; color: var(--auth-soft); font-size: .86rem; font-weight: 600; cursor: pointer; list-style: none; }
.auth-referral > summary::-webkit-details-marker { display: none; }
.auth-referral > summary .ic:first-child { color: var(--auth-accent); }
.auth-referral-chev { margin-inline-start: auto; opacity: .6; transition: transform .2s var(--auth-ease); }
.auth-referral[open] .auth-referral-chev { transform: rotate(180deg); }
.auth-referral .auth-group { margin: 0; padding: 0 .9rem .9rem; }
@media (max-width: 520px) { .pw-rules { grid-template-columns: 1fr; } }
html:lang(ru) .auth-body { font-family: "Manrope", system-ui, sans-serif; }
.auth-panel-lang { gap: .5rem; align-items: center; }

/* Direct token (ogboost direct_login.html / quick register) */
.auth-social-form { margin: 0; grid-column: 1 / -1; display: flex; }
.auth-social-form .auth-social-btn { width: 100%; }
.auth-social-btn--direct svg { color: var(--auth-soft); transition: color .2s ease; }
.auth-social-btn--direct:hover svg { color: var(--auth-accent); }
.direct-token-input { font-family: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace; font-size: .86rem; letter-spacing: .03em; padding-inline-end: 1rem; }
.direct-token-input::placeholder { font-family: inherit; font-size: .8rem; }
.auth-label-row .auth-paste-btn { margin-bottom: .5rem; }
.quick-success { text-align: center; }
.quick-success .auth-panel-head { text-align: center; }
.quick-success-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 20px; color: var(--auth-accent); background: rgb(var(--accent-rgb) / .08); border: 1px solid rgb(var(--accent-rgb) / .25); }
.quick-success .notice { text-align: start; margin: 1rem 0 0; }

/* Second sign-in step (/login/2fa, /login/2fa/recovery) */
.auth-inline-form { display: flex; justify-content: center; margin-top: .75rem; }
.auth-inline-form .link-btn { display: inline-flex; align-items: center; gap: .4rem; }
.auth-textarea { width: 100%; min-height: 6rem; padding: .8rem .95rem; border-radius: 14px; resize: vertical; line-height: 1.6; }
.seed-input { font-family: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace; font-size: .95rem; }
.auth-panel .otp-input { letter-spacing: .35em; font-weight: 700; text-align: center; }
.auth-hint .ic, .auth-footer .ic, .auth-inline-form .ic { display: inline-block; vertical-align: -2px; }
