:root {
  color-scheme: dark;
  --ink: #f1f2f3;
  --muted: #aeb2b9;
  --subtle: #777c83;
  --gold: #d6c28a;
  --gold-bright: #eadcae;
  --gold-deep: #9d854c;
  --panel: rgb(25 27 31 / 86%);
  --line: rgb(215 217 220 / 20%);
  --line-strong: rgb(214 194 138 / 48%);
  --danger: #ffb5b5;
  --success: #bfe8c9;
  --shadow: 0 28px 80px rgb(0 0 0 / 48%);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 14% 4%, rgb(214 194 138 / 20%), transparent 30%),
    radial-gradient(ellipse at 90% 20%, rgb(215 217 220 / 9%), transparent 27%),
    linear-gradient(145deg, #202329 0, #101216 52%, #050607 100%);
  background-attachment: fixed;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .2;
  background-image: linear-gradient(rgb(255 255 255 / 3.5%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 3.5%) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  pointer-events: none;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a, .inline-link { color: var(--gold-bright); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }

.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(470px, 1.08fr);
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 80px);
  margin: 40px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgb(9 10 12 / 72%);
  box-shadow: var(--shadow), inset 0 1px rgb(255 255 255 / 8%);
  backdrop-filter: blur(24px);
}
.story {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 660px;
  padding: 46px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(255 255 255 / 3.5%), transparent 50%), radial-gradient(circle at 12% 88%, rgb(214 194 138 / 20%), transparent 36%);
}
.story::after { position: absolute; right: -120px; bottom: -140px; width: 410px; height: 410px; border: 1px solid rgb(214 194 138 / 18%); border-radius: 50%; box-shadow: 0 0 0 54px rgb(214 194 138 / 3.5%), 0 0 0 108px rgb(214 194 138 / 2.2%); content: ""; }
.brand { position: relative; z-index: 1; display: flex; align-items: center; width: max-content; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; width: 104px; height: 104px; border-radius: 50%; object-fit: contain; filter: drop-shadow(0 10px 30px rgb(0 0 0 / 48%)); }
.story-copy { position: relative; z-index: 1; max-width: 480px; margin: auto 0; }
.eyebrow { margin: 0 0 14px; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.story h1 { max-width: 560px; margin: 0; font: 500 clamp(38px, 5vw, 65px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.story-copy > p:last-of-type { max-width: 430px; margin: 22px 0 0; color: var(--muted); font-size: 15px; }
.privacy-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; margin-top: auto; padding: 10px 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; background: rgb(255 255 255 / 4%); font-size: 11px; }
.privacy-note .icon { flex: 0 0 auto; color: var(--gold); }

.access { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 42px clamp(28px, 5vw, 70px); background: linear-gradient(160deg, rgb(28 30 35 / 70%), rgb(14 15 18 / 45%)); }
.access-inner { width: 100%; max-width: 500px; }
.access-head { margin-bottom: 25px; }
.access-head h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.access-head p:last-child { margin: 7px 0 0; color: var(--muted); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 24px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: rgb(0 0 0 / 18%); }
.tab { min-height: 42px; padding: 0 14px; color: var(--muted); border: 0; border-radius: 8px; cursor: pointer; background: transparent; font-weight: 750; }
.tab[aria-selected="true"] { color: #11120f; background: linear-gradient(145deg, #eadcae, #b19b61); box-shadow: 0 8px 20px rgb(0 0 0 / 20%); }
.form-panel { animation: form-in .22s ease both; }
@keyframes form-in { from { opacity: 0; transform: translateY(5px); } }
.form-stack { display: grid; gap: 15px; }
.field { display: grid; align-content: start; gap: 7px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.registration-mode { min-width: 0; margin: 0; padding: 0; border: 0; }
.registration-mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 7px; }
.registration-mode-option { min-height: 42px; padding: 0 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; background: rgb(255 255 255 / 4%); font-size: 11px; font-weight: 750; }
.registration-mode-option:hover { border-color: rgb(215 217 220 / 32%); }
.registration-mode-option[aria-pressed="true"] { color: var(--gold-bright); border-color: var(--line-strong); background: rgb(214 194 138 / 10%); }
.control-wrap { position: relative; display: block; }
.control { width: 100%; height: 46px; padding: 0 13px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; outline: 0; background: rgb(255 255 255 / 5.5%); transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.control::placeholder { color: #70747b; }
.control:hover { border-color: rgb(215 217 220 / 32%); }
.control:focus { border-color: var(--gold); background: rgb(255 255 255 / 7.5%); box-shadow: 0 0 0 3px rgb(214 194 138 / 10%); }
.control:user-invalid { border-color: rgb(220 125 125 / 72%); }
.control.has-action { padding-right: 48px; }
.code-control { letter-spacing: .08em; }
.show-password { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--muted); border: 0; border-radius: 8px; cursor: pointer; background: transparent; }
.show-password:hover { color: var(--gold); background: rgb(214 194 138 / 8%); }
.help { color: var(--subtle); font-size: 10px; }
.help[data-state="error"] { color: var(--danger); }
.form-options { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.check-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; cursor: pointer; }
.check-line input { width: 16px; height: 16px; margin: 0; accent-color: var(--gold-deep); }
.text-button, .inline-link { padding: 0; border: 0; cursor: pointer; background: transparent; font-size: inherit; text-decoration: underline; }
.text-button { color: var(--gold-bright); font-size: 11px; }
.consent { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 11px; padding: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; background: rgb(255 255 255 / 3.5%); cursor: pointer; font-size: 11px; }
.consent input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch { position: relative; width: 39px; height: 22px; border: 1px solid var(--line); border-radius: 99px; background: #35383e; transition: .18s ease; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #c6c8cc; content: ""; transition: .18s ease; }
.consent input:checked + .switch { border-color: var(--gold-deep); background: var(--gold-deep); }
.consent input:checked + .switch::after { transform: translateX(17px); background: #fff; }
.consent input:focus-visible + .switch { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; color: #101114; border: 0; border-radius: 10px; cursor: pointer; background: linear-gradient(145deg, #eadcae, #b19b61); box-shadow: 0 10px 24px rgb(214 194 138 / 13%); font-weight: 800; transition: transform .18s ease, filter .18s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:disabled { cursor: wait; opacity: .62; transform: none; }
.btn.secondary { color: var(--ink); border: 1px solid var(--line); background: rgb(255 255 255 / 7%); box-shadow: none; }
.status { min-height: 20px; margin: 0; color: var(--muted); font-size: 11px; }
.status[data-state="error"] { color: var(--danger); }
.status[data-state="success"] { color: var(--success); }
.form-foot { margin: 22px 0 0; color: var(--subtle); font-size: 10px; text-align: center; }

.cookie-banner { position: fixed; right: 22px; bottom: 22px; z-index: 50; width: min(540px, calc(100% - 44px)); padding: 17px; border: 1px solid var(--line-strong); border-radius: 15px; background: rgb(27 29 33 / 97%); box-shadow: 0 22px 70px rgb(0 0 0 / 60%); backdrop-filter: blur(18px); animation: banner-in .3s ease both; }
@keyframes banner-in { from { opacity: 0; transform: translateY(12px); } }
.cookie-content { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; }
.cookie-copy strong { display: block; margin-bottom: 4px; font-size: 12px; }
.cookie-copy p { margin: 0; color: var(--muted); font-size: 11px; }
.cookie-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.cookie-actions .btn { min-height: 37px; padding: 0 13px; font-size: 10px; }

dialog { width: min(92vw, 620px); max-height: 86vh; padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 18px; background: #17191d; box-shadow: 0 30px 100px rgb(0 0 0 / 80%); overflow: auto; }
dialog::backdrop { background: rgb(2 3 4 / 76%); backdrop-filter: blur(5px); }
.modal-head, .modal-body, .modal-foot { padding: 18px 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-close { display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); border: 0; border-radius: 8px; cursor: pointer; background: transparent; font-size: 23px; }
.modal-body { color: var(--muted); }
.modal-body h3 { margin: 19px 0 6px; color: var(--ink); font-size: 13px; }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin: 0 0 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); }
.modal-foot .btn { min-height: 38px; }

@media (max-width: 900px) {
  .auth-shell { width: min(720px, calc(100% - 32px)); grid-template-columns: 1fr; margin: 16px auto; }
  .story { min-height: auto; padding: 30px; border-right: 0; border-bottom: 1px solid var(--line); }
  .story-copy { margin: 62px 0 54px; }
  .story h1 { font-size: clamp(38px, 8vw, 57px); }
  .access { padding: 36px clamp(24px, 8vw, 66px) 44px; }
}
@media (max-width: 560px) {
  .auth-shell { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; }
  .story { padding: 23px 20px; }
  .brand-logo { width: 84px; height: 84px; }
  .story-copy { margin: 46px 0 38px; }
  .access { padding: 31px 20px 120px; }
  .field-row, .registration-mode-options, .cookie-content { grid-template-columns: 1fr; }
  .cookie-banner { right: 12px; bottom: 12px; width: calc(100% - 24px); }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions .btn { flex: 1 1 150px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
