:root {
  color-scheme: light;
  --auth-primary: #2563eb;
  --auth-secondary: #6366f1;
  --auth-bg: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(99, 102, 241, 0.9));
  --auth-card-bg: #ffffff;
  --auth-text: #0f172a;
  --auth-muted: #64748b;
  --auth-radius: 18px;
  --auth-shadow: 0 32px 60px rgba(15, 23, 42, 0.22);
  --auth-input-bg: #ffffff;
  --auth-input-border: rgba(148, 163, 184, 0.45);
  --auth-input-border-focus: rgba(37, 99, 235, 0.65);
  --auth-input-shadow-focus: rgba(37, 99, 235, 0.16);
  --auth-input-disabled-bg: rgba(148, 163, 184, 0.16);
  --auth-orb: rgba(255, 255, 255, 0.08);
  --auth-orb-secondary: rgba(255, 255, 255, 0.08);
  --auth-button-shadow: 0 24px 40px rgba(37, 99, 235, 0.28);
  --auth-button-hover-shadow: 0 28px 52px rgba(37, 99, 235, 0.35);
  --auth-error-bg: rgba(248, 113, 113, 0.15);
  --auth-error-border: rgba(248, 113, 113, 0.4);
  --auth-error-text: #b91c1c;
  --auth-info-bg: rgba(59, 130, 246, 0.12);
  --auth-info-border: rgba(59, 130, 246, 0.35);
  --auth-info-text: #1d4ed8;
  --auth-success-bg: rgba(34, 197, 94, 0.14);
  --auth-success-border: rgba(34, 197, 94, 0.45);
  --auth-success-text: #047857;
  --auth-link: #2563eb;
}

:root.theme-dark {
  color-scheme: dark;
  --auth-bg: linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(29, 78, 216, 0.88));
  --auth-card-bg: rgba(15, 23, 42, 0.88);
  --auth-text: #e2e8f0;
  --auth-muted: #94a3b8;
  --auth-shadow: 0 32px 60px rgba(2, 6, 23, 0.52);
  --auth-input-bg: rgba(15, 23, 42, 0.58);
  --auth-input-border: rgba(148, 163, 184, 0.32);
  --auth-input-border-focus: rgba(96, 165, 250, 0.75);
  --auth-input-shadow-focus: rgba(59, 130, 246, 0.3);
  --auth-input-disabled-bg: rgba(51, 65, 85, 0.4);
  --auth-orb: rgba(59, 130, 246, 0.18);
  --auth-orb-secondary: rgba(37, 99, 235, 0.18);
  --auth-button-shadow: 0 24px 40px rgba(37, 99, 235, 0.45);
  --auth-button-hover-shadow: 0 28px 52px rgba(37, 99, 235, 0.55);
  --auth-error-bg: rgba(248, 113, 113, 0.2);
  --auth-error-border: rgba(248, 113, 113, 0.52);
  --auth-error-text: #fecaca;
  --auth-info-bg: rgba(59, 130, 246, 0.2);
  --auth-info-border: rgba(59, 130, 246, 0.42);
  --auth-info-text: #bfdbfe;
  --auth-success-bg: rgba(34, 197, 94, 0.24);
  --auth-success-border: rgba(34, 197, 94, 0.52);
  --auth-success-text: #bbf7d0;
  --auth-link: #93c5fd;
}

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

.auth-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--auth-bg);
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--auth-text);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-body--public-nav {
  display: block;
  padding: 0 0 clamp(28px, 5vw, 56px);
}

.auth-body--register {
  align-items: flex-start;
  padding: clamp(32px, 6vw, 72px) 0;
}

.auth-body--public-nav.auth-body--register {
  padding-top: 0;
}

.auth-body::before,
.auth-body::after {
  content: '';
  position: absolute;
  width: clamp(280px, 40vw, 420px);
  height: clamp(280px, 40vw, 420px);
  background: var(--auth-orb);
  border-radius: 50%;
  filter: blur(0);
  z-index: 0;
}

.auth-body::before {
  top: -120px;
  right: -140px;
}

.auth-body::after {
  bottom: -140px;
  left: -160px;
  background: var(--auth-orb-secondary);
}

.auth-wrapper {
  width: min(420px, 92vw);
  background: var(--auth-card-bg);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: clamp(32px, 5vw, 44px);
  z-index: 1;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: clamp(24px, 5vw, 52px) 16px 0;
}

.auth-shell--center {
  min-height: calc(100vh - 148px);
  align-items: center;
}

.auth-shell--top {
  align-items: flex-start;
}

.landing-hero--auth {
  background: transparent;
  min-height: 0;
  padding: clamp(18px, 3vw, 28px) clamp(16px, 3vw, 28px) 0;
}

