/* ============================================================
   TRXWEG — authentication (sign in / open account)
   ============================================================ */

.auth {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  min-height: 100vh;
}

/* ---------- Brand panel ---------- */
.auth__aside {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 28px;
  padding: clamp(28px, 4vw, 52px);
  border-right: 1px solid var(--line);
  background:
    radial-gradient(720px 520px at 0% 0%, rgba(139, 92, 246, 0.16), transparent 62%),
    radial-gradient(520px 420px at 100% 100%, rgba(255, 45, 111, 0.11), transparent 62%);
}
.auth__intro {
  max-width: 520px;
  margin-block: auto;
}
.auth__intro h1 {
  font-family: var(--serif);
  font-size: clamp(2.3rem, 3.5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.01;
  letter-spacing: -0.03em;
  margin: 22px 0 18px;
}
.auth__intro h1 em {
  font-style: italic;
  background: linear-gradient(105deg, var(--violet) 0%, var(--magenta) 45%, var(--crimson) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth__intro > p {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 46ch;
}
.auth__points {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
}
.auth__points li {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.auth__points li:last-child { border-bottom: 1px solid var(--line); }
.auth__points i {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--crimson);
}

.auth__market {
  width: 100%;
  max-width: 420px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}
.auth__market-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.auth__market-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
  font-family: var(--mono);
}
.auth__market-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.auth__market-row span { font-size: 0.68rem; letter-spacing: 0.08em; color: var(--muted); }
.auth__market-row b { font-size: 0.86rem; font-weight: 500; color: var(--text); }
.auth__market-row em { font-style: normal; font-size: 0.7rem; }
.auth__market-row em.up { color: var(--up); }
.auth__market-row em.down { color: var(--down); }
.auth__aside-foot {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  text-transform: uppercase;
}

/* ---------- Form panel ---------- */
.auth__main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: clamp(32px, 5vw, 64px) clamp(20px, 4vw, 56px);
}
.auth__mobilebrand { display: none; }
.auth__card { width: min(100%, 430px); max-width: 430px; min-width: 0; }

.auth__head { margin-bottom: 26px; }
.auth__badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--crimson);
}
.auth__head h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3vw, 2.7rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 12px 0 8px;
}
.auth__head p { color: var(--muted); font-size: 0.9rem; }

.auth__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.auth__form .field { margin-bottom: 0; min-width: 0; }
.auth__form .input,
.auth__form .phone,
.auth__form .otp { max-width: 100%; }
.auth__form .field > label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(6, 3, 11, 0.7);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.input::placeholder { color: var(--muted-2); }
.input:hover { border-color: rgba(255, 255, 255, 0.24); }
.input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
  background: rgba(9, 5, 16, 0.85);
}

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 66px; }

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2393a0b4' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.select option { background: #130b1d; color: var(--text); }

.verify-row { display: flex; gap: 10px; align-items: stretch; }
.verify-row .input { flex: 1; min-width: 0; }
.verify-btn { padding: 0 16px; border-radius: 10px; font-size: 0.8rem; white-space: nowrap; }
.resend {
  border: 0;
  background: none;
  padding: 0;
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.resend:hover { color: var(--magenta); }
.resend:disabled { color: var(--muted-2); cursor: not-allowed; }

.otp { display: flex; gap: 8px; }
.otp__input {
  flex: 1;
  width: 0;
  min-width: 0;
  height: 52px;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(6, 3, 11, 0.7);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.otp__input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}
.otp__input:disabled { opacity: 0.45; cursor: not-allowed; }
.otp__input.filled { border-color: rgba(139, 92, 246, 0.55); }
.otp__hint { margin-top: 7px; font-size: 0.7rem; color: var(--muted-2); }

.phone {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(6, 3, 11, 0.7);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.phone:focus-within {
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
  background: rgba(9, 5, 16, 0.85);
}
.phone__dial {
  padding: 0 12px;
  border-right: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 58px;
  text-align: center;
  white-space: nowrap;
}
.phone input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 13px 12px;
  font-family: var(--sans);
  font-size: 0.92rem;
}
.phone input:focus { outline: none; }
.phone input::placeholder { color: var(--muted-2); }
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pw-toggle:hover { color: var(--magenta); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
  cursor: pointer;
}
.check input {
  accent-color: var(--crimson);
  width: 15px; height: 15px;
  margin: 2px 0 0;
  flex: none;
  cursor: pointer;
}
.check a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.check a:hover { color: var(--crimson); }
.check--inline { align-items: center; }
.check--inline input { margin-top: 0; }

.auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}
.auth__row a { color: var(--violet); }
.auth__row a:hover { color: var(--magenta); text-decoration: underline; }

.auth__msg {
  display: none;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  line-height: 1.5;
}
.auth__msg.is-error {
  display: block;
  color: #ffb8ca;
  background: rgba(255, 45, 111, 0.1);
  border-color: rgba(255, 45, 111, 0.32);
}
.auth__msg.is-ok {
  display: block;
  color: #a9f5dc;
  background: rgba(47, 230, 168, 0.08);
  border-color: rgba(47, 230, 168, 0.32);
}

.auth__submit { margin-top: 4px; padding-block: 14px; font-size: 0.94rem; }

.or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 2px;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.socials { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 500;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease;
}
.social:hover {
  transform: translateY(-1px);
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.08);
}
.social svg { flex: none; }

.auth__switch {
  margin-top: 26px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
}
.auth__switch a { color: var(--crimson); font-weight: 500; }
.auth__switch a:hover { text-decoration: underline; }

.auth__legal {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted-2);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .auth__main {
    min-height: 100vh;
    justify-content: flex-start;
    padding-top: 88px;
  }
  .auth__mobilebrand {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    height: 64px;
    padding: 0 20px;
    margin: 0;
    background: rgba(10, 6, 16, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
  }
}

@media (max-width: 520px) {
  .auth__main { padding-inline: 18px; padding-top: 84px; }
  .socials { grid-template-columns: 1fr; }
  .auth__head h2 { font-size: 2rem; }
  .otp { gap: 6px; }
  .otp__input { height: 48px; font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .social:hover { transform: none; }
}
