/* Sign up / log in — split screen: brand story on the left, the form on the right. */
.auth {
  display: grid;
  --side-w: max(380px, 45vw);
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
  background: var(--white);
}

.auth-side {
  /* pinned to the window: it never moves, whatever the form on the right does */
  position: fixed;
  top: 0;
  left: 0;
  width: var(--side-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 36px clamp(28px, 4vw, 56px);
  background: var(--accent);
  color: #fff;
  overflow: clip; /* the decorative circle is cut off, the panel itself never scrolls */
}
.auth-side::after {
  content: '';
  position: absolute;
  right: -140px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1.5px dotted rgba(255, 255, 255, 0.45);
  pointer-events: none;
}
.auth-side .logo {
  color: #fff;
}
.side-copy {
  margin-top: auto;
}
.side-h {
  font-size: clamp(40px, 4.4vw, 68px);
  margin: 0 0 18px;
}
.side-lead {
  margin: 0;
  max-width: 42ch;
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}
.side-img {
  width: 100%;
  max-width: 520px;
  border-radius: 22px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35);
}
.side-points {
  list-style: none;
  margin: 0 0 auto;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 15px;
}
.side-points li {
  display: flex;
  gap: 10px;
  align-items: center;
}
.side-points li::before {
  content: '';
  flex: none;
  width: 22px;
  height: 14px;
  background: #fff;
  -webkit-mask: url(/img/mark-mask.svg) center / contain no-repeat;
  mask: url(/img/mark-mask.svg) center / contain no-repeat;
}

.auth-main {
  grid-column: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 48px clamp(16px, 5vw, 64px);
}
.auth-mobile-logo {
  display: none;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  display: grid;
  gap: 14px;
  animation: card-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
.auth-h {
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1;
}
.auth-sub {
  margin: -4px 0 8px;
  font-size: 15px;
}
.auth-sub a,
.label-row a,
.check a {
  color: var(--accent);
  font-weight: 600;
}
.auth-sub a:hover,
.label-row a:hover {
  text-decoration: underline;
}

.field-l {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}
.label-row {
  display: flex;
  justify-content: space-between;
}
.label-row a {
  font-weight: 500;
  font-size: 13.5px;
}
.input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--white);
  font-size: 16px;
  font-weight: 400;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.input[aria-invalid='true'] {
  border-color: #d64545;
  box-shadow: 0 0 0 4px #fde8e8;
}
.pw-wrap {
  position: relative;
  display: block;
}
.pw-wrap .input {
  padding-right: 72px;
}
.pw-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  translate: 0 -50%;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pw-eye:hover {
  background: var(--paper-2);
}

/* password strength */
.meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: -4px;
}
.meter i {
  height: 5px;
  border-radius: 5px;
  background: var(--paper-2);
  transition: background 0.3s;
}
.meter[data-score='1'] i:nth-child(-n + 1) {
  background: #e5484d;
}
.meter[data-score='2'] i:nth-child(-n + 2) {
  background: #f59e0b;
}
.meter[data-score='3'] i:nth-child(-n + 3) {
  background: #84cc16;
}
.meter[data-score='4'] i {
  background: #1f9d55;
}
.meter-l {
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--mute);
  min-height: 18px;
}
.rules {
  list-style: none;
  margin: -4px 0 4px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rules li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--paper);
  font-size: 12.5px;
  color: var(--mute);
  transition: background 0.2s, color 0.2s;
}
.rules li::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
.rules li.ok {
  background: var(--green-soft);
  color: #146c3a;
}
.rules li.ok::before {
  background: currentColor;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  flex: none;
}
.captcha {
  min-height: 65px;
}
.form-err {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff0f0;
  color: #b42318;
  font-size: 14px;
}
.btn-block {
  width: 100%;
  --h: 52px;
  font-size: 16px;
}
.btn-block[disabled] {
  cursor: progress;
}

/* one-time code */
.mail-ico {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.mail-ico svg {
  width: 30px;
  height: 30px;
}
.otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.otp-i {
  width: 100%;
  height: 62px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  text-align: center;
  font: 700 26px/1 var(--f-body);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.otp-i:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.otp.shake {
  animation: shake 0.4s;
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  50% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-3px);
  }
}
.reset-pw {
  display: grid;
  gap: 14px;
}
.resend {
  margin: 0;
  font-size: 14px;
  color: var(--mute);
  text-align: center;
}
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.link-btn[disabled] {
  color: var(--mute);
  cursor: default;
}
.dev-note {
  width: 100%;
  max-width: 440px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff8e1;
  border: 1px dashed #e0b400;
  font-size: 13.5px;
}
.dev-note b {
  font-family: var(--f-mono);
  letter-spacing: 0.2em;
}

@media (max-width: 900px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-side {
    display: none;
  }
  .auth-mobile-logo {
    display: inline-flex;
    justify-self: start;
    max-width: 440px;
    width: 100%;
  }
  .auth-main {
    grid-column: 1;
    align-content: start;
    padding-top: 28px;
  }
}

/* [hidden] must win over the display rules above */
.auth-card[hidden],
.reset-pw[hidden],
.dev-note[hidden],
.form-err[hidden] {
  display: none;
}

/* our captcha */
.captcha {
  display: grid;
  gap: 8px;
  min-height: 0;
}
.cap-l {
  font-size: 14px;
  font-weight: 600;
}
.cap-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cap-img {
  display: block;
  width: 220px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f4f6fb;
  transition: opacity 0.2s;
  user-select: none;
}
.cap-img svg {
  display: block;
  width: 100%;
  height: 100%;
}
.cap-img.loading {
  opacity: 0.4;
}
.cap-new {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.4s;
}
.cap-new:hover {
  transform: rotate(-120deg);
  border-color: var(--ink);
}
.cap-in {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 600;
}
.backup-in { margin: 6px 0 4px; text-align: center; font-family: var(--f-mono); letter-spacing: 0.06em; }
.backup-toggle { margin: 4px 0 0; text-align: center; font-size: 14px; }
