/* Окно входа и предупреждение о cookie: общие для главной, кабинета и документов. */

/* ---------- модальное окно ---------- */
.ov {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 16px 16px calc(16px + var(--ck-h, 0px));
  background: rgba(6, 6, 8, 0.58);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity 0.2s var(--ease-out);
}
.ov.is-open { opacity: 1; }
.ov-top { z-index: 1200; }
.dlg {
  position: relative; width: 100%; max-width: 400px; max-height: calc(100dvh - 32px - var(--ck-h, 0px)); overflow-y: auto; overscroll-behavior: contain; outline: none;
  padding: 26px 24px 22px; border-radius: 28px;
  background: #141416; border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 90px -24px rgba(0, 0, 0, 0.7);
  color: var(--cream); font-family: var(--sans);
  transform: translateY(10px) scale(0.98); transition: transform 0.28s var(--ease-out);
  scrollbar-width: none;
}
.dlg::-webkit-scrollbar { display: none; }
.ov.is-open .dlg { transform: none; }
.dlg-x {
  position: absolute; top: 14px; right: 14px; z-index: 1;
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.dlg-x:hover { background: var(--wash-3); color: var(--bone); }
.dlg-x.back { right: auto; left: 14px; }
.dlg-x svg { width: 20px; height: 20px; }
.dlg h2 { margin: 6px 34px 22px; text-align: center; text-wrap: balance; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.025em; }
.dlg-sub { margin: -12px 4px 20px; text-align: center; font-size: 14px; line-height: 1.5; color: var(--muted); }
.dlg-sub b { color: var(--cream); font-weight: 600; word-break: break-all; }

/* большие кнопки способов входа */
.ab {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 48px; padding: 0 16px; border: 0; border-radius: 12px;
  background: #242427; color: var(--bone); font: 600 15px/1 var(--sans); text-decoration: none;
  cursor: pointer; transition: background 0.15s, opacity 0.15s, transform 0.15s var(--ease-out);
}
.ab:hover { background: #2d2d31; }
.ab:active { transform: scale(0.99); }
.ab:focus-visible, .dlg-link:focus-visible, .dlg-x:focus-visible, .ck-btn:focus-visible { outline: 2px solid rgba(253, 66, 156, 0.8); outline-offset: 2px; }
.ab + .ab { margin-top: 8px; }
.ab svg { flex: none; width: 20px; height: 20px; }
.ab-cream { background: var(--cream); color: #131315; }
.ab-cream:hover { background: #fff; }
.ab[disabled] { opacity: 0.55; cursor: default; }
.ab.busy { position: relative; color: transparent; }
.ab.busy::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid rgba(19, 19, 21, 0.25); border-top-color: #131315; border-radius: 50%; animation: dlg-spin 0.7s linear infinite;
}
@keyframes dlg-spin { to { transform: rotate(360deg); } }

.dlg-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; font-size: 12.5px; color: var(--faint); }
.dlg-or::before, .dlg-or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

/* поля */
.dlg form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.fld-wrap { position: relative; }
.fld {
  display: block; width: 100%; height: 48px; padding: 0 14px; border-radius: 12px;
  background: #0c0c0e; border: 1px solid rgba(255, 255, 255, 0.12); color: var(--bone);
  font: 400 15px var(--sans); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.fld::placeholder { color: rgba(247, 244, 239, 0.38); }
.fld:focus { border-color: rgba(253, 66, 156, 0.65); box-shadow: 0 0 0 3px rgba(253, 66, 156, 0.16); }
.fld[aria-invalid="true"] { border-color: rgba(255, 106, 122, 0.8); }
.fld-pw { padding-right: 48px; }
.fld-eye {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 36px; height: 36px;
  padding: 0; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer;
}
.fld-eye:hover { color: var(--bone); background: var(--wash-2); }
.fld-eye svg { width: 19px; height: 19px; }
.fld-code { height: 56px; text-align: center; font-size: 24px; font-weight: 600; letter-spacing: 0.42em; padding-left: calc(14px + 0.42em); font-variant-numeric: tabular-nums; }
.fld-code::placeholder { letter-spacing: 0.42em; }
.fld-hint { margin: -2px 2px 0; font-size: 12.5px; color: var(--faint); }
.dlg-err { margin: 2px 2px 0; font-size: 13.5px; line-height: 1.4; color: #ff7d8c; }
.dlg-err:empty { display: none; }
.dlg form .ab { margin-top: 4px; }

.dlg-chip {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin: -10px 0 18px; font-size: 14px; color: var(--muted);
}
.dlg-chip b { color: var(--cream); font-weight: 600; word-break: break-all; }
.dlg-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.dlg-link {
  padding: 2px 0; border: 0; background: none; color: var(--muted); font: 500 13.5px var(--sans);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(247, 244, 239, 0.3); cursor: pointer;
}
.dlg-link:hover { color: var(--bone); }
.dlg-link[disabled] { cursor: default; text-decoration: none; color: var(--faint); }
.dlg-legal { margin: 18px 6px 0; text-align: center; font-size: 12px; line-height: 1.55; color: var(--faint); }
.dlg-legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.dlg-legal a:hover { color: var(--bone); }
.dlg-note { margin: 14px 0 0; text-align: center; font-size: 13px; line-height: 1.45; color: #ffb36b; }
.dlg-note:empty { display: none; }

/* ---------- предупреждение о cookie ---------- */
.ck {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  padding: 22px 16px calc(22px + env(safe-area-inset-bottom));
  background: #161618; border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cream); font-family: var(--sans);
  transform: translateY(100%); transition: transform 0.4s var(--ease-out);
}
.ck.is-open { transform: none; }
.ck-in { display: flex; align-items: center; gap: 20px 40px; max-width: 1200px; margin: 0 auto; }
.ck-t { flex: 1 1 auto; min-width: 0; }
.ck-t h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.ck-t p { margin: 0; max-width: 860px; font-size: 14.5px; line-height: 1.5; color: rgba(247, 244, 239, 0.86); }
.ck-t a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ck-b { display: flex; gap: 10px; flex: none; }
.ck-btn {
  height: 42px; padding: 0 20px; border-radius: 9999px; border: 1px solid rgba(255, 255, 255, 0.42);
  background: transparent; color: var(--bone); font: 500 15px var(--sans); white-space: nowrap; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease-out);
}
.ck-btn:hover { border-color: rgba(255, 255, 255, 0.7); }
.ck-btn:active { transform: scale(0.98); }
.ck-btn.fill { background: var(--cream); border-color: var(--cream); color: #131315; }
.ck-btn.fill:hover { background: #fff; border-color: #fff; }

/* настройки cookie */
.ck-rows { margin: 0 0 18px; }
.ck-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-strong); }
.ck-row:last-child { border-bottom: 1px solid var(--line-strong); }
.ck-row b { display: block; margin-bottom: 4px; font-size: 15px; font-weight: 600; }
.ck-row span { display: block; font-size: 13px; line-height: 1.45; color: var(--muted); }
.ck-row em { font-style: normal; font-size: 12.5px; color: var(--faint); white-space: nowrap; padding-top: 2px; }
.sw { position: relative; flex: none; width: 44px; height: 26px; margin-top: 1px; }
.sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sw i { position: absolute; inset: 0; border-radius: 9999px; background: rgba(255, 255, 255, 0.16); transition: background 0.2s; pointer-events: none; }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease-out); }
.sw input:checked + i { background: linear-gradient(90deg, var(--coral-warm), var(--coral)); }
.sw input:checked + i::after { transform: translateX(18px); }
.sw input:focus-visible + i { outline: 2px solid rgba(253, 66, 156, 0.8); outline-offset: 2px; }
.ck-dlg-b { display: flex; gap: 8px; }
.ck-dlg-b .ab { margin: 0; }

@media (max-width: 760px) {
  .ck { padding-top: 18px; }
  .ck-in { flex-direction: column; align-items: stretch; gap: 14px; }
  .ck-t h3 { font-size: 16px; margin-bottom: 6px; }
  .ck-t p { font-size: 13.5px; }
  .ck-b { flex-wrap: wrap; }
  .ck-btn { flex: 1 1 0; padding: 0 12px; font-size: 14px; }
  .ck-btn.cfg { flex-basis: 100%; }
}
@media (max-width: 480px) {
  .dlg { padding: 24px 18px 20px; border-radius: 24px; }
  .dlg h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .ov, .dlg, .ck { transition: none; }
}
