@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap");

:root {
  --auth-bg: #f3f4f6;
  --auth-card: #ffffff;
  --auth-text: #0d1b3e;
  --auth-muted: #6b7280;
  --auth-line: #e5e7eb;
  --auth-line-strong: #d1d5db;
  --auth-brand: #1558ef;
  --auth-brand-soft: rgba(21, 88, 239, 0.1);
  --auth-ok: #16a34a;
  --auth-bad: #dc2626;
}

* {
  box-sizing: border-box;
}

body.authPage {
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  background: var(--auth-bg);
  color: var(--auth-text);
}

.authWrap {
  margin: 48px auto;
  padding: 0 16px;
}

.authWrap--narrow {
  max-width: 420px;
}

.authWrap--wide {
  max-width: 520px;
}

.authCard {
  background: var(--auth-card);
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.06);
}

.authTopRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.authBrandLink {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.authToolbar {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.authLocale {
  min-width: 84px;
  padding: 8px 12px;
  border: 1px solid var(--auth-line-strong);
  border-radius: 10px;
  background: #ffffff;
  color: #1f2a44;
  font: inherit;
  font-size: 13px;
}

.authHeader {
  margin-bottom: 18px;
}

.authTitle {
  margin: 0;
  font-size: 20px;
}

.authSubtitle {
  margin: 6px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
}

.authForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.authFieldLabel {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #333333;
}

.authInput {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--auth-line-strong);
  border-radius: 10px;
  background: #ffffff;
  font: inherit;
  font-size: 14px;
}

.authFieldError {
  display: none;
  margin-top: 6px;
  color: var(--auth-bad);
  font-size: 12px;
}

.authCheckboxGroup {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.authCheckboxRow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: #1f2a44;
}

.authCheckbox {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--auth-brand);
}

.authCheckboxText {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
}

.authCheckboxText label {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: 400;
  cursor: pointer;
}

.authCheckboxText a {
  color: var(--auth-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.authCheckboxError {
  margin-left: 26px;
}

.authNotice {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
}

.authNotice.error {
  background: #fff1f1;
  border: 1px solid #ffcccc;
  color: #7a0b0b;
}

.authNotice.ok {
  background: #eef9f0;
  border: 1px solid #bfe7c7;
  color: #0b5a1a;
}

.authMessage {
  min-height: 18px;
  font-size: 13px;
}

.authMessage.success {
  color: var(--auth-ok);
}

.authMessage.error {
  color: var(--auth-bad);
}

.authButton,
.authLinkButton {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(21, 88, 239, 0.35);
  background: var(--auth-brand-soft);
  color: var(--auth-brand);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.authButton {
  cursor: pointer;
}

.authButton:hover,
.authLinkButton:hover {
  background: rgba(21, 88, 239, 0.18);
}

.authButton--primary {
  background: var(--auth-brand);
  border-color: var(--auth-brand);
  color: #ffffff;
}

.authButton--primary:hover {
  background: #0e3db5;
}

.authButton--secondary {
  background: #ffffff;
  border-color: var(--auth-line-strong);
  color: #1f2a44;
}

.authButton--secondary:hover {
  background: #f8fafc;
}

.authButton--block,
.authLinkButton--block {
  width: 100%;
}

.authActions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.authActions .authButton,
.authActions .authLinkButton {
  flex: 1 1 180px;
}

.authButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.authMeta {
  margin-top: 12px;
  color: #666666;
  font-size: 12px;
}

.authMeta a {
  color: var(--auth-brand);
  text-decoration: none;
}

.authMeta a:hover {
  text-decoration: underline;
}

.authLocale:focus,
.authInput:focus,
.authCheckbox:focus-visible,
.authButton:focus-visible,
.authLinkButton:focus-visible,
.authCheckboxText a:focus-visible {
  outline: 2px solid rgba(21, 88, 239, 0.35);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .authWrap {
    margin: 40px auto;
  }

  .authCard {
    padding: 20px;
  }

  .authTopRow {
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
  }
}

