.theme-public.auth-page {
  min-height: 100vh;
}

.theme-public .auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  padding: 0 6px;
  gap: 18px;
}

.theme-public .auth-logo-link {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

.theme-public .auth-logo-image {
  width: 168px;
  height: auto;
  display: block;
}

.theme-public .auth-back-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.theme-public .public-btn-secondary-back {
  width: auto;
  min-width: 166px;
  justify-content: flex-start;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.theme-public .public-btn-leading-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6a6370;
  font-size: 16px;
  line-height: 1;
}

.theme-public .auth-shell,
.theme-public .onboarding-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 184px);
  padding: 24px 28px;
  border-radius: var(--public-radius-hero);
  background: #fcf7f1;
}

.theme-public .auth-stack,
.theme-public .onboarding-stack {
  width: min(100%, 540px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.theme-public .auth-card,
.theme-public .auth-loading-card,
.theme-public .onboarding-card,
.theme-public .onboarding-loading-card {
  width: 100%;
  padding: 28px;
  background: #ffffff;
  border: 1px solid #efe5d8;
  border-radius: 43px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.04);
}

.theme-public .auth-card {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.theme-public .auth-head {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.theme-public .auth-title {
  margin: 0;
  text-align: center;
  color: var(--public-text);
  font-size: var(--public-type-page-title-size);
  font-weight: 600;
  line-height: var(--public-type-page-title-line);
  letter-spacing: var(--public-type-page-title-tracking);
}

.theme-public .auth-subtitle {
  margin: 0;
  text-align: center;
  color: var(--public-text-muted);
  font-size: var(--public-type-body-md-size);
  font-weight: 400;
  line-height: calc(var(--public-type-body-md-size) * var(--public-type-body-md-line));
  white-space: pre-line;
}

.theme-public .auth-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.theme-public .auth-method-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #eadbca;
  border-radius: 18px;
  background: #fff8ef;
}

.theme-public .auth-method-option {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #6d6259;
  font: inherit;
  font-size: var(--public-type-ui-sm-size);
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.theme-public .auth-method-option:hover,
.theme-public .auth-method-option:focus-visible {
  color: var(--public-accent);
  outline: none;
}

.theme-public .auth-method-option.is-active {
  background: #ffffff;
  color: var(--public-accent);
  box-shadow: 0 8px 20px rgba(217, 117, 4, 0.12);
}

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

.theme-public .auth-recovery-hint {
  margin: 0;
  color: var(--public-text-muted);
  font-size: var(--public-type-ui-sm-size);
  font-weight: 500;
  line-height: var(--public-type-ui-sm-line);
}

.theme-public .auth-field-label {
  color: var(--public-text);
  font-size: var(--public-type-ui-md-size);
  font-weight: 500;
  line-height: var(--public-type-ui-md-line);
}

.theme-public .auth-input-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 12px;
  background: #ffffff;
  border: 1px solid #e8dccd;
  border-radius: 16px;
}

.theme-public .auth-input-shell.has-error {
  border-color: rgba(237, 28, 36, 0.52);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.06);
}

.theme-public .auth-input-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
}

.theme-public .field-icon-image {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(16%) sepia(8%) saturate(550%) hue-rotate(250deg) brightness(94%) contrast(88%);
}

.theme-public .auth-input-shell.has-error .field-icon-image,
.theme-public .public-field-input-wrap.has-error .field-icon-image {
  filter: brightness(0) saturate(100%) invert(18%) sepia(95%) saturate(5090%) hue-rotate(348deg) brightness(92%) contrast(96%);
}

.theme-public .auth-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--public-text);
  font-size: var(--public-type-body-md-size);
  font-weight: 400;
  line-height: calc(var(--public-type-body-md-size) * var(--public-type-body-md-line));
}

.theme-public .auth-input::placeholder {
  color: #757575;
  opacity: 1;
}

.theme-public .auth-input.is-muted::placeholder {
  color: #757575;
}

.theme-public .auth-input[type='date'] {
  color: #757575;
}

.theme-public .auth-input[type='date']:focus,
.theme-public .auth-input[type='date']:valid {
  color: var(--public-text);
}

.theme-public .auth-date-picker-input {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 0;
  border-radius: 12px;
  outline: 0;
  background: #fff7ee;
  color: transparent;
  color-scheme: light;
  cursor: pointer;
}

.theme-public .auth-date-picker-input::-webkit-calendar-picker-indicator {
  width: 22px;
  height: 22px;
  margin: 0 auto;
  cursor: pointer;
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(56%) sepia(61%) saturate(797%) hue-rotate(342deg) brightness(97%) contrast(95%);
}

