/* UI-only auth modal — Clerk-like layout, no Clerk branding */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 45, 0.45);
}

.auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 25rem;
  outline: none;
}

.auth-modal__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem 1.5rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: 0 16px 48px rgba(20, 24, 45, 0.16);
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
}

.auth-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.auth-modal__close:hover {
  background: var(--muted);
  color: var(--foreground);
}

.auth-modal__close:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.auth-modal__close svg {
  width: 1rem;
  height: 1rem;
}

.auth-modal__header {
  padding-right: 1.5rem;
}

.auth-modal__title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--foreground);
}

.auth-modal__subtitle {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.auth-modal__main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-modal__yandex {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-modal__yandex:hover:not(:disabled) {
  background: var(--muted);
}

.auth-modal__yandex:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-modal__yandex:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.auth-modal__yandex-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.auth-modal__yandex-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted-foreground);
  text-align: center;
}

.auth-modal__error {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid color-mix(in srgb, #dc2626 35%, var(--border));
  border-radius: 0.5rem;
  background: color-mix(in srgb, #dc2626 8%, var(--card));
  color: #b91c1c;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.auth-modal__back {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.auth-modal__back:hover {
  color: var(--foreground);
  text-decoration: underline;
}

.auth-modal__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.auth-modal__divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
}

.auth-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.auth-modal__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
}

.auth-modal__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.4;
}

.auth-modal__input::placeholder {
  color: var(--muted-foreground);
}

.auth-modal__input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent);
}

.auth-modal__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.auth-modal__submit:hover {
  background: #5730cb;
}

.auth-modal__submit:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.auth-modal__submit svg {
  width: 1rem;
  height: 1rem;
}

.auth-modal__footer {
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.auth-modal__footer-link {
  margin-left: 0.35rem;
  border: none;
  padding: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.auth-modal__footer-link:hover {
  color: #5730cb;
  text-decoration: underline;
}

.auth-modal__footer-link:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

body.auth-modal-open {
  overflow: hidden;
}
