*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #090b10;
  --surface: rgba(18, 22, 32, 0.82);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --error: #f87171;
  --radius: 14px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow: hidden;
}

.page__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.page__glow--a {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -80px;
  background: rgba(99, 102, 241, 0.22);
}

.page__glow--b {
  width: 360px;
  height: 360px;
  bottom: -100px;
  right: -60px;
  background: rgba(16, 185, 129, 0.12);
}

.auth {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 36px 32px 28px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 24px 64px rgba(0, 0, 0, 0.45);
}

.auth__header {
  text-align: center;
  margin-bottom: 32px;
}

.auth__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.auth__logo svg {
  width: 26px;
  height: 26px;
}

.auth__title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth__subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.45;
}

.auth__form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.field__label {
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
}

.field__input {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field__input::placeholder {
  color: #64748b;
}

.field__input:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.field__input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field__password-wrap {
  position: relative;
}

.field__password-wrap .field__input {
  padding-right: 44px;
}

.field__toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.field__toggle:hover {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
}

.field__toggle svg {
  width: 18px;
  height: 18px;
}

.auth__error {
  min-height: 20px;
  margin: -4px 0 0;
  font-size: 13px;
  color: var(--error);
  text-align: center;
  line-height: 1.4;
}

.auth__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--accent-glow);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.auth__submit:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45);
}

.auth__submit:active:not(:disabled) {
  transform: scale(0.985);
}

.auth__submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: #64748b;
}

.auth__domain {
  color: #94a3b8;
  font-weight: 500;
}

.auth__dot {
  opacity: 0.4;
}

@media (max-width: 480px) {
  .auth {
    padding: 28px 22px 22px;
    border-radius: 16px;
  }

  .auth__title {
    font-size: 22px;
  }
}
