:root {
  color-scheme: dark;
  --bg: #101b22;
  --panel: #16232d;
  --panel-2: #1a2a36;
  --panel-active: #304657;
  --line: #30485c;
  --line-soft: #233744;
  --text: #edf2f6;
  --muted: #edf2f6;
  --soft: #edf2f6;
  --accent: #267b31;
  --accent-hover: #2f8d3a;
  --warning: #f3ba2f;
  --blue: #2f82ff;
  --purple: #7145f6;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.26);
  font-family: Arial, Helvetica, ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  height: 56px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 30px 36px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
}

.brand-mark {
  --mark-x: 9px;
  width: 40px;
  height: 40px;
  display: block;
  position: relative;
  padding: 0;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: var(--shadow);
}

.brand-mark span {
  position: absolute;
  height: 5px;
  border-radius: 1px;
  background: white;
}

.brand-mark span:nth-child(1),
.brand-mark span:nth-child(2) {
  width: 12px;
  right: var(--mark-x);
}

.brand-mark span:nth-child(1) {
  top: calc(50% - 14.5px);
}

.brand-mark span:nth-child(2) {
  top: calc(50% - 8.5px);
}

.brand-mark span:nth-child(3) {
  width: 22px;
  left: var(--mark-x);
  top: calc(50% - 2.5px);
}

.brand-mark span:nth-child(4),
.brand-mark span:nth-child(5) {
  width: 12px;
  left: var(--mark-x);
}

.brand-mark span:nth-child(4) {
  top: calc(50% + 3.5px);
}

.brand-mark span:nth-child(5) {
  top: calc(50% + 9.5px);
}

.brand-name {
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  font-size: 17px;
  line-height: 1;
}

.language-menu {
  position: relative;
}

.language-trigger {
  width: 42px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  display: grid;
  place-items: center;
}

.language-trigger:hover {
  border-color: var(--line);
  background: var(--panel);
}

.language-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  z-index: 10;
}

.security-notice {
  position: fixed;
  top: 92px;
  right: 28px;
  width: min(350px, calc(100vw - 36px));
  min-height: 76px;
  display: grid;
  grid-template-columns: 20px 1fr 20px;
  gap: 10px;
  align-items: start;
  padding: 16px;
  border-radius: 8px;
  background: #1c2a37;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 8;
}

.security-notice p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.security-notice a {
  color: #3a8dff;
  text-decoration: none;
  font-weight: 900;
}

.notice-icon {
  width: 18px;
  height: 18px;
  border: 2px solid #3a8dff;
  border-radius: 50%;
  color: #3a8dff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.notice-close {
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: var(--text);
  position: relative;
}

.notice-close::before,
.notice-close::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 2px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.notice-close::before {
  transform: rotate(45deg);
}

.notice-close::after {
  transform: rotate(-45deg);
}

.language-option {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  font-weight: 800;
}

.language-option:hover,
.language-option.active {
  background: var(--panel-2);
  color: var(--text);
}

.flag {
  width: 24px;
  height: 16px;
  display: inline-block;
  overflow: hidden;
  border-radius: 2px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.flag-ru {
  background: linear-gradient(#fff 0 33%, #315fce 33% 66%, #d52b1e 66%);
}

.flag-en {
  background-image: url("assets/flag-uk.svg");
}

.auth-layout {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: start center;
  padding-bottom: 42px;
}

.auth-column {
  width: min(100% - 36px, 520px);
  padding-top: 18px;
}

.tabs {
  width: 278px;
  height: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-active);
  margin-bottom: 32px;
}

.tab {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.tab.active {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}

.headline h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.12;
  font-weight: 900;
}

.headline p {
  margin: 16px 0 30px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.32;
  font-weight: 700;
}

.exchange-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 34px;
}

.exchange-card {
  height: 80px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 800;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.exchange-card:hover,
.exchange-card.selected {
  border-color: var(--accent);
  background: #14272d;
  transform: translateY(-1px);
}

.exchange-card.placeholder {
  color: var(--soft);
  border-style: dashed;
}

.exchange-logo-plate {
  width: min(106px, 100%);
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #010406;
}

.binance-logo,
.deribit-logo {
  width: 100%;
  height: auto;
  display: block;
}

.exchange-logo {
  width: 36px;
  height: 36px;
}

.plus {
  width: 25px;
  height: 25px;
  position: relative;
}

.plus::before,
.plus::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 4px;
}

.plus::before {
  width: 20px;
  height: 2px;
  left: 2px;
  top: 11px;
}

.plus::after {
  width: 2px;
  height: 20px;
  left: 11px;
  top: 2px;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 28px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 30px;
}

.social-button {
  height: 52px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 900;
}

.social-button:hover {
  border-color: var(--line);
  background: var(--panel-2);
}

.social-icon {
  width: 23px;
  height: 23px;
}

.apple-icon {
  color: var(--text);
}

.email-form {
  display: grid;
  gap: 14px;
}

.field-label {
  color: var(--text);
  font-size: 21px;
  line-height: 1;
  font-weight: 700;
}

.email-form input[type="email"],
.email-form input[type="password"],
.email-form input[type="text"] {
  width: 100%;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0 20px;
  font-size: 20px;
  font-weight: 800;
}

.email-form input::placeholder {
  color: var(--text);
}

.email-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 184, 173, 0.12);
}

.password-area {
  display: grid;
  gap: 14px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 64px !important;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.password-toggle {
  position: absolute;
  top: 7px;
  right: 12px;
}

.password-toggle svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle.active .eye-slash {
  display: none;
}

.signin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 8px;
}

.signin-row a {
  color: var(--accent);
  text-decoration: none;
  font-size: 16px;
  font-weight: 900;
}

.signin-row a:hover {
  color: var(--accent-hover);
}

.check-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px;
  align-items: start;
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
  font-weight: 800;
}

.check-row.compact {
  align-items: center;
  font-size: 16px;
  line-height: 1.2;
}

.check-row input {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: #7f93a2;
}

.referral-block {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.referral-button {
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 900;
}

.chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.referral-button.open .chevron {
  transform: rotate(225deg) translate(-2px, -1px);
}

.submit-button {
  height: 58px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #041210;
  font-size: 22px;
  font-weight: 900;
  margin-top: 2px;
}

.submit-button:hover {
  background: var(--accent-hover);
}

@media (max-width: 680px) {
  .topbar {
    height: 92px;
    padding: 20px 18px 0;
  }

  .brand-mark {
    --mark-x: 6px;
    width: 34px;
    height: 34px;
    padding: 8px 7px;
  }

  .brand-name {
    height: 34px;
    font-size: 15px;
  }

  .auth-layout {
    min-height: calc(100vh - 92px);
  }

  .security-notice {
    top: 72px;
    right: 14px;
  }

  .auth-column {
    width: min(100% - 28px, 520px);
    padding-top: 26px;
  }

  .tabs {
    width: 100%;
    margin-bottom: 34px;
  }

  .headline h1 {
    font-size: 32px;
  }

  .headline p {
    font-size: 18px;
    margin: 18px 0 32px;
  }

  .exchange-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 34px;
  }

  .social-grid {
    grid-template-columns: 1fr;
  }

  .signin-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .email-form input[type="email"],
  .email-form input[type="password"],
  .email-form input[type="text"],
  .submit-button {
    height: 60px;
    font-size: 18px;
  }
}
