/* Вход и страницы ошибок нового вида (templates/fabriq/auth_base.html, error_base.html) — из макетов docs/design/screens/auth */
.fq-auth-art { justify-content: space-between; }
  /* Фон не перерисовывает соседей и не вылезает за панель; слои картинки двигаются целиком на видеокарте. */
  .art-bg { overflow: hidden; contain: paint; }
  .art-bg .art-layer { position: absolute; right: -4%; bottom: -2%; width: min(64%, 980px); height: auto; will-change: transform; backface-visibility: hidden; }
  .art-bg::before { content: ""; position: absolute; inset: 0; background:
      radial-gradient(circle at 70% 60%, rgba(43,136,176,.26), transparent 55%),
      repeating-linear-gradient(45deg, rgba(255,255,255,.022) 0 1px, transparent 1px 8px),
      repeating-linear-gradient(-45deg, rgba(255,255,255,.018) 0 1px, transparent 1px 8px); }
  /* Фото (_auth_photo.html) — самым нижним слоем; сверху свечение, затемнение под текст, полосы и знак. */
  .art-bg .art-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 35%; }
  .art-bg::before, .art-bg::after { z-index: 1; }
  .art-bg::after { content: ""; position: absolute; inset: 0; background:
      linear-gradient(90deg, #0B1220 0%, rgba(11,18,32,.9) 32%, rgba(11,18,32,.5) 66%, rgba(11,18,32,.3) 100%),
      linear-gradient(0deg, #0B1220 0%, rgba(11,18,32,0) 42%); }
  .art-bg .art-layer { z-index: 2; }
  .art-bg .art-mark { animation: drift 16s ease-in-out infinite alternate; }
  .art-bg .art-bands { animation: drift 21s ease-in-out infinite alternate; }
  @keyframes drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-14px, 8px, 0); } }
  @media (prefers-reduced-motion: reduce) { .art-bg .art-layer { animation: none; } }
  .art-top { display: flex; align-items: center; gap: 12px; }
  .art-top img { height: 46px; }
  .art-copy { max-width: 470px; }
  .art-copy h2 { font: 800 38px/1.1 var(--fq-display); color: #F6F1E6; letter-spacing: -.03em; }
  .art-copy h2 em { font-style: normal; color: #E2C68E; }
  .art-copy p { color: #A9B2C2; margin-top: 14px; font-size: 15px; }
  .art-points { display: grid; gap: 12px; margin-top: 26px; }
  .art-points div { display: flex; gap: 12px; align-items: center; color: #D6DCE6; font-size: 14px; }
  .art-points .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: #D9B979; flex-shrink: 0; }
  .art-foot { color: #6F7A8D; font-size: 12.5px; display: flex; gap: 18px; }
  .auth-logo { height: 54px; margin-bottom: 24px; }
  .auth-form { display: grid; gap: 16px; margin-top: 26px; }
  .auth-form .fq-input { height: 48px; font-size: 15px; border-radius: 11px; }
  .auth-form .fq-btn { height: 50px; font-size: 15.5px; border-radius: 12px; }
  .pw { position: relative; } .pw .fq-iconbtn { position: absolute; right: 8px; top: 8px; }
  .alt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
  .alt a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; }
  .alt a:hover { border-color: var(--accent-line); color: var(--text); }
  .alt a .fq-i { color: var(--accent-ink); }
  .alt a small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
  .or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; margin-top: 24px; }
  .or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
  .auth-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 34px; color: var(--faint); font-size: 12.5px; }
.art-top .tag { padding: 4px 10px; border-radius: 8px; background: rgba(201,168,106,.14); color: #E2C68E; font-size: 12.5px; font-weight: 600; }
.auth-badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 6px 10px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; }
.auth-badge .fq-i { width: 15px; height: 15px; }

/* ПИН */
.who { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 10px 12px; border-radius: 12px; background: var(--surface-3); font-size: 14px; }
.who b { font-variant-numeric: tabular-nums; }
.who a { margin-left: auto; font-size: 13px; font-weight: 600; }
.pin { display: flex; justify-content: center; gap: 16px; margin: 22px 0 6px; }
.pin span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); }
.pin span.on { background: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .pin span.on { background: var(--accent); border-color: var(--accent); }
.pin-l { text-align: center; color: var(--muted); font-size: 13.5px; }
.fq-keypad { margin-top: 20px; }
.fq-keypad .fq-i { width: 26px; height: 26px; }

/* Живые формы: ошибка, загрузка, Caps Lock */
.auth-error { margin-top: 18px; animation: auth-shake .38s var(--ease) both; }
@keyframes auth-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.auth-caps { display: none; margin-top: 6px; font-size: 12.5px; color: var(--warn-tx); align-items: center; gap: 6px; }
.auth-caps.is-on { display: flex; }
.auth-form .fq-btn.is-busy { pointer-events: none; opacity: .8; }
.auth-form .fq-btn.is-busy .fq-i { animation: auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-form select.fq-input { appearance: none; padding-right: 36px; }
.pin span { transition: background .15s, border-color .15s, transform .15s; }
.pin span.on { transform: scale(1.08); }
.pin.is-bad span { border-color: var(--money-out); animation: auth-shake .38s var(--ease) both; }
.who a { cursor: pointer; }
.pin-code { text-align: center; font: 700 30px/1 var(--fq-display); letter-spacing: .18em; min-height: 40px; margin-top: 22px; font-variant-numeric: tabular-nums; }
.pin-code:empty::before { content: "· · · ·"; color: var(--faint); letter-spacing: .1em; }
.fq-keypad button { user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.fq-keypad .is-ok { display: flex; align-items: center; justify-content: center; }
.fq-keypad .is-ok:disabled { opacity: .45; }

/* Планшет и телефон: картинка — компактной шапкой, форма — на весь экран */
@media (max-width: 1023px) {
  .art-copy h2 { font-size: 24px; } .art-points, .art-foot, .art-copy p { display: none; }
  .art-bg .art-layer { width: 62%; right: -22%; bottom: -26%; opacity: .5; }
  .auth-logo { display: none; }
}
@media (max-width: 767px) {
  .fq-auth { min-height: 100dvh; }
  .fq-auth-art { min-height: 0; padding: calc(16px + env(safe-area-inset-top)) 18px 18px; gap: 14px; }
  .art-copy h2 { font-size: 20px; line-height: 1.2; }
  .art-top img { height: 34px; }
  .art-top .tag { display: inline-block; }
  .fq-auth-form { align-items: flex-start; padding: 22px 18px calc(28px + env(safe-area-inset-bottom)); }
  .fq-auth-card h1 { font-size: 24px; }
  .auth-badge { display: none; }
  .auth-form { gap: 14px; margin-top: 20px; }
  .auth-form .fq-input { height: 52px; font-size: 16px; }
  .auth-form .fq-btn { height: 54px; font-size: 16px; }
  .alt { grid-template-columns: 1fr; }
  .alt a { padding: 14px; }
  .fq-keypad { gap: 12px; }
  .fq-keypad button, .fq-keypad .is-ok { height: 68px; }
  .auth-bottom { margin-top: 26px; }
}

/* Страницы ошибок */
.e404 { min-height: 100vh; display: flex; flex-direction: column; background:
      radial-gradient(circle at 50% 38%, var(--accent-soft), transparent 46%), var(--bg); }
  .e-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; }
  .e-top img { height: 44px; }
  .e-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px 20px 48px; }
  .art-wrap { position: relative; width: min(560px, 100%); }
  .art { width: min(560px, 100%); height: auto; display: block; }
  .art-wrap .art { width: 100%; }
  .art-wrap .art.fall { position: absolute; inset: 0; height: 100%; pointer-events: none; will-change: transform; }
  .art .big { font: 800 236px/1 var(--fq-display); letter-spacing: -.04em; fill: var(--line); }
  .art .ghost { fill: none; stroke: var(--accent-line); stroke-width: 5; stroke-dasharray: 14 12; }
  .art .thread { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-dasharray: 3 7; stroke-linecap: round; }
  .art .shadow { fill: var(--line-strong); opacity: .35; }
  .art.fall { animation: wobble 5s ease-in-out infinite; transform-origin: 75.33% 88.89%; }
  @keyframes wobble { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-3deg); } }
  .e-body h1 { font: 800 34px/1.15 var(--fq-display); letter-spacing: -.025em; margin-top: 6px; }
  .e-body p { color: var(--muted); font-size: 15px; max-width: 470px; margin-top: 10px; }
  .e-body p b { color: var(--text-2); font-weight: 600; }
  .e-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
  .e-acts .fq-btn { height: 48px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
  .e-acts kbd { font: 600 11px var(--fq-mono); padding: 2px 6px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line); color: var(--muted); }
  .e-foot { color: var(--faint); font-size: 12.5px; margin-top: 22px; }
  @media (max-width: 767px) { .e-top { padding: 16px; } .e-body h1 { font-size: 26px; } .e-acts { width: 100%; } .e-acts .fq-btn { flex: 1 1 100%; } }
@media (prefers-reduced-motion: reduce) { .art.fall { animation: none; } }
