html:has(.auth-page),
html:has(.auth-page) body,
html:has(.auth-page) body #app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html body .auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(18px, 4vw, 44px);
  background: linear-gradient(135deg, #fafafa 0%, #f3f1f0 100%) !important;
}

.auth-shell {
  width: min(1060px, 100%);
  min-height: min(640px, calc(100dvh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.92fr);
  overflow: hidden;
  border: 1px solid var(--baruk-border-strong);
  border-radius: 24px;
  background: var(--baruk-surface);
  box-shadow: 0 4px 18px rgba(48, 45, 43, 0.06);
}

html body .auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: clamp(42px, 6vw, 74px);
  background: var(--baruk-surface-strong) !important;
  color: var(--baruk-text);
}

.auth-brand__content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.auth-brand__tree {
  display: block;
  width: min(54%, 230px);
  height: auto;
  max-height: 310px;
  object-fit: contain;
  filter: none;
}

.auth-brand__signature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.auth-brand__signature strong {
  color: var(--baruk-text);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1;
}

.auth-brand__signature small {
  color: var(--baruk-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

html body .auth-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 5vw, 64px);
  border: 0 !important;
  border-radius: 0;
  background: var(--baruk-surface) !important;
  box-shadow: none !important;
}

.auth-card__header {
  margin-bottom: 28px;
}

.auth-card__header h2 {
  margin: 0;
  color: var(--baruk-text);
  font-size: clamp(29px, 4vw, 38px);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.auth-card__header p {
  margin: 11px 0 0;
  color: var(--baruk-muted);
  font-size: 14px;
  line-height: 1.55;
}

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

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

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

.auth-field__optional {
  color: var(--baruk-muted);
  font-size: 10px;
  font-weight: 600;
}

html body .auth-field input,
html body .auth-field select,
html body .auth-field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
}

html body .auth-field select {
  appearance: auto;
  background: var(--baruk-surface);
}

html body .auth-field textarea {
  min-height: 96px;
  resize: vertical;
}

html body .auth-field input::placeholder,
html body .auth-field textarea::placeholder {
  color: #aaa6a3;
}

.auth-consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--baruk-muted);
  font-size: 11px;
  line-height: 1.45;
  cursor: pointer;
}

.auth-consent input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--baruk-primary-dark);
}

.auth-actions {
  display: grid;
  margin-top: 3px;
}

html body .auth-button {
  min-height: 50px;
  padding: 13px 18px;
  border: 1px solid var(--baruk-primary-dark);
  border-radius: 11px;
  background: var(--baruk-primary-dark) !important;
  color: #ffffff !important;
  box-shadow: none !important;
  font-weight: 720;
}

html body .auth-button:hover:not(:disabled) {
  background: #5f5651 !important;
}

html body .auth-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.auth-links--single {
  justify-content: flex-start;
}

.auth-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--baruk-primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.auth-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-error {
  display: none;
  padding: 11px 13px;
  border: 1px solid #f1c6c9;
  border-radius: 10px;
  background: var(--baruk-danger-soft);
  color: #982f37;
  font-size: 12px;
  line-height: 1.45;
}

.auth-error.is-visible {
  display: block;
}

.auth-error.is-info {
  border-color: #d5dbe6;
  background: #f3f5f8;
  color: #48566f;
}

.auth-shell--request-access {
  width: min(1180px, 100%);
  grid-template-columns: minmax(300px, 0.72fr) minmax(520px, 1.28fr);
}

html body .auth-card--request-access {
  justify-content: flex-start;
  overflow: auto;
  padding: clamp(32px, 4vw, 52px);
}

.auth-form--request-access {
  gap: 15px;
}

.auth-request-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.auth-request-span-2 {
  grid-column: 1 / -1;
}

.auth-request-success {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
}

.auth-request-success__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--baruk-surface-strong);
  color: var(--baruk-primary-dark);
  font-size: 23px;
  font-weight: 800;
}

.auth-request-success h2 {
  margin: 0;
  color: var(--baruk-text);
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.04em;
}

.auth-request-success p {
  max-width: 520px;
  margin: 8px 0 0;
  color: var(--baruk-muted);
  line-height: 1.6;
}

.auth-request-success .auth-actions {
  width: min(320px, 100%);
}

@media (max-width: 840px) {
  html body .auth-page {
    padding: 12px;
  }

  .auth-shell,
  .auth-shell--request-access {
    min-height: calc(100dvh - 24px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(150px, auto) minmax(0, auto);
    border-radius: 20px;
  }

  html body .auth-brand {
    min-height: 0;
    padding: 22px;
  }

  .auth-brand__content {
    flex-direction: row;
    gap: 18px;
  }

  .auth-brand__tree {
    width: min(28%, 110px);
    max-height: 130px;
  }

  .auth-brand__signature {
    align-items: flex-start;
    text-align: left;
  }

  html body .auth-card,
  html body .auth-card--request-access {
    padding: 28px 32px 34px;
    overflow: visible;
  }
}

@media (max-width: 520px) {
  .auth-shell,
  .auth-shell--request-access {
    grid-template-rows: auto auto;
  }

  .auth-brand__tree {
    width: 70px;
  }

  .auth-brand__signature strong {
    font-size: 22px;
  }

  html body .auth-card,
  html body .auth-card--request-access {
    padding: 24px 22px 28px;
  }

  .auth-card__header {
    margin-bottom: 20px;
  }

  .auth-card__header h2 {
    font-size: 28px;
  }

  .auth-request-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .auth-request-span-2 {
    grid-column: auto;
  }

  .auth-links {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }
}
