/* =====================================================================
   Chatterfly 0.1.7 · страница входа · монохром (слой 0.1.7 в конце файла)
   Никаких эмодзи — только неоновые SVG с drop-shadow.
   ===================================================================== */
:root {
  --bg: #04050b;
  --ink: #eef1ff;
  --ink-2: rgba(232, 236, 255, .74);
  --ink-3: rgba(222, 228, 255, .5);
  --cyan: #36f1ff;
  --mag: #ff3fd8;
  --vio: #8a5cff;
  --green: #3dff9a;
  --red: #ff5c7a;
  --glass-bg: linear-gradient(140deg, rgba(255,255,255,.085), rgba(255,255,255,.025) 42%, rgba(255,255,255,.045));
  --glass-br: rgba(255, 255, 255, .1);
  --glass-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -24px 48px -24px rgba(255,255,255,.05), 0 30px 80px -24px rgba(0,0,0,.85);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100svh; overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: var(--ink); }
[hidden] { display: none !important; }

.icn { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 3px currentColor) drop-shadow(0 0 8px color-mix(in srgb, currentColor 60%, transparent)); flex: none; }

.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-br);
  box-shadow: var(--glass-shadow);
}

/* ---------- Фон ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(1200px 700px at 50% -10%, #12103a 0%, transparent 60%), linear-gradient(180deg, #05060f, #04050b); }
.bg__orb { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; transform: translateZ(0); }
.bg__orb--a { left: -12vmax; top: -10vmax; background: radial-gradient(circle, rgba(138,92,255,.75), transparent 65%); animation: orbA 22s var(--ease) infinite alternate; }
.bg__orb--b { right: -14vmax; top: 20vh; background: radial-gradient(circle, rgba(54,241,255,.55), transparent 65%); animation: orbB 26s var(--ease) infinite alternate; }
.bg__orb--c { left: 20vw; bottom: -22vmax; background: radial-gradient(circle, rgba(255,63,216,.45), transparent 65%); animation: orbC 30s var(--ease) infinite alternate; }
.bg__grid { position: absolute; inset: 0; opacity: .14;
  background-image: linear-gradient(rgba(54,241,255,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(54,241,255,.25) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 70%); }
@keyframes orbA { to { transform: translate3d(10vw, 14vh, 0) scale(1.15); } }
@keyframes orbB { to { transform: translate3d(-12vw, 18vh, 0) scale(.9); } }
@keyframes orbC { to { transform: translate3d(8vw, -16vh, 0) scale(1.1); } }

/* ---------- Карточка ---------- */
.auth { min-height: 100svh; display: grid; place-items: center; padding: 28px 16px; }
.card { position: relative; width: min(440px, 100%); padding: 22px 28px 22px; border-radius: 30px; overflow: hidden; isolation: isolate;
  animation: cardIn .8s var(--ease) both; will-change: transform, opacity; transform: translateZ(0); }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.08), transparent 30%); }
.card::after { content: ""; position: absolute; inset: -1px; z-index: -2; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), rgba(54,241,255,.5), rgba(138,92,255,.15), rgba(255,63,216,.5), rgba(54,241,255,.15), rgba(54,241,255,.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 9s linear infinite; opacity: .7; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --ang: 360deg; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) scale(.96); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.card__head { display: flex; align-items: center; justify-content: space-between; }
.home { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--ink-2);
  border: 1px solid var(--glass-br); background: rgba(255,255,255,.04); transition: color .3s, border-color .3s, transform .3s var(--spring); }
.home:hover { color: var(--cyan); border-color: rgba(54,241,255,.4); transform: translateY(-1px); }
.home .icn { width: 18px; height: 18px; }
.lang { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--glass-br); }
.lang button { padding: 6px 9px; border-radius: 9px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); transition: color .25s, background .25s; }
.lang button.is-active { color: var(--ink); background: rgba(255,255,255,.1); }

