:root {
  color-scheme: dark;
  --bg: #111210;
  --panel: #f3f4ef;
  --ink: #171816;
  --muted: #74766f;
  --line: #d8dad3;
  --white: #ffffff;
  --lime: #c7ff3d;
  --coral: #ff5c3b;
  --cyan: #70d9ff;
  --radius: 6px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }

.auth-shell {
  height: 100dvh;
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(420px, .78fr);
  overflow: hidden;
}

.auth-visual {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #242623;
  color: var(--white);
}

.auth-visual-prelusion { background: #090a09; }
.auth-hero-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.brand-lockup,
.app-brand,
.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-lockup {
  position: absolute;
  z-index: 3;
  top: 32px;
  left: 38px;
}

.brand-mark {
  width: 29px;
  height: 25px;
  display: inline-flex;
  align-items: stretch;
  gap: 3px;
  transform: skew(-10deg);
}

.brand-mark span { flex: 1; background: currentColor; border-radius: 1px; }
.brand-mark span:first-child { transform: translateY(7px); height: 18px; }
.brand-mark span:nth-child(2) { transform: translateY(2px); height: 23px; }
.brand-mark span:last-child { height: 16px; }

.visual-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  grid-template-rows: 54% 46%;
  gap: 3px;
  background: #0f100f;
}

.visual-cell { min-width: 0; min-height: 0; position: relative; overflow: hidden; }
.visual-cell:first-child { grid-row: 1 / 3; }
.visual-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.12);
}

.crop { background-repeat: no-repeat; background-size: 200% 200%; }
.sheet-one { background-image: url("../images/gallery-sheet-01.png"); }
.sheet-two { background-image: url("../images/gallery-sheet-02.png"); }
.crop-a { background-position: 0 0; }
.crop-b { background-position: 100% 0; }
.crop-c { background-position: 0 100%; }
.crop-d { background-position: 100% 100%; }

.visual-cell:first-child { background-size: auto 100%; background-position: 0 0; }

.auth-statement {
  position: absolute;
  z-index: 3;
  left: 38px;
  bottom: 68px;
  max-width: min(590px, 68%);
  text-shadow: 0 2px 24px rgba(0,0,0,.26);
}

