:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #202124;
  background: #f3f4f6;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f3f4f6;
}

button,
input { font: inherit; }

button { cursor: pointer; }

.shell {
  display: grid;
  grid-template-columns: minmax(300px, 42%) minmax(360px, 1fr);
  width: min(1040px, calc(100vw - 48px));
  min-height: 600px;
  margin: clamp(24px, 7vh, 72px) auto;
  overflow: hidden;
  border: 1px solid #dfe1e5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 44px rgba(32, 33, 36, 0.1);
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 600px;
  padding: 52px 48px;
  color: #ffffff;
  background: #24272c;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: #d2252d;
}

.brand-logo {
  width: min(250px, 100%);
  height: auto;
  padding: 7px 10px;
  border-radius: 6px;
  background: #ffffff;
  object-fit: contain;
}

.brand-copy { margin: auto 0; }

.eyebrow {
  margin: 0 0 10px;
  color: #b4232a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-panel .eyebrow { color: #ffb4b8; }

h1,
h2,
p { letter-spacing: 0; }

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.25;
}

.brand-note {
  max-width: 310px;
  margin: 16px 0 0;
  color: #c9cdd4;
  font-size: 15px;
  line-height: 1.7;
}

.environment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: #c9cdd4;
  font-size: 13px;
}

.environment span,
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f9e62;
}

.auth-panel {
  display: grid;
  align-items: center;
  padding: 64px clamp(40px, 7vw, 88px);
}

.view { width: 100%; max-width: 410px; margin: 0 auto; }
.view[hidden] { display: none; }
.view-centered { text-align: center; color: #6b7078; }

.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 16px;
  border: 3px solid #e1e3e7;
  border-top-color: #b4232a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.form-header { margin-bottom: 30px; }

h2 {
  margin: 0;
  color: #202124;
  font-size: 24px;
  line-height: 1.35;
}

.form-subtitle {
  margin: 10px 0 0;
  color: #6b7078;
  font-size: 14px;
}

label {
  display: block;
  margin: 18px 0 8px;
  color: #34373c;
  font-size: 14px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #c9cdd4;
  border-radius: 6px;
  color: #202124;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:hover { border-color: #858b94; }

input:focus {
  border-color: #b4232a;
  box-shadow: 0 0 0 3px rgba(180, 35, 42, 0.12);
}

.field-note {
  margin: 7px 0 0;
  color: #777c84;
  font-size: 12px;
  line-height: 1.5;
}

.form-message {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-left: 3px solid;
  font-size: 13px;
  line-height: 1.5;
}

.error { border-color: #b4232a; color: #8f1820; background: #fff2f2; }
.success { border-color: #2f9e62; color: #216e46; background: #eef9f2; }

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 6px;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.primary-button {
  width: 100%;
  margin-top: 24px;
  border: 1px solid #b4232a;
  color: #ffffff;
  background: #b4232a;
}

.primary-button:hover { background: #941c23; border-color: #941c23; }
.primary-button:disabled { cursor: not-allowed; opacity: 0.65; }

.secondary-button {
  padding: 0 16px;
  border: 1px solid #c9cdd4;
  color: #34373c;
  background: #ffffff;
}

.secondary-button:hover { border-color: #858b94; background: #f7f8f9; }

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5e7ea;
}

.workspace-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.account-summary { margin: 0; }

.account-summary div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 17px 0;
  border-bottom: 1px solid #eceef0;
}

.account-summary dt { color: #777c84; font-size: 14px; }
.account-summary dd { margin: 0; color: #282b30; font-size: 14px; font-weight: 600; }
.account-summary dd:last-child { display: flex; align-items: center; gap: 8px; }

@media (max-width: 760px) {
  body { background: #ffffff; }
  .shell {
    display: block;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .brand-panel {
    min-height: auto;
    padding: 26px 24px 24px;
  }
  .brand-panel::before { inset: auto 0 0; width: auto; height: 4px; }
  .brand-logo { width: 208px; }
  .brand-copy { margin: 30px 0 24px; }
  h1 { font-size: 28px; }
  .brand-note { margin-top: 10px; }
  .auth-panel { padding: 40px 24px 56px; }
  .view { max-width: 480px; }
  .workspace-header { align-items: flex-start; }
  .workspace-actions { max-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .spinner { animation-duration: 1.8s; }
}