.brand { text-align: center; margin: 8px 0 18px; }
.brand__logo { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; color: var(--cyan);
  background: radial-gradient(circle at 50% 30%, rgba(54,241,255,.18), rgba(138,92,255,.08)); border: 1px solid rgba(54,241,255,.25);
  box-shadow: 0 0 36px -8px rgba(54,241,255,.6); animation: logoHue 6s linear infinite; }
.brand__logo .icn { width: 36px; height: 36px; stroke-width: 1.4; }
@keyframes logoHue { to { filter: hue-rotate(360deg); } }
.brand h1 { margin: 12px 0 4px; font-size: 1.7rem; letter-spacing: .02em;
  background: linear-gradient(90deg, #fff, var(--cyan), var(--mag), #fff); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 7s linear infinite; }
@keyframes shimmer { to { background-position: 300% 0; } }
.brand p { margin: 0; color: var(--ink-3); font-size: .9rem; }

/* ---------- Переключатель режимов ---------- */
.modes { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 16px; background: rgba(0,0,0,.25); border: 1px solid var(--glass-br); margin-bottom: 14px; }
.modes button { position: relative; z-index: 1; padding: 10px; border-radius: 12px; font-weight: 700; font-size: .92rem; color: var(--ink-3); transition: color .3s; }
.modes button.is-active { color: var(--ink); }
.modes__pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 0 22px -6px rgba(54,241,255,.55); transition: transform .45s var(--spring); }
.modes[data-mode="register"] .modes__pill { transform: translateX(100%); }

/* ---------- Поля ---------- */
.form { display: grid; gap: 10px; }
.field { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 16px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.09); transition: border-color .3s, box-shadow .3s, background .3s; }
.field:focus-within { border-color: rgba(54,241,255,.55); box-shadow: 0 0 0 3px rgba(54,241,255,.12), 0 0 26px -10px rgba(54,241,255,.8); background: rgba(0,0,0,.36); }
.field .icn { width: 18px; height: 18px; color: var(--ink-3); transition: color .3s; }
.field:focus-within > .icn { color: var(--cyan); }
.field input { flex: 1; min-width: 0; padding: 14px 0; background: none; border: 0; outline: none; font-size: 1rem; }
.field input::placeholder { color: var(--ink-3); }
.field__eye { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--ink-3); }
.field__eye:hover, .field__eye.is-on { color: var(--cyan); }
.hint { margin: 0 2px; font-size: .78rem; color: var(--ink-3); line-height: 1.45; }

