/* Страницы входа и регистрации: фон, карточка, поля, кнопка, иллюстрация (app/templates/_auth_art.html).
   Подключается только на этих двух страницах; остальной сайт оформляет app.css. */

.auth-page {
  --auth-text: #1f2937;
  --auth-muted: #5b6b80;
  --auth-blue: #2f80ed;
  --auth-blue-btn: #1f6fe0;      /* белый текст на нём — контраст 4,8:1 */
  --auth-blue-deep: #1762cc;
  --auth-border: #dce4ed;
  --auth-field: #f7f9fc;
  --auth-danger: #b42318;
  color: var(--auth-text);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "Noto Sans",
    "Noto Sans Georgian", Arial, sans-serif;
  /* Светлая серо-голубая основа, два мягких световых пятна и едва заметные кольца в правом верхнем углу */
  background-color: #f3f6fa;
  background-image:
    radial-gradient(58rem 40rem at 86% 14%, rgba(47, 128, 237, 0.13), transparent 62%),
    radial-gradient(46rem 34rem at 4% 98%, rgba(88, 156, 255, 0.11), transparent 60%),
    radial-gradient(34rem 26rem at 52% 112%, rgba(23, 105, 210, 0.06), transparent 62%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900' fill='none' stroke='%232F80ED'%3E%3Ccircle cx='450' cy='450' r='449' stroke-opacity='.07'/%3E%3Ccircle cx='450' cy='450' r='340' stroke-opacity='.06'/%3E%3Ccircle cx='450' cy='450' r='232' stroke-opacity='.05'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
  background-repeat: no-repeat;
  background-position: 0 0, 0 0, 0 0, right -17rem top -19rem, 0 0;
  background-attachment: fixed;
}
.auth-page > header { background: transparent; border-bottom-color: transparent; }
.auth-page > main { display: flex; align-items: center; padding-block: clamp(1rem, 4vh, 3rem); }
.auth-page { overflow-x: clip; }  /* тени и свечение иллюстрации не должны давать горизонтальную прокрутку */
.auth-page #site-footer { border-top-color: rgba(148, 163, 184, 0.28); margin-top: 0; }

/* ---------- две колонки: форма слева, иллюстрация справа ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 27.500rem) minmax(0, 1fr); align-items: center;
  gap: clamp(2rem, 6vw, 6.500rem); width: 100%; }
.auth-form-col { min-width: 0; }
.auth-art-col { min-width: 0; display: flex; flex-direction: column; align-items: center; position: relative; }
/* точечная сетка за иллюстрацией, растворяется к краям */
.auth-art-col::before { content: ""; position: absolute; inset: -3% 0; pointer-events: none;
  background-image: radial-gradient(rgba(23, 105, 210, 0.17) 1px, transparent 1.300px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(closest-side, #000 22%, transparent 78%);
  mask-image: radial-gradient(closest-side, #000 22%, transparent 78%); }

/* ---------- карточка ---------- */
.auth-card { background: #fff; border: 1px solid #e3eaf2; border-radius: 1.375rem;
  padding: clamp(1.500rem, 4vw, 2.500rem);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 14px 32px -10px rgba(23, 105, 210, 0.14),
    0 36px 72px -28px rgba(15, 23, 42, 0.16); }
.auth-mark { width: 2.750rem; height: 2.750rem; border-radius: 0.875rem; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #4b97f5 0%, #1762cc 100%);
  box-shadow: 0 8px 18px -6px rgba(23, 105, 210, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.auth-title { font-size: clamp(1.625rem, 2.200vw, 1.875rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em;
  color: #111827; margin-top: 1.250rem; text-wrap: balance; }
.auth-subtitle { color: var(--auth-muted); font-size: 0.9375rem; line-height: 1.5; margin-top: 0.375rem; }

/* ---------- сообщение об ошибке ---------- */
.auth-alert { display: flex; align-items: flex-start; gap: 0.625rem; margin-top: 1.250rem; padding: 0.750rem 0.875rem;
  border-radius: 0.750rem; background: #fef3f2; border: 1px solid #fecdca; color: var(--auth-danger);
  font-size: 0.9063rem; line-height: 1.45; font-weight: 500; }
.auth-alert svg { flex: none; margin-top: 0.0625rem; }
.auth-note { margin-top: 1.250rem; padding: 0.750rem 0.875rem; border-radius: 0.750rem; background: #f1f5f9;
  border: 1px solid #e2e8f0; color: #334155; font-size: 0.9063rem; line-height: 1.45; }

/* ---------- поля ---------- */
.auth-form { margin-top: 1.500rem; display: grid; gap: 1.125rem; }
.auth-label { display: block; font-size: 0.875rem; font-weight: 600; color: #334155; margin-bottom: 0.375rem; }
.auth-hint { display: block; font-size: 0.8125rem; color: var(--auth-muted); margin-top: 0.375rem; }
.auth-input-wrap { position: relative; }
.auth-input-icon { position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%); color: #8795a8;
  pointer-events: none; transition: color 0.18s ease; }
.auth-input { display: block; width: 100%; height: 3rem; border-radius: 0.750rem; border: 1px solid var(--auth-border);
  background: var(--auth-field); padding: 0 0.875rem 0 2.750rem; font-size: 1rem; color: #111827;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease; }
.auth-input.no-icon { padding-left: 0.875rem; }
.auth-input.has-toggle { padding-right: 3rem; }
.auth-input::placeholder { color: #9aa7b8; }
.auth-input:hover { border-color: #c5d1df; }
.auth-input:focus { outline: none; background: #fff; border-color: var(--auth-blue);
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.16); }
.auth-input-wrap:focus-within .auth-input-icon { color: var(--auth-blue-deep); }
.auth-input[aria-invalid="true"] { border-color: #f2a59c; background: #fffbfa; }
.auth-input[aria-invalid="true"]:focus { border-color: #d92d20; box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.14); }
.auth-toggle { position: absolute; right: 0.250rem; top: 50%; transform: translateY(-50%); width: 2.750rem; height: 2.750rem;
  display: grid; place-items: center; border-radius: 0.625rem; color: #6b7a90; cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease; }
.auth-toggle:hover { color: #1f2937; background: #edf2f8; }
.auth-toggle:focus-visible { outline: 2px solid var(--auth-blue); outline-offset: 1px; }
.auth-toggle .icon-hide, .auth-toggle[aria-pressed="true"] .icon-show { display: none; }
.auth-toggle[aria-pressed="true"] .icon-hide { display: block; }

/* ---------- кнопка ---------- */
.auth-submit { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.625rem;
  width: 100%; height: 3rem; margin-top: 0.250rem; border-radius: 0.750rem; color: #fff; font-size: 1rem;
  font-weight: 600; letter-spacing: 0.005em; cursor: pointer; touch-action: manipulation;
  background: linear-gradient(180deg, var(--auth-blue-btn) 0%, var(--auth-blue-deep) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 1px 2px rgba(15, 52, 110, 0.28),
    0 10px 22px -8px rgba(23, 98, 204, 0.6);
  transition: filter 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease; }
.auth-submit:hover { filter: brightness(1.07); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset,
  0 1px 2px rgba(15, 52, 110, 0.28), 0 14px 26px -8px rgba(23, 98, 204, 0.68); }
.auth-submit:active { transform: translateY(1px); filter: brightness(0.96);
  box-shadow: 0 1px 2px rgba(15, 52, 110, 0.3), 0 4px 10px -6px rgba(23, 98, 204, 0.6); }
.auth-submit:focus-visible { outline: 3px solid rgba(47, 128, 237, 0.45); outline-offset: 2px; }
.auth-submit[aria-disabled="true"], .auth-submit:disabled { cursor: progress; filter: saturate(0.85) brightness(0.98);
  box-shadow: none; }
.auth-spinner { display: none; width: 1.125rem; height: 1.125rem; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; }
.auth-submit.is-loading .auth-spinner { display: block; animation: auth-spin 0.75s linear infinite; }

.auth-alt { margin-top: 1.500rem; padding-top: 1.250rem; border-top: 1px solid #edf1f6; text-align: center;
  font-size: 0.9375rem; color: var(--auth-muted); }
.auth-link { color: var(--auth-blue-deep); font-weight: 600; text-decoration: none; border-radius: 0.250rem;
  background-image: linear-gradient(currentColor, currentColor); background-size: 100% 1px;
  background-position: 0 100%; background-repeat: no-repeat; padding-bottom: 1px; transition: color 0.15s ease; }
.auth-link:hover { color: #0f4fa8; background-size: 100% 2px; }
.auth-link:focus-visible { outline: 2px solid var(--auth-blue); outline-offset: 3px; }

/* ---------- иллюстрация и плашки вокруг неё ---------- */
/* ширина ограничена и высотой окна: на невысоком экране рисунок с подписью помещается целиком */
.auth-art { position: relative; width: min(100%, 41.250rem, max(22rem, (100vh - 16.500rem) * 1.03));
  aspect-ratio: 620 / 600; }
.auth-art-svg { display: block; width: 100%; height: 100%; }
.auth-chip { position: absolute; display: flex; align-items: center; gap: 0.625rem; padding: 0.625rem 0.875rem 0.625rem 0.625rem;
  border-radius: 0.875rem; background: rgba(255, 255, 255, 0.86); border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 14px 28px -10px rgba(23, 60, 120, 0.28);
  -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3);
  font-size: 0.8125rem; font-weight: 600; color: #1f2937; white-space: nowrap; }
.auth-chip-icon { width: 1.875rem; height: 1.875rem; border-radius: 0.625rem; display: grid; place-items: center; flex: none; }
.auth-chip-ok { right: 1%; top: 13%; }
.auth-chip-ok .auth-chip-icon { background: #e7f8ef; color: #12925a; }
.auth-chip-work { left: 0; top: 81%; }
.auth-chip-work .auth-chip-icon { background: #e8f1fe; color: var(--auth-blue-deep); }
.auth-chip-sub { display: block; font-weight: 500; color: var(--auth-muted); font-size: 0.750rem; margin-top: 0.125rem; }
.auth-progress { display: block; width: 6.500rem; height: 0.3125rem; border-radius: 999px; background: #dfe8f3; margin-top: 0.4375rem;
  overflow: hidden; }
.auth-progress > i { display: block; height: 100%; width: 68%; border-radius: inherit;
  background: linear-gradient(90deg, #5aa2f5, #1762cc); transform-origin: left center; }

.auth-caption { max-width: 26rem; text-align: center; margin-top: 0.250rem; position: relative; }
.auth-caption-title { font-size: 1.125rem; font-weight: 700; color: #1f2937; letter-spacing: -0.005em; }
.auth-caption-text { font-size: 0.9375rem; line-height: 1.55; color: #55657a; margin-top: 0.375rem; text-wrap: balance; }

/* ---------- планшет и телефон ---------- */
@media (max-width: 1099px) {
  .auth { gap: 2rem; grid-template-columns: minmax(0, 25rem) minmax(0, 1fr); }
  .auth-chip { font-size: 0.750rem; padding: 0.500rem 0.750rem 0.500rem 0.500rem; }
  .auth-progress { width: 5rem; }
}
@media (max-width: 899px) {
  .auth { grid-template-columns: minmax(0, 27.500rem); justify-content: center; }
  .auth-art-col { display: none; }   /* на узком экране важнее форма: иллюстрацию не показываем */
  .auth-page > main { align-items: flex-start; }
}
@media (max-width: 480px) {
  .auth-card { border-radius: 1.125rem; }
}

/* ---------- движение: только если человек его не отключил ---------- */
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  @keyframes auth-float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -9px, 0); } }
  @keyframes auth-float-chip { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, 6px, 0); } }
  @keyframes auth-rise { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
  @keyframes auth-progress { 0% { transform: scaleX(0.3); } 60%, 100% { transform: scaleX(1); } }
  .auth-card { animation: auth-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .auth-art-svg { animation: auth-float 9s ease-in-out infinite; will-change: transform; }
  .auth-chip { animation: auth-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both, auth-float-chip 7s ease-in-out 0.9s infinite; }
  .auth-chip-ok { animation-delay: 0.35s, 1.200s; }
  .auth-chip-work { animation-delay: 0.6s, 1.500s; }
  .auth-progress > i { animation: auth-progress 3.200s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-submit.is-loading .auth-spinner { animation-duration: 1.600s; }
  .auth-input, .auth-submit, .auth-toggle, .auth-link { transition: none; }
}
