*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.hidden {
  display: none !important;
}

body.ms-body {
  font-family: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(0, 120, 212, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(0, 188, 242, 0.15) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 70% 10%, rgba(135, 100, 184, 0.1) 0%, transparent 50%),
    linear-gradient(160deg, #eef6fc 0%, #f8fbfe 40%, #edf4fa 100%);
  position: relative;
  overflow: hidden;
}

/* Abstract geometric shapes like Microsoft login bg */
body.ms-body::before,
body.ms-body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body.ms-body::before {
  width: 420px;
  height: 420px;
  top: -80px;
  right: -60px;
  background: linear-gradient(135deg, rgba(0, 120, 212, 0.12), rgba(0, 188, 242, 0.08));
  transform: rotate(25deg);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 30% 100%);
}

body.ms-body::after {
  width: 380px;
  height: 380px;
  bottom: -100px;
  left: -80px;
  background: linear-gradient(225deg, rgba(0, 120, 212, 0.1), rgba(135, 100, 184, 0.06));
  transform: rotate(-15deg);
  clip-path: polygon(0 30%, 70% 0, 100% 100%, 0 100%);
}

.ms-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 440px;
  padding: 1rem;
}

.ms-card {
  background: #fff;
  width: 100%;
  padding: 44px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 0 2px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
}

.ms-logo {
  margin-bottom: 16px;
}

.ms-title {
  font-size: 24px;
  font-weight: 600;
  color: #1b1b1b;
  margin-bottom: 16px;
  line-height: 1.2;
}

.ms-title-sm {
  font-size: 20px;
  margin-top: 8px;
}

.ms-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #666;
  padding: 6px 0 8px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  color: #1b1b1b;
  background: transparent;
  margin-bottom: 8px;
}

.ms-input::placeholder {
  color: #666;
}

.ms-input:focus {
  border-bottom-color: #0067b8;
  border-bottom-width: 2px;
  padding-bottom: 7px;
}

.ms-links {
  font-size: 13px;
  color: #1b1b1b;
  margin: 8px 0;
}

.ms-links a {
  color: #0067b8;
  text-decoration: none;
}

.ms-links a:hover {
  text-decoration: underline;
  color: #004578;
}

.ms-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.ms-btn {
  font-family: inherit;
  font-size: 15px;
  padding: 4px 24px;
  min-width: 108px;
  height: 32px;
  border: none;
  cursor: pointer;
  line-height: 32px;
}

.ms-btn-primary {
  background: #0067b8;
  color: #fff;
}

.ms-btn-primary:hover {
  background: #005a9e;
}

.ms-btn-secondary {
  background: #ccc;
  color: #1b1b1b;
}

.ms-btn-secondary:hover {
  background: #b8b8b8;
}

/* User chip on password step */
.ms-user-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: #1b1b1b;
  margin-bottom: 4px;
}

.ms-change {
  font-size: 13px;
  color: #0067b8;
  text-decoration: none;
  width: 100%;
  margin-top: 2px;
}

.ms-change:hover {
  text-decoration: underline;
}

/* Sign-in options bar */
.ms-options {
  background: #fff;
  width: 100%;
  padding: 10px 44px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 0 2px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #1b1b1b;
  cursor: pointer;
}

.ms-options:hover {
  background: #f5f5f5;
}

.ms-footer {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 12px 16px;
  display: flex;
  gap: 16px;
  font-size: 12px;
  z-index: 2;
}

.ms-footer a {
  color: #616161;
  text-decoration: none;
}

.ms-footer a:hover {
  text-decoration: underline;
}

.ms-footer span {
  color: #616161;
  cursor: pointer;
}

/* Loading step */
.ms-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 0 16px;
  min-height: 120px;
}

.ms-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #edebe9;
  border-top-color: #0067b8;
  border-radius: 50%;
  animation: ms-spin 0.8s linear infinite;
}

.ms-loading-text {
  margin-top: 20px;
  font-size: 15px;
  color: #1b1b1b;
}

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

@media (max-width: 480px) {
  .ms-card {
    padding: 28px 24px;
  }

  .ms-options {
    padding: 10px 24px;
  }
}
