.auth-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--color-accent) 16%, transparent), transparent 30%),
    linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 10%, #f8fafc) 0%, #ffffff 48%, color-mix(in srgb, var(--color-accent) 36%, #071b1c) 48%, #062a2c 100%);
}

[data-theme="dark"] .auth-body {
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--color-accent) 18%, transparent), transparent 28%),
    linear-gradient(135deg, #081218 0%, #0e1a22 48%, color-mix(in srgb, var(--color-accent) 32%, #031b1c) 48%, #041516 100%);
}

.auth-shell {
  box-sizing: border-box;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: clamp(14px, 2vh, 24px);
}

@media (min-width: 1121px) {
  .auth-body {
    overflow: hidden;
  }
}

.auth-stage {
  width: min(1380px, 100%);
}

.auth-stage-login {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(440px, 0.8fr);
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
  max-height: calc(100dvh - 28px);
}

.auth-stage-centered {
  display: grid;
  place-items: center;
}

.auth-intro {
  position: relative;
  min-height: 0;
  height: min(690px, calc(100dvh - 28px));
  padding: clamp(24px, 4vw, 48px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-accent) 16%, var(--color-border));
  border-radius: 30px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.92) 68%, color-mix(in srgb, var(--color-accent) 10%, #ffffff) 68%),
    linear-gradient(180deg, transparent 60%, color-mix(in srgb, var(--color-accent) 30%, #071b1c) 100%);
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.14);
}

[data-theme="dark"] .auth-intro {
  background:
    linear-gradient(155deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.9) 68%, color-mix(in srgb, var(--color-accent) 16%, #0f172a) 68%),
    linear-gradient(180deg, transparent 60%, #071b1c 100%);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.34);
}

.auth-intro::after {
  position: absolute;
  right: -12%;
  bottom: -16%;
  width: 78%;
  height: 38%;
  border-top: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 16%, transparent), transparent),
    repeating-linear-gradient(90deg, transparent 0 42px, color-mix(in srgb, var(--color-accent) 14%, transparent) 42px 43px);
  content: "";
  transform: rotate(-10deg);
}

.auth-intro-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-logo-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 4px solid var(--color-accent);
  border-radius: 16px;
  color: var(--color-accent);
  font-size: 20px;
  font-weight: 900;
}

.auth-intro-brand strong {
  display: block;
  color: var(--color-text);
  font-size: clamp(26px, 2.7vw, 38px);
  line-height: 1;
}

.auth-intro-brand strong span,
.auth-header h1 span {
  color: var(--color-accent);
}

.auth-intro-brand small {
  display: block;
  margin-top: 8px;
  color: var(--color-muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-intro-line {
  width: 42px;
  height: 4px;
  margin: clamp(24px, 4vh, 42px) 0 20px;
  border-radius: 999px;
  background: var(--color-accent);
}

.auth-intro h1 {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0;
  color: var(--color-text);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
}

.auth-intro p {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--color-muted);
  font-size: 16px;
  line-height: 1.55;
}

.auth-feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(26px, 5vh, 52px);
}