.landing-hero--auth .landing-hero__inner {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.auth-top-nav {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.auth-top-link {
  color: var(--auth-link);
  font-weight: 600;
  text-decoration: none;
}

.auth-top-link:hover {
  text-decoration: underline;
}

.auth-wrapper--wide {
  width: min(780px, 94vw);
}

.auth-wrapper--register {
  width: min(980px, 96vw);
}

.auth-body--split {
  align-items: flex-start;
  padding: clamp(32px, 6vw, 72px) 0;
}

.auth-body--single {
  padding: clamp(32px, 7vw, 92px) 0;
}

.auth-wrapper--split {
  width: min(1100px, 96vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 22px;
}

.auth-wrapper--single {
  width: min(520px, 92vw);
  display: flex;
  justify-content: center;
}

.auth-wrapper--single .auth-panel {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.auth-panel {
  background: var(--auth-card-bg);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: clamp(28px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-panel__title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 28px;
  align-items: center;
  text-align: center;
}

.auth-brand-logo {
  width: min(100%, clamp(240px, 34vw, 360px));
  aspect-ratio: 3 / 2;
  height: auto;
  min-height: 160px;
  border-radius: 0;
  background: transparent url('../logo/logo_ZA_k.png') center/contain no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0;
  letter-spacing: 0;
}

:root.theme-dark .auth-brand-logo {
  background-image: url('../logo/logo_ZA_w.png');
}

.auth-brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 10px;
}

.auth-brand-name {
  display: none;
}

:root.theme-dark .auth-brand-name {
  color: #f8fafc;
}

.auth-brand--inline {
  margin-bottom: 4px;
}

.auth-brand-title {
  font-size: clamp(1.6rem, 3.2vw, 2rem);
  font-weight: 700;
  margin: 0;
  color: var(--auth-text);
}

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

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--auth-text);
}

.auth-input {
  border: 1px solid var(--auth-input-border);
  border-radius: 12px;
  background: var(--auth-input-bg);
  padding: 12px 16px;
  font-size: 1rem;
  color: var(--auth-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input::placeholder {
  color: var(--auth-muted);
  opacity: 0.72;
}

.auth-input:focus {
  border-color: var(--auth-input-border-focus);
  box-shadow: 0 0 0 4px var(--auth-input-shadow-focus);
  outline: none;
}

.auth-input:disabled {
  background: var(--auth-input-disabled-bg);
  color: var(--auth-muted);
  cursor: not-allowed;
}

.auth-button {
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--auth-button-shadow);
}

.auth-button:hover,
.auth-button:focus {
  transform: translateY(-2px);
  box-shadow: var(--auth-button-hover-shadow);
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-button--primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.auth-meta {
  margin-top: 22px;
  font-size: 0.85rem;
  color: var(--auth-muted);
  text-align: center;
}

.auth-brand-meta {
  font-size: 0.85rem;
  color: var(--auth-muted);
  margin: 12px 0 0;
}

.auth-error {
  background: var(--auth-error-bg);
  border: 1px solid var(--auth-error-border);
  color: var(--auth-error-text);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
}

.auth-error--info {
  background: var(--auth-info-bg);
  border-color: var(--auth-info-border);
  color: var(--auth-info-text);
  font-weight: 500;
}

.auth-error__list {
  margin: 0;
  padding-left: 18px;
  font-weight: 500;
}

.auth-success {
  background: var(--auth-success-bg);
  border: 1px solid var(--auth-success-border);
  color: var(--auth-success-text);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-weight: 600;
}

.link-inline {
  color: var(--auth-link);
  text-decoration: none;
  font-weight: 600;
}

.link-inline:hover {
  text-decoration: underline;
}

.auth-form--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 22px;
}

.auth-form--grid .auth-field {
  margin: 0;
}

.auth-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.auth-module-card {
  border: 1px solid var(--auth-input-border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--auth-input-bg);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.auth-module-card[hidden] {
  display: none !important;
}

.auth-module-card--alt {
  background: var(--auth-input-disabled-bg);
}

.auth-module-card__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-module-card__title {
  font-weight: 700;
  font-size: 0.98rem;
}

.auth-module-card__desc {
  font-size: 0.88rem;
  color: var(--auth-muted);
}

.auth-module-card__meta {
  font-size: 0.85rem;
  color: var(--auth-muted);
}

.auth-module-card__price {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--auth-success-text);
  background: var(--auth-success-bg);
  border: 1px solid var(--auth-success-border);
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-module-card__control {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.auth-module-card__control .auth-input {
  min-width: 160px;
}

.auth-field--full {
  grid-column: 1 / -1;
}

.auth-field--wide {
  grid-column: span 2;
}

.auth-field--tight {
  max-width: 160px;
}

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

.auth-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--auth-muted);
}

.auth-legal-links a {
  color: var(--auth-primary);
  text-decoration: none;
}

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

@media (max-width: 900px) {
  .auth-body--register,
  .auth-body--split,
  .auth-body--single {
    padding: 18px 0;
  }

  .auth-wrapper,
  .auth-wrapper--wide,
  .auth-wrapper--register,
  .auth-wrapper--single {
    width: min(100%, 96vw);
  }

  .auth-panel {
    padding: 20px 18px;
  }

  .auth-button,
  .auth-input {
    min-height: 44px;
    font-size: 16px;
  }

  .auth-brand-logo {
    width: min(100%, clamp(220px, 56vw, 320px));
    min-height: 140px;
  }

  .auth-shell--center {
    min-height: 0;
    padding-top: 20px;
  }
}

@media (max-width: 520px) {
  .auth-wrapper {
    padding: 18px 14px;
    border-radius: 14px;
  }

  .auth-body::before,
  .auth-body::after {
    display: none;
  }

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

  .auth-brand-header {
    gap: 0;
  }

  .auth-brand-logo {
    width: min(100%, 260px);
    min-height: 118px;
  }

  .auth-button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .auth-wrapper--wide {
    width: min(640px, 96vw);
  }

  .auth-wrapper--register {
    width: min(680px, 96vw);
  }

  .auth-field--wide {
    grid-column: 1 / -1;
  }

  .auth-field--tight {
    max-width: none;
  }

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

@media (max-width: 480px) {
  .auth-form--grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .auth-field--full,
  .auth-field--wide {
    width: 100%;
  }

  .auth-panel {
    border-radius: 14px;
    padding: 16px 12px;
  }
}

@media (max-width: 1024px) {
  .auth-wrapper--split {
    grid-template-columns: 1fr;
  }
}