.eyebrow {
  display: block;
  margin-bottom: 14px;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-statement h1 {
  margin: 0;
  font-size: clamp(36px, 4.4vw, 72px);
  line-height: .98;
  font-weight: 760;
  letter-spacing: 0;
}

.visual-caption {
  position: absolute;
  z-index: 3;
  right: 24px;
  bottom: 26px;
  display: flex;
  gap: 16px;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

.auth-panel {
  position: relative;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px clamp(28px, 5vw, 76px);
  background: var(--panel);
  overflow-y: auto;
}

.auth-card { width: min(100%, 430px); animation: card-in .7s var(--ease) both; }
.auth-card[data-auth-mode="signup"] .auth-tabs { margin-bottom: 26px; }
.auth-card[data-auth-mode="signup"] .auth-copy { margin-bottom: 20px; }
.auth-card[data-auth-mode="signup"] .auth-copy h2 { margin-top: 13px; }
.auth-card[data-auth-mode="signup"] .auth-form { gap: 14px; }
.auth-card[data-auth-mode="signup"] .auth-meta { margin-top: 14px; }
.mobile-brand { display: none; margin-bottom: 48px; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}

.auth-tab {
  position: relative;
  min-height: 46px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transition: transform .35s var(--ease);
}

.auth-tab.is-active { color: var(--ink); }
.auth-tab.is-active::after { transform: scaleX(1); }

.auth-copy { margin-bottom: 28px; }
.status-dot { display: inline-flex; align-items: center; gap: 8px; color: #4e5543; font-size: 11px; font-weight: 750; text-transform: uppercase; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: #80b52a; box-shadow: 0 0 0 5px rgba(128,181,42,.12); }
.auth-copy h2 { margin: 18px 0 10px; font-size: 34px; line-height: 1.05; letter-spacing: 0; }
.auth-copy p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.auth-form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field > span:first-child { font-size: 12px; font-weight: 750; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; left: 14px; width: 18px; color: #8a8c84; pointer-events: none; }

.input-wrap input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 0 48px 0 44px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.input-wrap input:focus { border-color: #6f716b; box-shadow: 0 0 0 4px rgba(23,24,22,.07); }
.input-wrap input::placeholder { color: #a6a8a1; }

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
.icon-button svg { width: 18px; }
.password-toggle { position: absolute; right: 6px; color: #84867f; }

.form-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.form-row > a { color: #343531; font-size: 12px; font-weight: 750; text-decoration: none; }
.form-row > a:hover { text-decoration: underline; }

.check-control { display: inline-flex; align-items: center; gap: 9px; color: #60625d; font-size: 12px; cursor: pointer; }
.check-control input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 17px; height: 17px; display: inline-grid; place-items: center; border: 1px solid #b9bbb4; border-radius: 3px; background: #fff; color: #fff; }
.check-box svg { width: 12px; height: 12px; stroke-width: 3; opacity: 0; }
.check-control input:checked + .check-box { border-color: var(--ink); background: var(--ink); }
.check-control input:checked + .check-box svg { opacity: 1; }

.primary-button,
.oauth-button {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.primary-button { border: 1px solid var(--ink); background: var(--ink); color: var(--white); transition: transform .2s, background .2s; }
.primary-button:hover { background: #2c2e2a; transform: translateY(-1px); }
.primary-button svg { width: 18px; margin-left: auto; }
.primary-button.is-loading { pointer-events: none; }
.primary-button.is-loading svg { animation: spin .7s linear infinite; }
.oauth-button { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.oauth-button:hover { background: #e9ebe5; }
.yandex-mark { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #f04438; color: #fff; font-weight: 850; }

.auth-meta { margin: 22px 0 0; color: #92948d; font-size: 10px; line-height: 1.55; text-align: center; }
.auth-meta a { color: #5d5f59; }
.auth-error { margin: 0; padding: 10px 12px; border-left: 3px solid #d44235; background: #fff0ee; color: #8c2922; font-size: 12px; line-height: 1.4; }
.signup-only a { color: inherit; font-weight: 750; }
.login-only[hidden] { display: none; }
.signup-only[hidden] { display: none; }
.signup-note { margin: -4px 0 0; color: #74766f; font-size: 11px; line-height: 1.55; }
.signup-note a { color: #343531; font-weight: 750; }

.recover-page { background: var(--panel); }
.recover-shell { min-height: 100vh; position: relative; display: grid; place-items: center; padding: 110px 28px 44px; overflow: hidden; }
.dark-brand { top: 30px; left: 34px; z-index: 5; color: var(--ink); }
.recover-card, .recover-success { position: relative; z-index: 3; width: min(100%, 460px); }
.recover-icon { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 30px; border-radius: 50%; background: var(--ink); color: var(--lime); }
.recover-icon svg { width: 22px; }
.recover-icon.success { color: var(--ink); background: var(--lime); }
.recover-card h1, .recover-success h1 { margin: 12px 0 14px; font-size: clamp(34px, 5vw, 50px); line-height: .98; }
.recover-card > p, .recover-success > p { margin: 0 0 28px; max-width: 410px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.recover-form { margin-bottom: 24px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: #5e605a; font-size: 12px; font-weight: 750; text-decoration: none; }
.back-link svg { width: 16px; }
.recover-art { position: absolute; right: -8vw; bottom: -18vw; width: 40vw; aspect-ratio: 1; border-radius: 50%; opacity: .9; transform: rotate(12deg); filter: saturate(.92); }
.recover-success[hidden] { display: none; }

@keyframes card-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(390px, .9fr); }
  .visual-grid { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .visual-cell:not(:first-child) { display: none; }
  .visual-cell:first-child { grid-row: auto; }
  .auth-statement { max-width: 78%; }
}

@media (max-width: 720px) {
  .auth-shell { display: block; height: auto; min-height: 100dvh; overflow: visible; background: var(--panel); }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100dvh; align-items: flex-start; padding: 32px 22px 40px; }
  .auth-card { width: 100%; }
  .mobile-brand { display: inline-flex; }
  .auth-tabs { margin-bottom: 34px; }
  .auth-copy h2 { font-size: 32px; }
  .form-row { align-items: flex-start; }
  .recover-art { width: 82vw; right: -38vw; bottom: -25vw; opacity: .22; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
