:root {
  --auth-bg: #f4eee3;
  --auth-surface: #fffaf2;
  --auth-surface-soft: #f8f1e5;
  --auth-ink: #1b2b3f;
  --auth-ink-soft: #5f6f78;
  --auth-primary: #1b5961;
  --auth-primary-strong: #153e4f;
  --auth-accent: #8f7834;
  --auth-border: rgba(27, 43, 63, 0.12);
  --auth-shadow: 0 32px 68px rgba(21, 62, 79, 0.16);
  --auth-radius: 22px;
  --auth-radius-sm: 14px;
  --auth-error-bg: #f2e2dc;
  --auth-error-border: #d7b2a7;
  --auth-error-ink: #6d3a30;
  --auth-success-bg: #e4eee7;
  --auth-success-border: #b9cfbe;
  --auth-success-ink: #2f5f49;
  --auth-warning-bg: #f2eddf;
  --auth-warning-border: #d7c58c;
  --auth-warning-ink: #5f4f1f;
  --auth-info-bg: #e3ecef;
  --auth-info-border: #bacdd2;
  --auth-info-ink: #35515b;
}

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

body.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 14% 12%, rgba(27, 89, 97, 0.17), transparent 36%),
    radial-gradient(circle at 88% 84%, rgba(143, 120, 52, 0.16), transparent 32%),
    linear-gradient(160deg, #fcfaf6 0%, var(--auth-bg) 60%, #ece3d2 100%);
  padding: clamp(0.9rem, 2.6vw, 1.6rem);
  overflow-x: hidden;
}

.auth-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - clamp(1.8rem, 5.2vw, 3.2rem));
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(360px, 0.9fr);
  border-radius: calc(var(--auth-radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--auth-border);
  box-shadow: var(--auth-shadow);
  background: linear-gradient(130deg, #f7f0e3 0%, #fbf7ef 40%, #f6efe2 100%);
}

.auth-showcase {
  position: relative;
  isolation: isolate;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(140deg, rgba(21, 62, 79, 0.96) 0%, rgba(27, 89, 97, 0.95) 55%, rgba(62, 124, 112, 0.93) 100%);
  color: #f4fbff;
}

.auth-showcase::before {
  content: "";
  position: absolute;
  inset: -22% auto auto -18%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.01) 70%);
  pointer-events: none;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -120px;
  width: 300px;
  height: 300px;
  border-radius: 42%;
  background: linear-gradient(125deg, rgba(236, 218, 184, 0.26), rgba(255, 248, 235, 0.04));
  pointer-events: none;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
}

.auth-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-size: 1.1rem;
}

.auth-showcase-title {
  margin: 1.2rem 0 0.75rem;
  font-size: clamp(1.4rem, 2.3vw, 2.1rem);
  line-height: 1.18;
  font-weight: 800;
  max-width: 18ch;
}

.auth-showcase-subtitle {
  margin: 0;
  color: rgba(244, 251, 255, 0.84);
  max-width: 48ch;
  line-height: 1.5;
}

.auth-metrics {
  margin-top: 1.35rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.62rem;
}

.auth-metric {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 0.6rem 0.65rem;
  background: rgba(255, 255, 255, 0.08);
}

.auth-metric strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
}

.auth-metric span {
  display: block;
  font-size: 0.77rem;
  color: rgba(237, 250, 255, 0.8);
}

.auth-feature-list {
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.68rem;
}

.auth-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.58rem;
  color: rgba(244, 251, 255, 0.9);
  line-height: 1.4;
}

.auth-feature-item i {
  margin-top: 0.1rem;
}

.auth-main {
  padding: clamp(1.25rem, 3vw, 2.2rem);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(148deg, rgba(255, 255, 255, 0.95), rgba(250, 245, 236, 0.92));
}

.auth-card {
  width: min(470px, 100%);
  border-radius: var(--auth-radius);
  border: 1px solid var(--auth-border);
  background: linear-gradient(180deg, var(--auth-surface) 0%, var(--auth-surface-soft) 100%);
  box-shadow: 0 18px 42px rgba(21, 62, 79, 0.12);
  padding: clamp(1.2rem, 2.8vw, 1.75rem);
  transform: translateY(10px);
  opacity: 0;
  animation: authEnter 520ms ease forwards;
}

