/* TurboSwift — Login (вариант D). Design: Claude Design project. Token externals inlined. */
:root{
  --font-sans:'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ring:color-mix(in srgb, #48a8f0 38%, transparent);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

:root, [data-theme="light"] {
  --paper:#e7ebf3; --paper-2:#eef1f8; --card:#ffffff; --line:#dce2ed; --line-2:#e9edf5;
  --ink:#141a30; --body:#3c4356; --muted:#79809a; --faint:#a3a9bd;
  --azure:#2f9e00; --azure-d:#237a00; --field:#f3f6fc; --primary:#17151d; --primary-tx:#ffffff;
  --texture:rgba(20,26,48,.05); --err-bg:#fcecec; --err-bd:#f3c9c9; --err-tx:#a92626;
}
[data-theme="dark"] {
  --paper:#010828; --paper-2:#061038; --card:#0c1432; --line:rgba(255,255,255,.10); --line-2:rgba(255,255,255,.06);
  --ink:#f3f6ff; --body:#c7d2ea; --muted:#8c98b8; --faint:#6a769a;
  --azure:#6fff00; --azure-d:#8bff4d; --field:#131d3e; --primary:#f3f6ff; --primary-tx:#0a1126;
  --texture:rgba(255,255,255,.06); --err-bg:#2c1a1c; --err-bd:rgba(233,80,80,.35); --err-tx:#f0a3a3;
}

body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh;
}

.texture-overlay {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; display: none;
  background-image: url('/static/auth/texture.png');
  background-size: 820px 600px; background-repeat: repeat;
  mix-blend-mode: lighten; opacity: .8; filter: brightness(1.55) contrast(1.05);
}
[data-theme="dark"] .texture-overlay { display: block; }

/* ============ LEFT — minimal story ============ */
.story {
  position: relative; overflow: hidden;
  background:
    radial-gradient(70% 50% at 15% 6%, color-mix(in srgb, var(--azure) 13%, transparent), transparent 60%),
    radial-gradient(85% 65% at 92% 104%, color-mix(in srgb, var(--azure) 8%, transparent), transparent 64%),
    linear-gradient(160deg, var(--paper) 0%, var(--paper-2) 100%);
  border-right: 1px solid var(--line); padding: 48px 56px; display: flex; flex-direction: column;
}
.story::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--azure) 50%, transparent) 50%, transparent); opacity: .55;
}
.story::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: radial-gradient(var(--texture) 1px, transparent 1.4px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(120% 100% at 20% 30%, #000 30%, transparent 78%);
          mask-image: radial-gradient(120% 100% at 20% 30%, #000 30%, transparent 78%);
}
.story > * { position: relative; z-index: 1; }

.brand { text-decoration: none; align-self: flex-start; border-radius: 8px; }
.brand:focus-visible { outline: 3px solid var(--ring); outline-offset: 4px; }
.wm { font-family: var(--font-sans); font-weight: 800; font-size: 25px; letter-spacing: -0.045em; color: var(--ink); display: inline-flex; align-items: baseline; }
.wm i { font-style: normal; position: relative; }
.wm i::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); top: -0.30em; width: 5.5px; height: 5.5px; border-radius: 999px; background: var(--azure); }

.story .mid { margin-top: auto; max-width: 24ch; }
.story .mid .eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 20px; }
.story .mid h1 { font-family: 'Fjalla One', sans-serif; font-weight: 400; font-size: 54px; line-height: 1.06; letter-spacing: 0; color: var(--ink); margin: 0; }
.story .mid h1 em { font-family: 'Pacifico', cursive; font-style: normal; font-size: 0.72em; line-height: 1.15; display: inline-block; white-space: nowrap; color: var(--azure-d); -webkit-text-stroke: 0.6px var(--azure-d); margin-top: 6px; }
.home-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.home-link:hover { color: var(--azure-d); }
.story .foot { margin-top: 40px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--faint); text-transform: uppercase; }

/* ============ RIGHT — form ============ */
.pane { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px; position: relative; background: var(--card); }
.theme-toggle {
  position: absolute; top: 22px; right: 22px; z-index: 10; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--field); color: var(--ink); border-color: color-mix(in srgb, var(--azure) 40%, var(--line)); }
.theme-toggle:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }
.lang-toggle { right: 68px; width: auto; min-width: 38px; padding: 0 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
@media (max-width: 880px) { .lang-toggle { right: 64px; } }

.form-wrap { width: 100%; max-width: 384px; }
.head { margin-bottom: 28px; }
.head .cursive { font-family: 'Pacifico', cursive; color: var(--azure-d); font-size: 23px; transform: rotate(-2deg); display: inline-block; margin-bottom: 2px; line-height: 1; }
.head h2 { font-family: 'Fjalla One', sans-serif; font-weight: 400; font-size: 33px; letter-spacing: 0; color: var(--ink); margin: 0; }
.head p { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; font-size: 12px; letter-spacing: .02em; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }

.error { display: none; align-items: flex-start; gap: 10px; background: var(--err-bg); border: 1px solid var(--err-bd); color: var(--err-tx); border-radius: 12px; padding: 12px 14px; margin-bottom: 20px; font-size: 13.5px; line-height: 1.45; }
.error.show { display: flex; }
.error svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.error b { font-weight: 600; }

.field { margin-bottom: 16px; }
.field label { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; font-weight: 600; color: var(--body); margin-bottom: 8px; }
.ipt { display: flex; align-items: center; background: var(--field); border: 1px solid var(--line); border-radius: 12px; box-shadow: inset 0 1px 1px color-mix(in srgb, var(--ink) 5%, transparent); transition: border-color .16s, box-shadow .16s, background .16s; }
.ipt:focus-within { border-color: var(--azure); background: var(--card); box-shadow: 0 0 0 3px color-mix(in srgb, var(--azure) 26%, transparent); }
.ipt.invalid { border-color: var(--err-tx); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err-tx) 20%, transparent); }
.ipt .lead { padding-left: 13px; color: var(--muted); display: flex; }
.ipt .lead svg { width: 17px; height: 17px; }
.ipt input { flex: 1; border: 0; background: transparent; outline: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: .02em; color: var(--ink); padding: 13px 14px; min-width: 0; }
.ipt input::placeholder { color: var(--faint); }
.ipt .reveal { padding: 0 13px; color: var(--muted); background: none; border: 0; cursor: pointer; display: flex; height: 100%; align-items: center; }
.ipt .reveal:hover { color: var(--ink); }
.ipt .reveal:focus-visible { outline: 3px solid var(--ring); outline-offset: -2px; border-radius: 8px; }
.ipt .reveal svg { width: 17px; height: 17px; }

