:root {
  --bg: #f3f2f1;
  --card-bg: #ffffff;
  --text: #1f1f1f;
  --muted: #605e5c;
  --border: #e1dfdd;
  --primary: #0078d4;
  --primary-hover: #106ebe;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.btn-microsoft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-microsoft:hover {
  background: var(--primary-hover);
}

.ms-logo {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 18px;
  height: 18px;
}

.ms-logo span {
  display: block;
  width: 100%;
  height: 100%;
}

.ms-logo span:nth-child(1) { background: #f25022; }
.ms-logo span:nth-child(2) { background: #7fba00; }
.ms-logo span:nth-child(3) { background: #00a4ef; }
.ms-logo span:nth-child(4) { background: #ffb900; }

.btn-secondary {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 20px;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.btn-secondary:hover {
  background: var(--primary);
  color: #fff;
}

.hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
}

.profile {
  text-align: left;
  margin: 24px 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 8px;
}

.profile dt {
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
}

.profile dd {
  margin: 0;
  font-size: 14px;
  word-break: break-all;
}

.field-label {
  display: block;
  text-align: left;
  margin: 12px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.15);
}

.rules {
  text-align: left;
  margin: 16px 0 12px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}

.rules li {
  margin: 2px 0;
}

.rules li {
  list-style: none;
  padding-left: 22px;
  position: relative;
}

.rules li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--muted);
}

.rules .rule-ok {
  color: #107c10;
}

.rules .rule-ok::before {
  content: "OK";
  font-size: 11px;
  font-weight: 700;
  left: 0;
  color: #107c10;
}

.rules .rule-bad {
  color: #a4262c;
}

.rules .rule-bad::before {
  content: "x";
  font-weight: 700;
  color: #a4262c;
}

.errors {
  background: #fde7e9;
  border: 1px solid #f1a4a8;
  color: #a4262c;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 8px 0 12px;
  text-align: left;
  font-size: 13px;
}

.errors ul {
  margin: 0;
  padding-left: 18px;
}

button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #107c10;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-microsoft + .btn-secondary {
  margin-top: 12px;
}
