: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: 36px;
  height: 36px;
  display: inline-block;
  flex: 0 0 36px;
  background: url("../brand/prelusion-mark-primary.svg") center / contain no-repeat;
}

.brand-mark span { display: none; }

.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.webp"); }
.sheet-two { background-image: url("../images/gallery-sheet-02.webp"); }
.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; }
.auth-form > [hidden], .telegram-auth-entry[hidden], .auth-tabs > [hidden] { display: none !important; }
.telegram-auth-entry { display: grid; gap: 14px; margin: -8px 0 18px; }
.telegram-auth-button {
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 9px 14px 9px 10px;
  border: 1px solid #cfd2ca;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.telegram-auth-button:hover { border-color: #79a9c9; box-shadow: 0 8px 26px rgba(31,111,166,.1); transform: translateY(-1px); }
.telegram-auth-button > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.telegram-auth-button strong { font-size: 14px; }
.telegram-auth-button small { color: #747871; font-size: 11px; line-height: 1.35; }
.telegram-auth-button > svg { width: 16px; color: #6d716a; }
.telegram-auth-help { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 8px; margin: -4px 2px 0; color: #747871; font-size: 11px; line-height: 1.5; }
.telegram-auth-help svg { width: 16px; color: #229ed9; }
.telegram-auth-help b { color: #424640; }
.telegram-auth-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 5px; background: #229ed9; color: #fff; }
.telegram-auth-icon svg { width: 18px; transform: translate(-1px, 1px); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: #92958d; font-size: 10px; text-transform: uppercase; }
.auth-divider::before,.auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.telegram-completion { display: grid; gap: 12px; margin: -6px 0 20px; padding: 16px; border: 1px solid #a8d3e8; border-radius: var(--radius); background: #eef8fc; }
.telegram-completion > span { display: flex; align-items: center; gap: 11px; }
.telegram-completion .telegram-auth-icon { flex: 0 0 38px; }
.telegram-completion strong { display: block; font-size: 13px; }
.telegram-completion small { display: block; margin-top: 3px; color: #66747a; font-size: 10px; }
.telegram-completion button { justify-self: start; padding: 0; border: 0; background: transparent; color: #315f78; font-size: 11px; font-weight: 750; text-decoration: underline; }
.auth-card[data-auth-mode="telegram-signup"] .auth-tabs,
.auth-card[data-auth-mode="telegram-signup"] [data-telegram-auth-entry] { display: none; }
.auth-card[data-auth-mode="telegram-signup"] .auth-copy { margin-bottom: 20px; }
.auth-card[data-auth-mode="telegram-signup"] .auth-form { gap: 14px; }
.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; }
.recover-card[hidden], .feedback-form-panel[hidden], .feedback-complete[hidden] { display: none; }
.auth-result-title { margin: 12px 0 14px; font-size: 38px; }
.auth-result-copy { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 24px; }
.auth-result-copy strong { color: var(--ink); }
.auth-card > .back-link { margin-top: 20px; }
.access-spinner { animation: spin .7s linear infinite; }

.feedback-page { min-height: 100vh; background: #111210; color: #f4f5f0; }
.feedback-header { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px,5vw,72px); border-bottom: 1px solid #30322e; }
.feedback-header .brand-lockup { position: static; color: var(--lime); }
.feedback-header > span { color: #858980; font-size: 11px; text-transform: uppercase; }
.feedback-shell { width: min(1180px,calc(100% - 40px)); margin: 0 auto; display: grid; grid-template-columns:minmax(300px,.8fr) minmax(420px,1.2fr); gap: clamp(50px,8vw,120px); padding: 72px 0 100px; }
.feedback-intro { position: sticky; top: 40px; align-self:start; }
.feedback-intro h1 { margin: 18px 0 24px; font-size: clamp(42px,6vw,72px); line-height:.96; }
.feedback-intro h1 em { color:var(--lime); font-style:normal; }
.feedback-intro > p { color:#a7aaa2; line-height:1.6; max-width:470px; }
.feedback-economics { display:flex; gap:1px; margin-top:36px; background:#31332f; border:1px solid #31332f; }
.feedback-economics span { flex:1; padding:18px; display:grid; background:#191a18; }
.feedback-economics strong { color:var(--lime); font-size:25px; }.feedback-economics small{color:#858980;margin-top:4px}
.feedback-form-panel { background:#f3f4ef; color:#171816; padding:clamp(24px,4vw,48px); border-radius:6px; }
.feedback-form-panel form { display:grid; gap:22px; }
.feedback-form-panel label { display:grid; gap:8px; font-size:12px; font-weight:750; }
.feedback-form-panel input:not([type=radio]),.feedback-form-panel textarea { width:100%; border:1px solid var(--line); border-radius:5px; padding:13px; background:#fff; outline:0; font:inherit; }
.feedback-form-panel textarea { min-height:92px; resize:vertical; }
.feedback-form-panel input:focus,.feedback-form-panel textarea:focus { border-color:#696c64; box-shadow:0 0 0 4px #1112100d; }
.rating-block > span { display:block; font-size:12px; font-weight:750; margin-bottom:10px; }
.rating-options { display:grid; grid-template-columns:repeat(5,1fr); gap:7px; }
.rating-options label { display:block; }.rating-options input{position:absolute;opacity:0}.rating-options span{height:46px;display:grid;place-items:center;border:1px solid var(--line);border-radius:4px;background:#fff}.rating-options input:checked+span{background:var(--ink);color:var(--lime);border-color:var(--ink)}
.feedback-privacy { color:#858880; line-height:1.5; text-align:center; }.feedback-complete{align-self:center}.feedback-complete h2{font-size:46px;margin:14px 0}.feedback-complete p{color:#a7aaa2;line-height:1.6;margin-bottom:28px}.feedback-complete .primary-button{max-width:280px;background:var(--lime);color:#111210}

@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) {
  input, textarea, select { font-size: 16px !important; }
  .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; }
  .telegram-auth-button { min-height: 62px; }
  .telegram-auth-button strong { font-size: 14px; }
  .telegram-auth-button small { font-size: 11px; }
  .recover-art { width: 82vw; right: -38vw; bottom: -25vw; opacity: .22; }
  .feedback-header { height:68px; }.feedback-shell{grid-template-columns:1fr;width:min(100% - 28px,620px);padding:40px 0 70px;gap:36px}.feedback-intro{position:static}.feedback-intro h1{font-size:44px}.feedback-form-panel{padding:24px 18px}.feedback-complete h2{font-size:36px}
}

@media (max-width: 420px) { .feedback-header > span { display:none; } }

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