:root {
  --auth-ink: #0f172a;
  --auth-body: #152033;
  --auth-muted: #64748b;
  --auth-muted-soft: #94a3b8;
  --auth-accent: #0f5d5d;
  --auth-accent-strong: #0b4a4a;
  --auth-surface: #ffffff;
  --auth-surface-soft: #fbfdfd;
  --auth-line: #e4e9ef;
  --auth-line-soft: rgba(15, 23, 42, 0.09);
  --auth-wash: linear-gradient(135deg, #f8fbfa, #eef6f3 48%, #f8f4ee);
  --auth-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  --auth-radius: 16px;
  --auth-font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --auth-error-bg: #fde8e8;
  --auth-error-text: #8a2e2e;
  --auth-error-border: rgba(138, 46, 46, 0.22);
  --auth-success-bg: #ecfdf5;
  --auth-success-text: #047857;
  --auth-success-border: rgba(16, 185, 129, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--auth-font);
  color: var(--auth-body);
}

.auth-body h1,
.auth-body h2,
.auth-body h3 {
  font-family: var(--auth-font);
}

.auth-body {
  min-height: 100vh;
  background: var(--auth-wash);
  display: grid;
  place-items: center;
  padding: 18px;
}

.auth-shell {
  width: min(420px, 100%);
}

.auth-card {
  position: relative;
  overflow: hidden;
  background: var(--auth-surface);
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius);
  padding: 22px 18px 18px;
  box-shadow: var(--auth-shadow);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #0f5d5d, #1a7a72 55%, #b8a88a);
}

.auth-head {
  text-align: center;
  margin-bottom: 12px;
}

.auth-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--auth-line-soft);
  background: #fff;
}

.auth-title {
  margin: 10px 0 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--auth-ink);
}

.auth-subtitle {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--auth-muted);
  text-align: center;
}

.auth-messages {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-message {
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 10px;
  border: 1px solid transparent;
}

.auth-message-success {
  background: var(--auth-success-bg);
  border-color: var(--auth-success-border);
  color: var(--auth-success-text);
}

.auth-message-error,
.auth-message-danger {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--auth-error-bg);
  border-color: var(--auth-error-border);
  color: var(--auth-error-text);
  font-weight: 700;
  animation: auth-error-in 180ms ease, auth-shake 320ms ease 40ms;
}

.auth-message-error::before,
.auth-message-danger::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 999px;
  background: currentColor;
}

.auth-message-warning {
  background: #fff7ed;
  border-color: rgba(217, 119, 6, 0.18);
  color: #b45309;
}

.auth-message-info {
  background: #f8fafc;
  border-color: var(--auth-line);
  color: #475569;
}

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

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

.auth-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--auth-muted-soft);
}

.auth-input,
.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(100, 116, 139, 0.28);
  border-radius: 10px;
  padding: 0 10px;
  font-family: var(--auth-font);
  font-size: 12px;
  font-weight: 700;
  color: var(--auth-body);
  background: var(--auth-surface-soft);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.auth-input:hover {
  border-color: rgba(15, 93, 93, 0.28);
}

.auth-input:focus {
  outline: none;
  border-color: rgba(15, 93, 93, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 93, 93, 0.12);
}

.auth-input.is-invalid {
  border-color: rgba(138, 46, 46, 0.45);
  background: #fffafa;
}

.auth-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(138, 46, 46, 0.10);
}

@keyframes auth-error-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes auth-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-3px);
  }
  40% {
    transform: translateX(3px);
  }
  60% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
}

.auth-field-error {
  display: none;
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--auth-error-text);
  font-weight: 700;
}

.auth-field-error.is-visible {
  display: block;
  animation: auth-error-in 160ms ease;
}

.auth-field-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--auth-muted);
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--auth-error-bg);
  border: 1px solid var(--auth-error-border);
  color: var(--auth-error-text);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  padding: 8px 10px;
  animation: auth-error-in 180ms ease, auth-shake 320ms ease 40ms;
}

.auth-error::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 999px;
  background: currentColor;
}

.auth-form.is-invalid .auth-input.is-invalid {
  animation: auth-shake 280ms ease;
}

.auth-button,
.auth-button-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--auth-accent);
  border-radius: 10px;
  background: var(--auth-accent);
  color: #fff;
  font-family: var(--auth-font);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.auth-button:hover,
.auth-button-link:hover {
  transform: translateY(-1px);
  background: var(--auth-accent-strong);
  border-color: var(--auth-accent-strong);
}

.auth-button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.auth-link {
  justify-self: center;
  font-size: 11px;
  font-weight: 850;
  color: var(--auth-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-align: center;
}

.auth-link:hover {
  color: var(--auth-accent-strong);
}

.auth-form p {
  margin: 0;
}

.auth-form ul {
  margin: 0;
  padding-left: 16px;
  color: var(--auth-muted);
  font-size: 11px;
  line-height: 1.35;
}

.auth-form ul.errorlist {
  list-style: none;
  padding: 0;
  color: var(--auth-error-text);
  font-weight: 700;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 18px 14px 14px;
  }
}