.theme-public .auth-password-toggle {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6f6570;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.theme-public .auth-password-toggle:hover,
.theme-public .auth-password-toggle:focus-visible {
  background: #fff0da;
  color: var(--public-accent);
  outline: none;
}

.theme-public .auth-password-eye {
  position: relative;
  width: 24px;
  height: 18px;
  display: block;
  background: linear-gradient(
    135deg,
    transparent calc(50% - 1px),
    currentColor calc(50% - 1px),
    currentColor calc(50% + 1px),
    transparent calc(50% + 1px)
  );
  opacity: 0.9;
}

.theme-public .auth-password-eye::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.theme-public .auth-password-eye::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 70% 15%;
  transform: translate(-50%, -50%) rotate(45deg);
}

.theme-public .auth-password-eye.is-visible {
  background: none;
}

.theme-public .auth-field-error {
  margin: 0;
  color: #c31532;
  font-size: var(--public-type-ui-sm-size);
  font-weight: 600;
  line-height: var(--public-type-ui-sm-line);
}

.theme-public .auth-message {
  margin: -8px 0 0;
  padding: 13px 15px;
  border-radius: 16px;
  font-size: var(--public-type-ui-sm-size);
  font-weight: 700;
  line-height: var(--public-type-ui-sm-line);
}

.theme-public .auth-message.is-error {
  color: #9f1239;
  background: #fff1f2;
  border: 1px solid rgba(225, 29, 72, 0.28);
  box-shadow: 0 10px 24px rgba(159, 18, 57, 0.08);
}

.theme-public .auth-message.is-info {
  color: #7a4a16;
  background: #fff7ed;
  border: 1px solid rgba(234, 136, 36, 0.24);
}

.theme-public .auth-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.theme-public .auth-submit-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.theme-public .auth-submit {
  width: 100%;
  justify-content: center;
}

.theme-public .auth-test-link {
  width: 100%;
  justify-content: center;
}

.theme-public .login-password-shell {
  height: 50px;
}

.theme-public .login-forgot-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 6px;
}

.theme-public .login-forgot-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--public-accent-warm);
  font-size: var(--public-type-ui-sm-size);
  font-weight: 500;
  line-height: var(--public-type-ui-sm-line);
  cursor: pointer;
}

.theme-public .login-forgot-link:disabled {
  opacity: 0.6;
  cursor: default;
}

.theme-public .login-forgot-state {
  color: #8b7d6b;
  font-size: var(--public-type-ui-sm-size);
  line-height: var(--public-type-ui-sm-line);
}

.theme-public .auth-login-hint,
.theme-public .auth-legal {
  margin: 0;
  text-align: center;
  font-size: var(--public-type-body-md-size);
  line-height: calc(var(--public-type-body-md-size) * var(--public-type-body-md-line));
}

.theme-public .auth-login-hint {
  color: #8b7d6b;
  font-weight: 400;
}

.theme-public .auth-login-link {
  color: var(--public-accent);
  font-weight: 600;
}

.theme-public .auth-legal {
  color: #8b7d6b;
  font-weight: 400;
}

.theme-public .auth-legal-accent {
  color: var(--public-accent-warm);
  font-weight: 600;
}

.theme-public .auth-loading-page .auth-header {
  width: 100%;
}

.theme-public .auth-loading-chip,
.theme-public .auth-loading-card {
  background: linear-gradient(90deg, rgba(232, 220, 205, 0.56) 0%, rgba(255, 255, 255, 0.95) 50%, rgba(232, 220, 205, 0.56) 100%);
  background-size: 220% 100%;
  animation: public-loading-shimmer 1.5s linear infinite;
}

.theme-public .auth-loading-back {
  width: 166px;
  height: 50px;
  border-radius: 999px;
}

.theme-public .auth-loading-logo {
  justify-self: center;
  width: 168px;
  height: 56px;
  border-radius: 20px;
}

.theme-public .auth-loading-card {
  min-height: 560px;
}

@media (max-width: 920px) {
  .theme-public .auth-header {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 18px;
  }

  .theme-public .auth-back-wrap {
    width: 100%;
    align-items: stretch;
  }

  .theme-public .auth-logo-link {
    margin-left: 0;
    justify-content: flex-end;
  }

  .theme-public .public-btn-secondary-back {
    width: 100%;
  }

  .theme-public .auth-shell,
  .theme-public .onboarding-shell {
    min-height: auto;
    padding: 20px 18px;
    border-radius: 28px;
  }

  .theme-public .auth-card,
  .theme-public .auth-loading-card,
  .theme-public .onboarding-card,
  .theme-public .onboarding-loading-card {
    padding: 24px 18px;
    border-radius: 30px;
  }

  .theme-public .auth-title {
    line-height: var(--public-type-page-title-line);
  }
}

@media (max-width: 560px) {
  .theme-public .auth-logo-image {
    width: 148px;
  }

  .theme-public .auth-shell,
  .theme-public .onboarding-shell {
    padding: 18px 14px;
  }

  .theme-public .auth-card,
  .theme-public .auth-loading-card,
  .theme-public .onboarding-card,
  .theme-public .onboarding-loading-card {
    padding: 20px 16px;
    gap: 24px;
  }

  .theme-public .auth-form {
    gap: 18px;
  }

  .theme-public .auth-input-shell {
    height: 54px;
  }
}
