#auth-modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(18, 35, 59, .55); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 20px;
}
#auth-modal-backdrop.open { display: flex; animation: auth-fade .15s ease-out; }
@keyframes auth-fade { from { opacity: 0; } to { opacity: 1; } }

#auth-modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 400px; max-height: 90vh; overflow-y: auto;
  padding: 32px 28px 28px; position: relative; box-shadow: 0 24px 60px -12px rgba(18,35,59,.35);
  animation: auth-pop .18s ease-out;
}
@keyframes auth-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

#auth-modal-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: #f2f4f7; color: #4b5768; font-size: 18px; line-height: 1; cursor: pointer;
  transition: background .12s;
}
#auth-modal-close:hover { background: #e6e9ee; }

.auth-modal-tabs {
  display: flex; gap: 4px; background: #f2f4f7; border-radius: 10px; padding: 4px; margin: 4px 0 24px;
}
.auth-tab {
  flex: 1; padding: 9px 0; border: none; background: none; border-radius: 7px; font-size: 13.5px;
  font-weight: 600; color: #4b5768; cursor: pointer; transition: background .12s, color .12s;
}
.auth-tab.active { background: #fff; color: #1c3f57; box-shadow: 0 1px 2px rgba(16,24,40,.08); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field-row { display: flex; gap: 12px; }
.auth-field-row .auth-field { flex: 1; min-width: 0; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field label { font-size: 12px; font-weight: 600; color: #4b5768; }
.auth-field input {
  padding: 10px 12px; font-size: 14px; border: 1px solid #e6e9ee; border-radius: 8px;
  background: #f9fafb; transition: border-color .12s, background .12s, box-shadow .12s;
}
.auth-field input:focus {
  outline: none; border-color: #1c3f57; background: #fff; box-shadow: 0 0 0 3px #eaf1f5;
}
.auth-field-error, .auth-form-error { color: #b3261e; font-size: 12px; min-height: 0; }
.auth-form-error:not(:empty) { background: #fdecea; border-radius: 8px; padding: 8px 10px; margin-top: -2px; }

.auth-submit {
  margin-top: 4px; padding: 11px 0; background: #1c3f57; color: #fff; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background .12s;
}
.auth-submit:hover { background: #164a6c; }
.auth-submit:disabled { opacity: .7; cursor: default; }