.meta-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 22px; }
.remember { display: inline-flex; align-items: center; gap: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; color: var(--body); cursor: pointer; user-select: none; }
.remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.remember .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line); background: var(--field); display: flex; align-items: center; justify-content: center; transition: background .14s, border-color .14s; }
.remember .box svg { width: 11px; height: 11px; color: #fff; opacity: 0; transition: opacity .14s; }
.remember input:checked + .box { background: var(--azure); border-color: var(--azure); }
.remember input:checked + .box svg { opacity: 1; }
.remember input:focus-visible + .box { outline: 3px solid var(--ring); outline-offset: 2px; }
.forgot { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; color: var(--azure-d); font-weight: 600; text-decoration: none; border-radius: 4px; }
.forgot:hover { text-decoration: underline; text-underline-offset: 2px; }
.forgot:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }

.btn-primary {
  width: 100%; border: 0; border-radius: 12px; padding: 15px;
  font-family: 'Fjalla One', sans-serif; font-size: 15px; font-weight: 400; letter-spacing: .03em; text-transform: uppercase;
  background: var(--azure); color: var(--primary-tx); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: filter .16s, transform .12s, box-shadow .3s ease; position: relative; overflow: hidden;
  box-shadow: 0 6px 22px color-mix(in srgb, var(--azure) 28%, transparent);
}
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary svg { width: 17px; height: 17px; }
.btn-primary .lbl { white-space: nowrap; }
.btn-primary::after { content: ""; position: absolute; z-index: 0; top: -12%; bottom: -12%; left: -75%; width: 48%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-18deg); pointer-events: none; opacity: 0; }
.btn-primary:hover::after { animation: ctaSheen .85s cubic-bezier(.16,1,.3,1); }
@keyframes ctaSheen { 0% { left: -75%; opacity: 0; } 15% { opacity: 1; } 100% { left: 125%; opacity: 0; } }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 10px 38px color-mix(in srgb, var(--azure) 50%, transparent); }
.btn-primary:active { transform: translateY(1px) scale(.995); }
.btn-primary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn-primary[aria-busy="true"] { cursor: progress; filter: none; opacity: .9; }
.btn-primary[aria-busy="true"] .lbl, .btn-primary[aria-busy="true"] .arr { display: none; }
.spinner { display: none; width: 17px; height: 17px; border: 2px solid color-mix(in srgb, var(--primary-tx) 35%, transparent); border-top-color: var(--primary-tx); border-radius: 999px; animation: spin .7s linear infinite; }
.btn-primary[aria-busy="true"] .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 0s; } }

.or { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
.or::before, .or::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.btn-ghost { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: var(--card); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px; transition: background .16s; text-decoration: none; }
.btn-ghost:hover { background: var(--field); }
.btn-ghost:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.btn-ghost svg { width: 17px; height: 17px; color: var(--muted); }

.social { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.social button { height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: .02em; font-weight: 600; color: var(--ink); transition: background .16s, border-color .16s, transform .16s; }
.social button:hover { background: var(--field); border-color: color-mix(in srgb, var(--azure) 42%, var(--line)); transform: translateY(-1px); }
.social button:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.social .ic { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.social .ic svg { width: 18px; height: 18px; display: block; }

.signup { text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; color: var(--muted); margin: 24px 0 0; }
.signup a { color: var(--azure-d); font-weight: 600; text-decoration: none; }
.signup a:hover { text-decoration: underline; text-underline-offset: 2px; }
.legal { text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--faint); margin: 16px 0 0; line-height: 1.6; }
.legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

@keyframes tsUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .home-link, .story .mid, .story .foot, .head, #loginForm, .or, .btn-ghost, .social, .signup, .legal { animation: tsUp .6s cubic-bezier(.16,1,.3,1) both; }
  .story .mid { animation-delay: .06s; } .story .foot { animation-delay: .14s; }
  .head { animation-delay: .04s; } #loginForm { animation-delay: .1s; } .or { animation-delay: .16s; }
  .btn-ghost { animation-delay: .2s; } .social { animation-delay: .24s; } .signup { animation-delay: .28s; } .legal { animation-delay: .32s; }
}

@media (max-width: 880px) {
  body { grid-template-columns: 1fr; }
  .story { padding: 16px 22px 0; border-right: 0; border-bottom: 0; background: transparent; min-height: auto; }
  .story::after, .story::before { display: none; }
  .story .mid, .story .foot { display: none; }
  .pane { padding: 20px 22px 56px; justify-content: flex-start; background: transparent; }
  .theme-toggle { top: 14px; right: 16px; }
  .lang-toggle { top: 14px; right: 62px; }
  .form-wrap { margin: 0 auto; }
}
