.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-modal.is-open { display: flex; }

.auth-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 19, 0.5);
}

.auth-modal__card {
  position: relative;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  box-shadow: 0px 4px 10px -2px rgba(11,12,14,0.06), 0px 1px 2px 0px rgba(11,12,14,0.04);
  display: flex;
  align-items: stretch;
  max-width: 920px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-text-dark);
  z-index: 2;
}

.auth-modal__panel {
  width: 440px;
  flex-shrink: 0;
  background: var(--color-primary);
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}
.auth-modal__logo { font-size: 22px; }
.auth-modal__logo span:first-child,
.auth-modal__logo span:last-child { color: #fff; }
.auth-modal__illustration { width: 100%; height: auto; }
.auth-modal__tagline { font-size: 24px; font-weight: 600; color: #fff; max-width: 264px; line-height: 1.3; }

.auth-modal__form-wrap {
  width: 480px;
  flex-shrink: 0;
  padding: 24px;
  overflow-y: auto;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form[hidden] { display: none; }
.auth-form__title { font-size: 26px; font-weight: 700; color: var(--color-text-dark); margin: 0; }
.auth-error {
  display: none;
  margin: 0;
  padding: 10px 14px;
  background: #FFECEC;
  color: #E23D3D;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}
.auth-error:not(:empty) { display: block; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field__label { font-size: 13px; font-weight: 500; color: var(--color-text-gray); }
.auth-input {
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0px 4px 10px -2px rgba(11,12,14,0.06), 0px 1px 2px 0px rgba(11,12,14,0.04);
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text-dark);
  width: 100%;
  background: #fff;
}
.auth-input:focus { outline: none; border-color: var(--color-primary); }

.auth-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #F2F3F5;
  border-radius: 12px;
  width: 100%;
}
.auth-toggle__item {
  flex: 1;
  padding: 12px 20px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: #737380;
  text-align: center;
}
.auth-toggle__item.is-active {
  background: #fff;
  color: var(--color-text-dark);
  box-shadow: 0px 1px 2px 0px rgba(11,12,14,0.06);
}

.auth-agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}
.auth-agree input { width: 16px; height: 16px; margin-top: 1px; border-radius: 5px; accent-color: var(--color-primary); flex-shrink: 0; }
.auth-agree span { font-size: 12px; color: var(--color-text-gray); line-height: 1.4; }

.auth-submit { width: 100%; }

.auth-switch {
  display: flex;
  gap: 4px;
  justify-content: center;
  font-size: 13px;
  color: var(--color-text-gray);
  margin: 0;
}
.auth-switch a { color: var(--color-primary); font-weight: 600; text-decoration: underline; }

@media (max-width: 820px) {
  .auth-modal { padding: 0; }
  .auth-modal__card { max-width: 100%; height: 100%; max-height: 100vh; border-radius: 0; flex-direction: column; overflow-y: auto; }
  .auth-modal__panel { width: 100%; flex-shrink: 0; padding: 24px; }
  .auth-modal__illustration { max-width: 220px; margin: 0 auto; }
  .auth-modal__form-wrap { width: 100%; }
}