.submit { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 4px;
  padding: 15px 18px; border-radius: 18px; font-weight: 800; font-size: 1rem; letter-spacing: .02em; color: #05060f;
  background: linear-gradient(100deg, var(--cyan), #7f8bff 55%, var(--mag)); box-shadow: 0 14px 40px -14px rgba(54,241,255,.8), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .35s var(--spring), box-shadow .35s, filter .3s; will-change: transform; }
.submit .icn { width: 18px; height: 18px; filter: none; }
.submit:hover { transform: translateY(-2px); box-shadow: 0 20px 50px -14px rgba(54,241,255,.95), inset 0 1px 0 rgba(255,255,255,.5); }
.submit:active { transform: translateY(0) scale(.98); }
.submit:disabled { filter: saturate(.4) brightness(.8); cursor: progress; }
.submit.is-busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation: sweep 1s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.clickwrap { margin: 2px 0 0; text-align: center; font-size: .76rem; color: var(--ink-3); line-height: 1.5; }
.link { padding: 0; color: var(--cyan); font-size: inherit; text-decoration: none; border-bottom: 1px dashed rgba(54,241,255,.45); }
.link:hover { color: #fff; }
.link--dim { color: var(--ink-3); border-color: rgba(255,255,255,.2); }
.card__foot { display: flex; justify-content: center; gap: 8px; margin-top: 16px; font-size: .74rem; color: var(--ink-3); flex-wrap: wrap; }

.error, .notice { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 10px; padding: 10px 12px; border-radius: 14px; font-size: .86rem; line-height: 1.4; animation: shake .45s var(--ease); }
.error { color: #ffd6de; background: rgba(255,92,122,.1); border: 1px solid rgba(255,92,122,.35); }
.error .icn { color: var(--red); width: 18px; height: 18px; }
.notice { color: var(--ink); background: rgba(54,241,255,.08); border: 1px solid rgba(54,241,255,.3); animation: none; }
.notice .icn { color: var(--cyan); width: 18px; height: 18px; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- 2FA-шторка ---------- */
.shutter { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 22px;
  background: linear-gradient(180deg, rgba(8,10,26,.82), rgba(6,7,18,.94));
  -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%);
  border-radius: inherit; animation: shutterDown .6s var(--ease) both; }
.shutter::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--mag), transparent); box-shadow: 0 0 18px var(--cyan); }
@keyframes shutterDown { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.shutter__inner { width: 100%; max-width: 360px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.shutter__icon { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 22px; color: var(--cyan);
  border: 1px solid rgba(54,241,255,.35); background: rgba(54,241,255,.06); box-shadow: 0 0 40px -8px rgba(54,241,255,.7); animation: pulse 2.2s var(--ease) infinite; }
.shutter__icon .icn { width: 34px; height: 34px; }
@keyframes pulse { 50% { box-shadow: 0 0 56px -4px rgba(54,241,255,.9); } }
.shutter h2 { margin: 2px 0 0; font-size: 1.3rem; }
.shutter__text { margin: 0; color: var(--ink-2); font-size: .88rem; line-height: 1.5; }
.code { display: flex; gap: 8px; align-items: center; margin: 6px 0 2px; }
.code input { width: 44px; height: 54px; border-radius: 14px; text-align: center; font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12); outline: none; caret-color: var(--cyan);
  transition: border-color .25s, box-shadow .25s, transform .25s var(--spring); }
.code input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(54,241,255,.15), 0 0 22px -6px var(--cyan); transform: translateY(-2px); }
.code input.is-filled { border-color: rgba(138,92,255,.6); }
.code__gap { width: 8px; height: 2px; background: var(--ink-3); border-radius: 2px; }
.code.is-bad input { border-color: rgba(255,92,122,.7); animation: shake .45s var(--ease); }
.shutter__timer { margin: 0; font-size: .8rem; color: var(--ink-3); }
.shutter__timer b { font-family: var(--mono); color: var(--ink); }
.shutter__row { display: flex; gap: 18px; justify-content: center; font-size: .84rem; }
.link:disabled { opacity: .45; cursor: default; }
.error--tfa { width: 100%; margin: 0; text-align: left; }

/* ---------- Юридические документы ---------- */
.legal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: rgba(2,3,8,.6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.legal__card { width: min(860px, 100%); max-height: min(86svh, 900px); display: flex; flex-direction: column; border-radius: 26px; overflow: hidden; }
.legal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--glass-br); }
.legal__head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.05rem; }
.legal__head h2 .icn { color: var(--cyan); }
.legal__close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: var(--ink-2); border: 1px solid var(--glass-br); }
.legal__close:hover { color: var(--cyan); }
.legal__tabs { display: flex; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--glass-br); }
.legal__tabs button { flex: 1; padding: 9px; border-radius: 12px; font-size: .84rem; font-weight: 700; color: var(--ink-3); border: 1px solid transparent; }
.legal__tabs button.is-active { color: var(--ink); background: rgba(255,255,255,.07); border-color: var(--glass-br); }
.legal__body { overflow-y: auto; padding: 6px 24px 26px; line-height: 1.62; font-size: .92rem; color: var(--ink-2); overscroll-behavior: contain; }
.legal__body h2 { color: var(--ink); font-size: 1.2rem; margin: 18px 0 8px; }
.legal__body h3 { color: var(--ink); font-size: 1rem; margin: 18px 0 6px; }
.legal__body b { color: var(--ink); }
.legal__body .legal__lead { padding: 12px 14px; border-radius: 14px; background: rgba(54,241,255,.06); border: 1px solid rgba(54,241,255,.2); }

