/* Shared controls, authentication and the edge of the page. */
:root { --control-bg: #101012; --control-border: #ffffff15; }
[data-theme=light] { --control-bg: #f7f7fa; --control-border: #20202b1a; }
html { scrollbar-color: #5d5550 #111012; scrollbar-width: thin; scrollbar-gutter: stable; }
html::-webkit-scrollbar { width: 8px; height: 8px; }
html::-webkit-scrollbar-track { background: #111012; }
html::-webkit-scrollbar-thumb { border: 2px solid #111012; border-radius: 8px; background: #5d5550; }
html::-webkit-scrollbar-thumb:hover { background: #8c7567; }
[data-theme=light] { scrollbar-color: #b4a99f #f5f4f2; }
[data-theme=light]::-webkit-scrollbar-track { background: #f5f4f2; }
[data-theme=light]::-webkit-scrollbar-thumb { border-color: #f5f4f2; background: #b4a99f; }
body { min-width: 0; }
#app, main, section, .container, .narrow { min-width: 0; }
.faq-page { min-height: 100svh; }
.btn.is-pending { position: relative; }
.button-original { display: inline-flex; align-items: center; gap: inherit; visibility: hidden; }
.button-pending { position: absolute; inset: 0; display: inline-flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap; }
.button-spinner { width: 13px; height: 13px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-turn .7s linear infinite; }
@keyframes button-turn { to { transform: rotate(360deg); } }
.input { min-height: 50px; background: var(--control-bg); border-color: var(--control-border); font-size: 14px; line-height: 1.4; transition: border-color .2s, box-shadow .2s, background .2s; }
.input::placeholder { color: var(--muted); opacity: .65; }
.input:hover:not(:focus) { border-color: color-mix(in srgb, var(--text) 20%, transparent); }
.input:focus-visible { border-color: #d96a25; box-shadow: 0 0 0 3px #d6500014; }
.input:-webkit-autofill, .input:-webkit-autofill:hover, .input:-webkit-autofill:focus { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 1000px var(--control-bg) inset; caret-color: var(--text); }
.field > label, .field-label { font-size: 13px; color: var(--text); font-weight: 500; }
.password-wrap .input { padding-right: 54px; }
.password-eye { display: grid; place-items: center; top: 50%; right: 7px; width: 38px; height: 38px; transform: translateY(-50%); color: var(--muted); border-radius: 8px; }
.password-eye:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.password-eye[aria-pressed=true] { color: var(--accent); }
.field-feedback { display: block; margin: 7px 0 0; color: #e78873; font-size: 12px; line-height: 1.45; }
[data-theme=light] .field-feedback { color: #b9412c; }
.input[aria-invalid=true] { border-color: #bf614d; box-shadow: 0 0 0 3px #bf614d0b; }
.field-hint { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; margin: 8px 0 0; }
.checkbox-row { align-items: flex-start; gap: 12px; font-size: 12px; line-height: 1.55; }
.checkbox-row input[type=checkbox] { appearance: none; -webkit-appearance: none; position: relative; width: 20px; height: 20px; min-width: 20px; flex: 0 0 20px; margin: 1px 0 0; border: 1px solid color-mix(in srgb, var(--text) 24%, transparent); border-radius: 6px; background: var(--control-bg); cursor: pointer; transition: background .18s, border-color .18s, box-shadow .18s; }
.checkbox-row input[type=checkbox]::after { content: ''; position: absolute; inset: 3px; background: #fff; clip-path: polygon(10% 48%, 20% 38%, 41% 61%, 80% 18%, 91% 29%, 41% 82%); opacity: 0; transform: scale(.75); transition: opacity .15s, transform .18s; }
.checkbox-row input[type=checkbox]:checked { border-color: var(--accent); background: var(--accent); }
.checkbox-row input[type=checkbox]:checked::after { opacity: 1; transform: scale(1); }
.checkbox-row input[type=checkbox]:focus-visible { outline: 2px solid #e68b50; outline-offset: 3px; }
.checkbox-row input[type=checkbox][aria-invalid=true] { border-color: #d57d6c; box-shadow: 0 0 0 3px #d57d6c12; }
.checkbox-row a { color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--text) 25%, transparent); text-underline-offset: 3px; }
.checkbox-row a:hover { color: var(--accent); text-decoration-color: currentColor; }
.auth-form-side { background: var(--bg); }
.auth-form-wrap { width: min(420px, 100%); }
.auth-form-wrap > .eyebrow { margin-bottom: 17px; }
.auth-form-wrap > h1 { font-size: 43px; line-height: 1.1; letter-spacing: -.04em; }
.auth-form-wrap > p { margin-top: 17px; font-size: 14px; line-height: 1.6; }
.auth-form { margin-top: 34px; }
.auth-form .field { margin-bottom: 21px; }
.auth-form .checkbox-row { margin-top: 4px; }
.auth-form > .btn { min-height: 49px; margin-top: 20px; }
.auth-form > .form-error:empty { display: none; }
.auth-form > .form-error:not(:empty) { padding: 12px 14px; margin-top: 18px; border: 1px solid #c96b4e25; background: #c96b4e09; border-radius: 9px; font-size: 12px; }
.auth-divider { margin-top: 26px; font-size: 11px; }
.auth-switch { font-size: 13px; margin-top: 18px; }
.auth-help { margin-top: 23px; font-size: 12px; line-height: 1.6; }
.auth-home { font-size: 13px; gap: 10px; }
.auth-top-actions .icon-btn { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 50%; }
.header-actions .icon-btn, .mobile-nav a { touch-action: manipulation; }
@media (max-width: 900px) {
  .mobile-nav.open { padding: 32px 24px; gap: 0; background: var(--bg); }
  .mobile-nav.open > a { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 16px 2px; border-bottom: 1px solid var(--border); font-size: 24px; line-height: 1.2; letter-spacing: -.025em; }
  .mobile-nav.open > a.active { color: var(--text); }
  .mobile-nav.open > a.active::after { content: ''; width: 6px; height: 6px; flex-shrink: 0; margin-left: 18px; border-radius: 50%; background: var(--accent); }
  .mobile-nav.open > .text-link { margin-top: auto; padding: 24px 2px 10px; color: var(--muted); border: 0; font-size: 14px; letter-spacing: 0; }
}
@media (max-width: 600px) {
  .auth-form-side { padding: 110px 24px 45px; min-height: 100svh; }
  .auth-form-wrap { max-width: 420px; margin-inline: auto; }
  .auth-form-wrap > h1 { font-size: 36px; max-width: 340px; }
  .auth-form-wrap > p { font-size: 14px; margin-top: 15px; }
  .auth-form { margin-top: 29px; }
  .auth-home { top: 29px; left: 24px; }
  .auth-top-actions { top: 20px; right: 22px; }
  .input { font-size: 16px; min-height: 51px; }
  .auth-form .field { margin-bottom: 19px; }
  .checkbox-row { font-size: 12px; }
  .auth-form > .btn { margin-top: 19px; }
  .auth-switch { gap: 7px; flex-wrap: wrap; }
  .header-actions .icon-btn { min-width: 38px; min-height: 40px; }
  .toasts { width: calc(100% - 32px); max-width: 390px; right: 16px; bottom: 16px; }
  .toast { width: 100%; font-size: 13px; }
}
@media (max-width: 360px) {
  .auth-form-side { padding-inline: 20px; }
  .auth-form-wrap > h1 { font-size: 32px; }
  .auth-home { left: 20px; }
  .header-inner { width: calc(100% - 28px); gap: 9px; }
  .header .brand { font-size: 21px; gap: 8px; }
  .header-actions { gap: 3px; }
  .header-actions .btn { padding-inline: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .checkbox-row input[type=checkbox], .checkbox-row input[type=checkbox]::after, .input { transition: none; }
  .button-spinner { animation: none; }
}
