:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --auth-canvas: #f4f4f1;
  --auth-surface: #ffffff;
  --auth-field: #fafaf8;
  --auth-text: #242426;
  --auth-muted: #686866;
  --auth-border: rgba(28, 28, 28, .14);
  --auth-border-strong: rgba(28, 28, 28, .3);
  --auth-primary: #29292b;
  --auth-primary-text: #ffffff;
  --auth-danger: #8a3030;
  --auth-danger-bg: #fff4f3;
  --auth-focus: #8a6a35;
  --auth-shadow: 0 24px 70px rgba(30, 30, 28, .09);
}

[data-theme="dark"] {
  color-scheme: dark;
  --auth-canvas: #19191a;
  --auth-surface: #232325;
  --auth-field: #1e1e20;
  --auth-text: #efefed;
  --auth-muted: #b1b1b0;
  --auth-border: rgba(255, 255, 255, .13);
  --auth-border-strong: rgba(255, 255, 255, .27);
  --auth-primary: #efefec;
  --auth-primary-text: #202022;
  --auth-danger: #f0aaaa;
  --auth-danger-bg: #352224;
  --auth-focus: #c2a36d;
  --auth-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background: var(--auth-canvas);
  color: var(--auth-text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--auth-focus);
  outline-offset: 3px;
}

.mfx-auth-skip {
  position: fixed;
  z-index: 20;
  top: -80px;
  left: 20px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--auth-primary);
  color: var(--auth-primary-text);
}

.mfx-auth-skip:focus {
  top: 20px;
}

.mfx-auth-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 76px 24px 44px;
}

.mfx-auth-theme {
  position: absolute;
  top: 22px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-muted);
  font-size: 13px;
}

.mfx-auth-theme select {
  min-height: 40px;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  background: var(--auth-surface);
}

.mfx-auth-layout {
  display: grid;
  width: min(1000px, 100%);
  grid-template-columns: minmax(300px, 1fr) minmax(420px, 460px);
  align-items: center;
  gap: clamp(64px, 9vw, 118px);
}

.mfx-auth-brand {
  max-width: 430px;
}

.mfx-auth-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 720;
  letter-spacing: -.02em;
  text-decoration: none;
}

.mfx-auth-logo {
  display: block;
  width: 58px;
  height: auto;
  flex: none;
  object-fit: contain;
}

.mfx-auth-brand p {
  max-width: 390px;
  margin: 26px 0 0;
  color: var(--auth-muted);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.45;
  letter-spacing: -.015em;
}

.mfx-auth-form-column {
  width: 100%;
}

.mfx-auth-card {
  width: 100%;
  padding: clamp(30px, 4vw, 42px);
  border: 1px solid var(--auth-border);
  border-radius: 18px;
  background: var(--auth-surface);
  box-shadow: var(--auth-shadow);
}

.mfx-auth-card h1 {
  margin: 0;
  font-size: clamp(29px, 3vw, 36px);
  font-weight: 620;
  line-height: 1.17;
  letter-spacing: -.035em;
}

.mfx-auth-subtitle {
  margin: 10px 0 28px;
  color: var(--auth-muted);
  font-size: 15px;
}

.mfx-auth-messages:empty {
  display: none;
}

.mfx-auth-alert,
.mfx-auth-unavailable {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--auth-border);
  border-radius: 9px;
  background: var(--auth-field);
  font-size: 14px;
}

.mfx-auth-alert-error {
  border-color: color-mix(in srgb, var(--auth-danger) 35%, transparent);
  background: var(--auth-danger-bg);
  color: var(--auth-danger);
}

.mfx-auth-unavailable p {
  margin: 5px 0 0;
  color: var(--auth-muted);
}

.mfx-auth-form {
  display: grid;
  gap: 19px;
}

.mfx-auth-field {
  display: grid;
  gap: 7px;
}

.mfx-auth-field label {
  font-size: 14px;
  font-weight: 650;
}

.mfx-auth-field input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--auth-border);
  border-radius: 9px;
  background: var(--auth-field);
  font-size: 16px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.mfx-auth-field input:hover {
  border-color: var(--auth-border-strong);
}

.mfx-auth-field input:focus {
  border-color: var(--auth-focus);
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-focus) 20%, transparent);
}

.mfx-auth-field input[aria-invalid="true"] {
  border-color: var(--auth-danger);
}

.mfx-auth-password {
  position: relative;
}

.mfx-auth-password input {
  padding-right: 54px;
}

.mfx-auth-password-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
}

.mfx-auth-password-toggle:hover {
  background: var(--auth-canvas);
  color: var(--auth-text);
}

.mfx-auth-password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

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

.mfx-auth-submit {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 3px;
  padding: 10px 16px;
  border: 1px solid var(--auth-primary);
  border-radius: 9px;
  background: var(--auth-primary);
  color: var(--auth-primary-text);
  font-weight: 680;
  cursor: pointer;
}

.mfx-auth-submit:hover {
  opacity: .9;
}

.mfx-auth-submit:disabled {
  cursor: wait;
  opacity: .68;
}

.mfx-auth-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: mfx-auth-spin .8s linear infinite;
}

.mfx-auth-submit.is-loading .mfx-auth-spinner {
  display: block;
}

.mfx-auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  margin-top: 24px;
  color: var(--auth-muted);
  font-size: 14px;
}

.mfx-auth-links a {
  min-height: 28px;
  padding: 3px 0;
}

@keyframes mfx-auth-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
  .mfx-auth-shell {
    display: block;
    padding: 82px 22px 34px;
  }

  .mfx-auth-theme {
    top: 18px;
    right: 22px;
  }

  .mfx-auth-layout {
    display: block;
    max-width: 480px;
    margin: 0 auto;
  }

  .mfx-auth-brand {
    margin: 0 0 28px;
  }

  .mfx-auth-brand-link {
    gap: 11px;
    font-size: 18px;
  }

  .mfx-auth-logo {
    width: 42px;
  }

  .mfx-auth-brand p {
    margin-top: 12px;
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .mfx-auth-shell {
    padding-inline: 20px;
  }

  .mfx-auth-theme {
    right: 20px;
  }

  .mfx-auth-theme > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .mfx-auth-card {
    padding: 26px 20px;
    border-radius: 15px;
  }
}

@media (min-width: 1440px) {
  .mfx-auth-layout {
    width: min(1060px, 100%);
  }
}

@media (min-width: 1920px) {
  .mfx-auth-layout {
    width: 1100px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
