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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ── LEFT PANEL ─────────────────────────────────────────── */
.panel-left {
  flex: 0 0 50%;
  background: linear-gradient(160deg, #0f6cbd 0%, #0a4f9c 40%, #052a5c 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.panel-left::before {
  content: "";
  position: absolute;
  top: -120px;
  left: -80px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.brand {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.18);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon svg { width: 20px; height: 20px; }

.panel-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; }

.panel-body h1 {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.6px;
  margin-bottom: 18px;
  max-width: 420px;
}

.panel-body p {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255,255,255,0.78);
  max-width: 400px;
  margin-bottom: 52px;
}

.stats { display: flex; gap: 48px; }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

.panel-footer {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.2px;
}

/* ── RIGHT PANEL ────────────────────────────────────────── */
.panel-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 48px 32px;
  overflow-y: auto;
}

.form-card { width: 100%; max-width: 380px; }

.form-card h2 {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.form-card .subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 32px;
}

/* SSO buttons */
.btn-sso {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  margin-bottom: 12px;
}

.btn-sso:hover {
  border-color: #9ca3af;
  background: #f9fafb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.btn-sso.primary-sso {
  border-color: #0078d4;
  color: #0078d4;
}

.btn-sso.primary-sso:hover {
  background: #f0f7ff;
  border-color: #005ea2;
  box-shadow: 0 1px 4px rgba(0,120,212,0.15);
}

/* Microsoft 4-square logo */
.ms-logo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.ms-logo span { display: block; }
.ms-r { background: #f25022; }
.ms-g { background: #7fba00; }
.ms-b { background: #00a4ef; }
.ms-y { background: #ffb900; }

/* divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* form fields */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder { color: #9ca3af; }

.field input:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 3px rgba(0,120,212,0.12);
}

.field input.is-invalid {
  border-color: #dc2626;
}

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.field-row label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.forgot {
  font-size: 13px;
  color: #0078d4;
  text-decoration: none;
  font-weight: 500;
}
.forgot:hover { text-decoration: underline; }

/* validation error text */
.field-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
}

/* alert */
.alert {
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
  margin-bottom: 18px;
}
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* remember me */
.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 24px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.remember input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #0078d4;
  cursor: pointer;
  flex-shrink: 0;
}

/* sign in button */
.btn-signin {
  width: 100%;
  padding: 12px;
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  letter-spacing: 0.1px;
}

.btn-signin:hover {
  background: #005ea2;
  box-shadow: 0 4px 12px rgba(0,120,212,0.3);
}

.btn-signin:active { background: #004e8c; }

.legal {
  margin-top: 20px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  line-height: 1.6;
}

.legal a { color: #6b7280; text-decoration: underline; }
.legal a:hover { color: #374151; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  body { flex-direction: column; height: auto; overflow: auto; }
  .panel-left { flex: none; padding: 36px 28px 44px; min-height: 340px; }
  .panel-body h1 { font-size: 26px; }
  .stats { gap: 28px; }
  .stat-value { font-size: 22px; }
  .panel-right { padding: 40px 24px; }
}