.auth-feature-grid article {
  min-height: 128px;
  padding: 15px 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  text-align: center;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.auth-feature-grid article > span {
  display: block;
  color: var(--color-accent);
  font-size: 24px;
  line-height: 1;
}

.auth-feature-grid strong {
  display: block;
  margin-top: 12px;
  color: var(--color-text);
  font-size: 14px;
}

.auth-feature-grid small {
  display: block;
  margin-top: 8px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-card {
  width: min(580px, 100%);
  padding: clamp(24px, 3.6vw, 46px);
  border: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(10px);
}

.auth-card-compact {
  width: min(560px, 100%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand span {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 13px;
}

.auth-mark,
.auth-section-icon {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 92%, #ffffff), color-mix(in srgb, var(--color-accent) 68%, #064e3b));
  color: #ffffff;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 10px 22px color-mix(in srgb, var(--color-accent) 22%, transparent);
}

.auth-mark {
  width: 46px;
  height: 46px;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1;
}

.auth-mark > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 9px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.auth-section-icon {
  flex: 0 0 auto;
  display: grid;
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.auth-user-icon {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  color: #ffffff;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.auth-header {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--color-border);
}

.auth-header h1 {
  margin-top: 8px;
  font-size: clamp(28px, 2.6vw, 38px);
}

.auth-header p:last-child {
  margin-top: 10px;
  color: var(--color-muted);
}

.auth-section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.auth-section-title strong,
.auth-section-title span {
  display: block;
}

.auth-section-title .auth-section-icon {
  display: grid;
}

.auth-section-title strong {
  color: var(--color-text);
  font-size: 18px;
}

.auth-section-title span {
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 13px;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-bg-soft) 88%, transparent);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field input:focus {
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 16%, transparent);
}

.auth-card .password-control input {
  padding-right: 50px;
}

.field-error {
  color: #b42318;
  font-size: 13px;
}

.form-message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.form-message-error {
  border: 1px solid #f3b3ad;
  background: #fff1ef;
  color: #9f1f16;
}

.form-message-success {
  border: 1px solid #9bd8c9;
  background: #ecfdf7;
  color: #0b6b58;
}

[data-theme="dark"] .form-message-error {
  border-color: #7f2d27;
  background: #321714;
  color: #ffb4ad;
}

[data-theme="dark"] .form-message-success {
  border-color: #1f7a68;
  background: #102a25;
  color: #89f0d6;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  font-weight: 800;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.auth-footer-stacked {
  align-items: stretch;
  flex-direction: column;
}

.auth-footer a {
  color: var(--color-accent);
  font-weight: 700;
  text-align: right;
}

.auth-personalization {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.auth-personalization > span {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}

.auth-personalization > span::before,
.auth-personalization > span::after {
  flex: 1;
  height: 1px;
  background: var(--color-border);
  content: "";
}

.auth-theme-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-muted);
  cursor: pointer;
}

.auth-theme-switch-small {
  width: min(260px, 100%);
  min-height: 42px;
}

.auth-theme-option {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 700;
  transition: color 0.16s ease, background 0.16s ease;
}

[data-theme="light"] .auth-theme-light,
[data-theme="dark"] .auth-theme-dark {
  background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface));
  color: var(--color-accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 20%, transparent);
}

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

  .auth-intro {
    height: auto;
    min-height: auto;
  }

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

  .auth-card-login {
    justify-self: center;
  }
}

@media (min-width: 1121px) and (max-height: 760px) {
  .auth-shell {
    padding: 10px;
  }

  .auth-stage-login {
    gap: 26px;
    max-height: calc(100dvh - 20px);
  }

  .auth-intro {
    height: calc(100dvh - 20px);
    padding: 24px 30px;
    border-radius: 22px;
  }

  .auth-intro-brand strong {
    font-size: 30px;
  }

  .auth-logo-mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .auth-intro-line {
    margin: 22px 0 16px;
  }

  .auth-intro h1 {
    max-width: 540px;
    font-size: 36px;
  }

  .auth-intro p {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.45;
  }

  .auth-feature-grid {
    gap: 10px;
    margin-top: 24px;
  }

  .auth-feature-grid article {
    min-height: 104px;
    padding: 12px 10px;
  }

  .auth-feature-grid article > span {
    font-size: 20px;
  }

  .auth-feature-grid strong {
    margin-top: 8px;
    font-size: 12px;
  }

  .auth-feature-grid small {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.35;
  }

  .auth-card {
    padding: 26px 34px;
    border-radius: 14px;
  }

  .auth-brand {
    margin-bottom: 16px;
  }

  .auth-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  .auth-header h1 {
    font-size: 30px;
  }

  .auth-section-title {
    gap: 10px;
  }

  .auth-section-icon {
    width: 38px;
    height: 38px;
  }

  .auth-form {
    gap: 12px;
  }

  .field input {
    min-height: 42px;
  }

  .auth-submit,
  .auth-theme-switch {
    min-height: 42px;
  }

  .auth-footer {
    margin-top: 14px;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    align-items: start;
    padding: 10px;
  }

  .auth-intro {
    display: none;
  }

  .auth-card {
    width: 100%;
    padding: 20px;
    border-radius: 14px;
  }

  .auth-header {
    margin-bottom: 22px;
    padding-bottom: 22px;
  }

  .auth-section-title {
    align-items: flex-start;
  }

  .auth-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-footer a {
    text-align: left;
  }

  .auth-theme-switch-small {
    width: 100%;
  }

  .auth-submit,
  .auth-theme-option,
  .auth-form input {
    min-height: 44px;
  }
}
