:root {
  --ad-ink: #0f172a;
  --ad-muted: #64748b;
  --ad-line: #e5e7eb;
  --ad-line-soft: #eef2f7;
  --ad-white: #ffffff;
  --ad-bg: #ffffff;
  --ad-input-bg: #eef4ff;
  --ad-input-bg-focus: #ffffff;
  --ad-primary: #1d4ed8;
  --ad-primary-hover: #1e40af;
  --ad-primary-focus: rgba(29, 78, 216, 0.18);
  --ad-link: #1d4ed8;
  --ad-success: #166534;
  --ad-error: #b42318;
  --ad-info: #0f4fbf;
  --ad-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ad-ink);
  background: var(--ad-bg);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.left {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--ad-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.28);
  margin-bottom: 16px;
}

h1 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  font-weight: 700;
  color: var(--ad-ink);
}

.brand-sub {
  margin: 0;
  color: var(--ad-muted);
  font-size: 14px;
  text-align: center;
}

.form-shell {
  width: 100%;
  background: var(--ad-white);
  border: 1px solid var(--ad-line);
  border-radius: 16px;
  box-shadow: var(--ad-shadow);
  padding: 28px 26px;
}

.field {
  margin-bottom: 16px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--ad-ink);
  margin-bottom: 6px;
}

.field-label a {
  font-size: 13px;
  font-weight: 600;
  color: var(--ad-link);
  text-decoration: none;
}

.field-label a:hover {
  text-decoration: underline;
}

.input-wrap {
  position: relative;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--ad-input-bg);
  color: var(--ad-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder {
  color: #94a3b8;
}

input:focus {
  background: var(--ad-input-bg-focus);
  border-color: var(--ad-primary);
  box-shadow: 0 0 0 4px var(--ad-primary-focus);
}

.input-wrap .pw-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 4px;
  cursor: pointer;
  color: var(--ad-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.input-wrap .pw-toggle:hover {
  color: var(--ad-ink);
}

.row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.btn-login {
  background: var(--ad-primary);
  color: #fff;
  border: 1px solid var(--ad-primary);
}

.btn-login:hover {
  background: var(--ad-primary-hover);
  border-color: var(--ad-primary-hover);
}

.btn-login:active {
  transform: translateY(1px);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--ad-muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ad-line);
}

.btn-ms {
  background: #fff;
  color: var(--ad-ink);
  border: 1px solid var(--ad-line);
  font-weight: 600;
}

.btn-ms:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-ms .ms-logo {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.note {
  margin-top: 22px;
  font-size: 12px;
  color: var(--ad-muted);
  text-align: center;
}

.state {
  margin-top: 14px;
  font-size: 13px;
  min-height: 18px;
  text-align: center;
  font-weight: 600;
}

.state:empty {
  display: none;
}

.state.info {
  color: var(--ad-info);
}

.state.success {
  color: var(--ad-success);
}

.state.error {
  color: var(--ad-error);
}

@media (max-width: 480px) {
  body {
    padding: 16px;
  }

  .form-shell {
    padding: 22px 18px;
  }

  h1 {
    font-size: 22px;
  }
}