.auth-step-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.56rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  background: rgba(27, 89, 97, 0.09);
  color: var(--auth-primary);
  border: 1px solid rgba(27, 89, 97, 0.22);
  font-weight: 700;
}

.auth-title {
  margin: 0.72rem 0 0.35rem;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.22;
  font-weight: 800;
}

.auth-subtitle {
  margin: 0;
  color: var(--auth-ink-soft);
  font-size: 0.94rem;
  line-height: 1.45;
}

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

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

.auth-field label {
  font-weight: 600;
  color: #2e4c56;
  font-size: 0.86rem;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap i {
  position: absolute;
  left: 0.78rem;
  top: 50%;
  transform: translateY(-50%);
  color: #61737a;
  pointer-events: none;
}

.auth-input,
.auth-select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #c9bca5;
  background: #fffdf9;
  padding: 0.66rem 0.8rem;
  font-size: 0.95rem;
  color: #1f3541;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-input.with-icon {
  padding-left: 2.45rem;
}

.auth-input:focus,
.auth-select:focus {
  outline: none;
  border-color: #86a59f;
  box-shadow: 0 0 0 3px rgba(27, 89, 97, 0.14);
}

.auth-input-hint {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: #6a787f;
}

.auth-error-text {
  margin: 0.12rem 0 0;
  color: var(--auth-error-ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.auth-field-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.auth-toggle-btn {
  border: 1px solid #c9bca5;
  background: #fffaf2;
  color: #2d4c57;
  border-radius: 10px;
  padding: 0.58rem 0.72rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.auth-toggle-btn:hover {
  border-color: #b6a98d;
  background: #f2e9da;
}

.auth-submit {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 0.73rem 0.95rem;
  background: linear-gradient(140deg, var(--auth-primary) 0%, var(--auth-primary-strong) 100%);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px rgba(21, 62, 79, 0.24);
}

.auth-submit:hover {
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-helper {
  margin-top: 1rem;
  font-size: 0.86rem;
  color: #64757d;
}

.auth-helper a {
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-helper a:hover {
  text-decoration: underline;
}

.auth-member-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.54rem;
}

.auth-member-item {
  border: 1px solid #d8cbb4;
  border-radius: 10px;
  background: #f8f2e8;
  padding: 0.5rem 0.55rem;
}

.auth-member-item b {
  display: block;
  margin-bottom: 0.18rem;
  font-size: 0.69rem;
  color: #5e7078;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-member-item span {
  display: block;
  font-weight: 600;
  color: #2a4a55;
  line-height: 1.3;
  word-break: break-word;
}

.jr-alert {
  border-radius: 12px;
  border: 1px solid;
  padding: 0.63rem 0.74rem;
  margin-bottom: 0.74rem;
  font-size: 0.84rem;
  line-height: 1.4;
}

.jr-alert.error,
.jr-alert.danger {
  background: var(--auth-error-bg);
  border-color: var(--auth-error-border);
  color: var(--auth-error-ink);
}

.jr-alert.success {
  background: var(--auth-success-bg);
  border-color: var(--auth-success-border);
  color: var(--auth-success-ink);
}

.jr-alert.warning {
  background: var(--auth-warning-bg);
  border-color: var(--auth-warning-border);
  color: var(--auth-warning-ink);
}

.jr-alert.info {
  background: var(--auth-info-bg);
  border-color: var(--auth-info-border);
  color: var(--auth-info-ink);
}

.auth-stagger {
  opacity: 0;
  transform: translateY(10px);
  animation: authStagger 450ms ease forwards;
}

.auth-stagger.d2 { animation-delay: 90ms; }
.auth-stagger.d3 { animation-delay: 160ms; }

@keyframes authEnter {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes authStagger {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-showcase {
    padding-bottom: 1.2rem;
  }

  .auth-main {
    padding-top: 0.7rem;
  }
}

@media (max-width: 680px) {
  body.auth-page {
    padding: 0.6rem;
  }

  .auth-shell {
    border-radius: 18px;
  }

  .auth-showcase {
    padding: 1.1rem;
  }

  .auth-main {
    padding: 0.9rem;
  }

  .auth-card {
    padding: 1.05rem;
    border-radius: 16px;
  }

  .auth-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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