:root {
  --ink: #0b1f17;
  --ink-2: #143528;
  --paper: #f3f6f4;
  --paper-2: #fbfcfc;
  --line: #d5e0d9;
  --muted: #5f7268;
  --heat: #1fa971;
  --heat-deep: #0f7a4f;
  --perklo: #3ddc97;
  --rise: #0f9d8a;
  --danger: #9d2408;
  --danger-bg: #ffe8e1;
  --danger-line: #ffc7b8;
  --ok-bg: #e5f8f3;
  --ok-ink: #0b6d5f;
  --ok-line: #b7ebde;
  --font-display: "Outfit", "Avenir Next", sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --shadow: 0 24px 60px rgba(11, 31, 23, 0.18);
  --radius: 18px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.auth-body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--paper);
  line-height: 1.5;
  overflow-x: clip;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }

.icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}
.icon svg { width: 100%; height: 100%; display: block; }
.icon--sm { width: 1rem; height: 1rem; }

.auth-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
.auth-skip:focus {
  left: 1rem;
  top: 1rem;
}

.auth-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.auth-aside {
  position: relative;
  overflow: hidden;
  color: #eef7f1;
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(61, 220, 151, 0.28), transparent 58%),
    radial-gradient(700px 480px at 88% 82%, rgba(15, 157, 138, 0.22), transparent 55%),
    linear-gradient(155deg, #07150f 0%, #0b1f17 42%, #123528 100%);
  padding: clamp(1.5rem, 4vw, 3rem);
  display: flex;
  align-items: center;
}

.auth-aside__glow {
  position: absolute;
  inset: auto -20% -25% auto;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: conic-gradient(from 140deg, rgba(61,220,151,.22), rgba(15,157,138,.12), transparent 68%);
  filter: blur(36px);
  animation: auth-drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}

.auth-aside__mesh {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(238, 247, 241, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 247, 241, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, #000 20%, transparent 92%);
  pointer-events: none;
}

.auth-aside__inner {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  animation: auth-rise 0.7s ease both;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: #fff;
  margin-bottom: 2.4rem;
}

.auth-brand__mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.auth-brand__word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: -0.05em;
  line-height: 1;
}

.auth-brand__word em {
  font-style: normal;
  color: var(--perklo);
}

.auth-aside__kicker {
  margin: 0 0 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(238, 247, 241, 0.62);
}

.auth-aside__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  max-width: 11ch;
}

.auth-aside__text {
  margin: 1rem 0 0;
  font-size: 1.05rem;
  color: rgba(238, 247, 241, 0.78);
  max-width: 34ch;
}

.auth-aside__points {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.auth-aside__points li {
  position: relative;
  padding-left: 1.15rem;
  color: rgba(238, 247, 241, 0.72);
  font-size: 0.95rem;
}

.auth-aside__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--perklo);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.16);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(700px 320px at 100% 0%, rgba(31, 169, 113, 0.08), transparent 55%),
    linear-gradient(180deg, #f7faf8 0%, var(--paper) 45%, #eef3f0 100%);
  padding: clamp(1rem, 3vw, 1.6rem);
}

.auth-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: auth-rise 0.55s ease both;
}

.auth-panel__home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.auth-panel__home:hover { color: var(--ink); }

.auth-panel__switch {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-panel__switch a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.auth-panel__switch a:hover { color: var(--heat-deep); }

.auth-panel__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(420px, 100%);
  margin: 1.5rem auto;
  animation: auth-rise 0.75s ease 0.08s both;
}

.page-register .auth-panel__body {
  width: min(420px, 100%);
}

.auth-panel__intro { margin-bottom: 1.25rem; }

.auth-panel__eyebrow {
  margin: 0 0 0.35rem;
  color: var(--heat-deep);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.auth-panel__lede {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.auth-panel__lede--tight { margin-top: 1.4rem; }
.auth-panel__lede a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.auth-panel__lede a:hover { color: var(--heat-deep); }

.auth-alert {
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.auth-alert p { margin: 0.2rem 0; }
.auth-alert--error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-line);
}
.auth-alert--success {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border: 1px solid var(--ok-line);
}

.auth-form {
  display: grid;
  gap: 0.95rem;
}

.auth-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.95rem;
}

.auth-field {
  display: grid;
  gap: 0.4rem;
}

.auth-field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.auth-field__link {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
}
.auth-field__link:hover { color: var(--heat-deep); }

.auth-field__control {
  position: relative;
  display: block;
}

.auth-field__input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.82rem 0.95rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field__control .auth-field__input {
  padding-right: 2.8rem;
}

.auth-field__input:focus {
  outline: none;
  border-color: var(--heat);
  box-shadow: 0 0 0 3px rgba(31, 169, 113, 0.18);
}

.auth-field__hint {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.auth-reveal {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.auth-reveal:hover,
.auth-reveal[aria-pressed="true"] {
  color: var(--ink);
  background: rgba(11, 31, 23, 0.05);
}

.auth-legal {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.auth-legal a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.auth-legal a:hover { color: var(--heat-deep); }

.auth-submit {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 0.95rem 1.2rem;
  background: var(--heat-deep);
  background-image: linear-gradient(135deg, #27bd7d, var(--heat) 55%, var(--heat-deep));
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(15, 122, 79, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.auth-submit[disabled] {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}
.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(15, 122, 79, 0.34);
}
.auth-submit:active { transform: translateY(0); }
.auth-submit:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.auth-help {
  display: grid;
  gap: 0.85rem;
}

.auth-help__item {
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.auth-help__item h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.auth-help__item p {
  margin: 0.45rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.auth-help__action {
  display: inline-flex;
  font-weight: 800;
  color: var(--heat-deep);
  text-decoration: none;
}
.auth-help__action:hover { color: var(--ink); }

.auth-panel__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  justify-content: center;
  padding-top: 0.5rem;
}
.auth-panel__foot a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
}
.auth-panel__foot a:hover { color: var(--ink); }

@keyframes auth-drift {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to { transform: translate3d(-6%, -5%, 0) rotate(14deg); }
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .auth-stage {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    min-height: auto;
    padding: 1.25rem 1.2rem 1.5rem;
    align-items: stretch;
  }

  .auth-aside__inner {
    max-width: none;
  }

  .auth-brand { margin-bottom: 1.2rem; }

  .auth-aside__title {
    max-width: none;
    font-size: clamp(1.7rem, 7vw, 2.2rem);
  }

  .auth-aside__text { max-width: none; }

  .auth-aside__points { display: none; }

  .auth-panel {
    min-height: auto;
    padding: 1rem 1.1rem 1.4rem;
  }

  .auth-panel__body {
    margin: 1.2rem auto 1.5rem;
    justify-content: flex-start;
  }

  .auth-form__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .auth-panel__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-field__label {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-aside__glow,
  .auth-aside__inner,
  .auth-panel__top,
  .auth-panel__body,
  .auth-submit {
    animation: none !important;
    transition: none !important;
  }
}