@media (max-width: 480px) {
  .auth { padding: 14px 10px; align-items: start; }
  .card { padding: 18px 18px 18px; border-radius: 26px; }
  .code { gap: 6px; }
  .code input { width: 40px; height: 50px; font-size: 1.3rem; }
  .glass, .shutter { -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Клиент Chatterfly для Windows: под собственной рамкой окна (её высоту задаёт preload). */
html.is-desktop body { padding-top: var(--cf-titlebar, 0px); box-sizing: border-box; }
html.is-desktop .auth { min-height: calc(100svh - var(--cf-titlebar, 0px)); }

/* PWA на iPhone: карточка входа не заходит под вырез и полоску «Домой». */
.auth { padding-top: max(28px, env(safe-area-inset-top, 0px)); padding-bottom: max(28px, env(safe-area-inset-bottom, 0px)); }
html.is-native .home { display: none; }

/* ==================================================================
   0.1.7 · Монохром: тот же строгий стиль, что у лендинга и мессенджера.
   Без орбов, сетки, стекла, градиентов и свечения.
================================================================== */
html, body { background: #0f0f10 !important; color: #ececee; }
.bg { display: none !important; }
*, *::before, *::after { text-shadow: none !important; }
.card, .glass { background: #141416 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important; box-shadow: none !important; }
.card::before, .card::after { display: none !important; }
.brand__logo { background: none !important; box-shadow: none !important; border: 1px solid rgba(255, 255, 255, 0.14) !important; }
.brand__logo .icn, .icn { filter: none !important; color: #ececee; }
.brand h1 { background: none !important; -webkit-text-fill-color: currentColor !important; color: #ececee !important; }
.brand p, .hint, .card__foot, .link--dim { color: #9a9aa1 !important; }
.modes { background: #18181b !important; border: 1px solid rgba(255, 255, 255, 0.09) !important; box-shadow: none !important; }
.modes__pill { background: #2a2a2e !important; box-shadow: none !important; }
.modes button.is-active { color: #ececee !important; }
.field { background: #18181b !important; border: 1px solid rgba(255, 255, 255, 0.09) !important; box-shadow: none !important; }
.field:focus-within { border-color: rgba(255, 255, 255, 0.28) !important; box-shadow: none !important; }
.field:focus-within > .icn { color: #ececee !important; }
.submit { background: #e9e9eb !important; color: #0f0f10 !important; box-shadow: none !important; border: none !important; }
.submit .icn { color: #0f0f10 !important; }
.submit:hover { background: #fff !important; transform: none !important; filter: none !important; }
.home, .lang, .lang button { box-shadow: none !important; }
.lang button.is-active { background: #2a2a2e !important; color: #ececee !important; }
.link { color: #ececee !important; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.25); text-underline-offset: 3px; }
.shutter { background: rgba(15, 15, 16, 0.96) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.shutter__icon { background: #1b1b1e !important; box-shadow: none !important; }
.card, .card *, .bg * { animation: none !important; }
.submit.is-busy::after { background: linear-gradient(90deg, transparent, rgba(0,0,0,.18), transparent) !important; animation: sweep 1s linear infinite !important; }
.link { color: #d4d4d8 !important; border-bottom: 1px solid rgba(255, 255, 255, 0.22) !important; }
.link:hover { color: #fff !important; border-bottom-color: rgba(255, 255, 255, 0.5) !important; }

/* 0.1.9.1: поле-ловушка — невидимо, но «живо» для ботов (display:none они игнорируют). */
.hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* 0.1.9.1: возрастное согласие (12+) на регистрации */
.agree { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; font-size: 13px; color: var(--text-dim, #9a9aa1); cursor: pointer; user-select: none; }
.agree input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent, #ececee); cursor: pointer; }

/* 0.1.9.5 · auth-only isolated SmartCaptcha */
.captcha-box{min-width:0;margin:6px 0}.captcha-box iframe{display:block;width:100%;height:100px;border:0;background:transparent}.captcha-box [hidden]{display:none}.captcha-note{font:11px/1.5 inherit;color:var(--muted,#9ba2be);margin:4px 0 8px}
