

:root {
  --violet: #7717ff;
  --violet-2: #8c46ff;
  --violet-light: #a15aff;

  --bg: #0a0a10;
  --panel: #16161f;
  --panel-2: #1b1b25;
  --field: #20212c;
  --field-focus: #262834;
  --line: rgba(255, 255, 255, 0.08);

  --text: #ffffff;
  --muted: #8a8b9b;
  --danger: #ff5d6c;
  --success: #2ecf86;

  --radius: 0px;
  --radius-lg: 0px;
  --dur: 0.22s;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body.auth-body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(120% 100% at 80% 0%, rgba(119, 23, 255, 0.18), transparent 55%),
    radial-gradient(120% 100% at 0% 100%, rgba(140, 70, 255, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: rgba(119, 23, 255, 0.45); }


.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(1000px, 100%);
  height: min(660px, calc(100vh - 48px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
  animation: shell-in 0.6s var(--ease) both;
}
@keyframes shell-in {
  from { opacity: 0; transform: translateY(20px) scale(0.985); }
  to { opacity: 1; transform: none; }
}


.auth-art { position: relative; overflow: hidden; background: #120a26; }
.auth-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: art-zoom 18s ease-in-out infinite alternate;
}
@keyframes art-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}
.art-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 6, 25, 0.15) 0%, rgba(10, 6, 25, 0.05) 45%, rgba(10, 6, 25, 0.85) 100%);
}
.art-legal {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 22px 28px;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}
.art-legal a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }


.auth-banner { display: none; }


.auth-form-side {
  display: flex;
  flex-direction: column;
  padding: 40px clamp(24px, 4vw, 52px);
  overflow-y: auto;
  background: var(--panel);
}
.auth-form-side::-webkit-scrollbar { width: 0; }


.tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.auth-tab {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 0 16px;
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}
.auth-tab.is-active { color: var(--text); }
.auth-tab:hover { color: var(--text); }
.tab-underline {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50%;
  height: 2px;
  border-radius: 2px;
  background: var(--violet);
  box-shadow: 0 0 12px rgba(119, 23, 255, 0.7);
  transform: translateX(0);
  transition: transform 0.4s var(--ease);
}
.tab-underline.login { transform: translateX(100%); }


.forms { position: relative; }
.form-pane { display: none; flex-direction: column; gap: 18px; }
.form-pane.is-active { display: flex; animation: pane-in 0.4s var(--ease) both; }
@keyframes pane-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field > label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #d4d5df;
}
.control { position: relative; display: flex; align-items: center; }
.field-icon {
  position: absolute;
  left: 14px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
  transition: color var(--dur) var(--ease);
}
.field-icon svg { width: 100%; height: 100%; }
.control input {
  width: 100%;
  background: var(--field);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 14px 44px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.control input::placeholder { color: #6a6b7a; }
.control input:focus {
  outline: none;
  background: var(--field-focus);
  border-color: var(--violet);
}
.control:focus-within .field-icon { color: var(--violet-light); }
.control input.invalid { border-color: var(--danger); }

.toggle-eye {
  position: absolute;
  right: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color var(--dur) var(--ease);
}
.toggle-eye:hover { color: var(--violet-light); }
.toggle-eye svg { width: 20px; height: 20px; position: absolute; transition: opacity 0.2s, transform 0.2s; }
.toggle-eye .eye-off { opacity: 0; transform: scale(0.7); }
.toggle-eye.show .eye { opacity: 0; transform: scale(0.7); }
.toggle-eye.show .eye-off { opacity: 1; transform: scale(1); }

.strength { display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-top: 2px; }
.strength-bar { display: block; height: 100%; width: 0; border-radius: 4px; transition: width 0.35s var(--ease), background 0.35s var(--ease); }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: -2px;
}
.link-soft {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--dur);
}
.link-soft:hover { color: #fff; }

.remember {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.check {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: inline-grid;
  place-items: center;
  transition: all var(--dur) var(--ease);
}
.check::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--violet);
  transform: scale(0);
  transition: transform var(--dur) var(--ease);
}
.remember input:checked + .check { border-color: var(--violet); }
.remember input:checked + .check::after { transform: scale(1); }
.terms { line-height: 1.4; }


.btn-primary {
  position: relative;
  margin-top: 4px;
  border: none;
  border-radius: var(--radius);
  background: var(--violet);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 15px;
  cursor: pointer;
  overflow: hidden;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn-primary:hover { background: var(--violet-2); transform: translateY(-1px); box-shadow: 0 10px 26px -12px rgba(119, 23, 255, 1); }
.btn-primary:active { transform: translateY(0); }
.btn-label { transition: opacity 0.2s; }
.btn-loader {
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary.loading { pointer-events: none; }
.btn-primary.loading .btn-label { opacity: 0; }
.btn-primary.loading .btn-loader { opacity: 1; }


.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  margin: 26px 0 18px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.socials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.btn-social {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn-social:hover { border-color: rgba(255, 255, 255, 0.22); background: var(--field-focus); transform: translateY(-1px); }
.btn-social:active { transform: translateY(0); }
.btn-social svg { width: 24px; height: 24px; }
.g-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  overflow: hidden;
}
.g-overlay > div,
.g-overlay iframe {
  width: 100% !important;
  height: 100% !important;
  transform: scale(4);
  transform-origin: center center;
}


.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 140%);
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.88rem;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
  z-index: 200;
  max-width: 90vw;
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-icon { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; }
.toast-icon svg { width: 100%; height: 100%; }
.toast.success { border-color: rgba(46, 207, 134, 0.5); }
.toast.error { border-color: rgba(255, 93, 108, 0.5); }
.toast-msg { line-height: 1.35; }


@media (max-width: 860px) {
  body.auth-body { padding: 0; }
  .auth-shell {
    grid-template-columns: 1fr;
    width: 100%;
    height: 100vh;
    border: none;
    border-radius: 0;
  }
  .auth-art { display: none; }
  .auth-form-side { justify-content: flex-start; padding: 0 22px 32px; }
  .auth-banner {
    display: block;
    width: calc(100% + 44px);
    margin: 0 -22px 24px;
    height: 160px;
    object-fit: cover;
  }
}
@media (max-width: 420px) {
  .auth-form-side { padding: 26px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}