:root {
  --bg: var(--gp-color-bg);
  --surface: var(--gp-color-surface);
  --text: var(--gp-color-text);
  --muted: var(--gp-color-muted);
  --border: var(--gp-color-border);
  --accent: var(--gp-color-accent);
  --accent-dark: var(--gp-color-accent-dark);
  --font-sans: var(--gp-font-sans);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: linear-gradient(180deg, #f1f3f7 0%, var(--bg) 100%);
  color: var(--text);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-loading-panel {
  width: min(420px, 100%);
  min-height: 230px;
  display: none;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(17, 24, 39, 0.08);
}

.auth-loading-panel img {
  width: 170px;
  height: auto;
  display: block;
}

.auth-loading-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.25;
  color: var(--text);
}

.auth-loading-panel span {
  display: block;
  max-width: 310px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

body.command-ui .auth-loading-panel {
  background: linear-gradient(180deg, rgba(34, 45, 82, 0.94), rgba(25, 34, 65, 0.94));
  border-color: rgba(148, 169, 255, 0.2);
  color: #f5f7ff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

body.command-ui .auth-loading-panel strong {
  color: #f5f7ff;
}

body.command-ui .auth-loading-panel span {
  color: rgba(221, 228, 255, 0.72);
}

body.auth-loading .auth-loading-panel {
  display: grid;
}

body.auth-loading .auth-layout {
  display: none;
}

.auth-layout {
  width: min(980px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  box-shadow: 0 20px 40px rgba(17, 24, 39, 0.08);
}

.auth-form-side {
  padding: 34px 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  margin-bottom: 24px;
}

.brand-image {
  height: 44px;
  width: auto;
  display: block;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #0f1117;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: 0;
}

.mode-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.mode-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #dbe2f4;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
}

.mode-btn {
  border: none;
  background: #fff;
  color: #556488;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.mode-btn.active {
  background: #eef2ff;
  color: #31439f;
}

.email-form {
  display: grid;
  gap: 12px;
}

.field-wrap {
  display: grid;
  gap: 6px;
}

.field-wrap label {
  font-size: 12px;
  color: #4b5563;
  font-weight: 700;
}

.field-wrap input {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid #d4d9e5;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}

.field-wrap input:focus {
  border-color: #a7b5f4;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.password-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #d4d9e5;
  border-radius: 8px;
  overflow: hidden;
}

.password-input-wrap:focus-within {
  border-color: #a7b5f4;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.password-input-wrap input {
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.password-input-wrap input:focus {
  box-shadow: none;
}

.inline-text-btn {
  border: none;
  background: transparent;
  color: #3f4f7b;
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  min-height: 40px;
  cursor: pointer;
}

.inline-text-btn:hover {
  background: #f8faff;
}

.hidden {
  display: none !important;
}

.strength-wrap {
  margin-top: -4px;
}

.strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.strength-bar {
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
}

.strength-bar.active.weak {
  background: #ef4444;
}

.strength-bar.active.medium {
  background: #f59e0b;
}

.strength-bar.active.strong {
  background: #22c55e;
}

.strength-text {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.forgot-password-btn {
  border: none;
  background: transparent;
  color: #3c4cb1;
  font-size: 12px;
  font-weight: 700;
  justify-self: end;
  cursor: pointer;
  padding: 0;
  margin-top: -4px;
}

.forgot-password-btn:hover {
  text-decoration: underline;
}

.primary-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  min-height: 42px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

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

.primary-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.divider {
  margin: 16px 0 12px;
  height: 1px;
  background: #eaedf4;
  position: relative;
}

.divider span {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #8a93a8;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
}

.provider-stack {
  display: grid;
  gap: 10px;
}

.provider-btn {
  border: 1px solid #dbe2f4;
  background: #fff;
  min-height: 42px;
  border-radius: 8px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #2f3a57;
  cursor: pointer;
}

.provider-btn:hover {
  background: #f8faff;
  border-color: #c9d4f5;
}

.provider-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #dbe2f4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.auth-feedback {
  margin: 12px 0 0;
  min-height: 20px;
  font-size: 13px;
  color: #b91c1c;
}

.auth-feedback.success {
  color: #0f766e;
}

.auth-visual-side {
  background: radial-gradient(circle at top right, #7a69ff 0%, #4f49ec 48%, #3b3ed0 100%);
  padding: 18px;
}

.visual-card {
  border-radius: 14px;
  height: 100%;
  min-height: 540px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
}

.visual-grid {
  position: absolute;
  inset: 18px;
  border-radius: 10px;
  background-image:
    linear-gradient(rgba(255,255,255,0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.14) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.55;
}

.visual-orb {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #d9d9e8 40%, #232330 100%);
  box-shadow: 0 20px 28px rgba(0,0,0,0.3);
}

.visual-person {
  position: absolute;
  bottom: 118px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 130px;
  border-radius: 120px;
  background: radial-gradient(circle at 35% 30%, #5a6379 0%, #232839 75%);
  box-shadow: 0 22px 34px rgba(0,0,0,0.34);
}

.visual-copy {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 42px;
  color: #fff;
  z-index: 2;
}

.visual-copy h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.visual-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.9);
}

.visual-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 6px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
}

.dot.active {
  width: 18px;
  background: #fff;
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-visual-side {
    display: none;
  }

  .auth-form-side {
    padding: 24px;
  }
}
