/* Login gate styled with the DeepSeek Harness design tokens
   (see dsh-client-ui-theme/src/styles/design-platform.css). */

:root {
  color-scheme: light dark;

  --bg: rgb(255, 255, 255);
  --surface: rgb(255, 255, 255);
  --text: rgb(15, 17, 21);
  --text-2: rgb(97, 102, 107);
  --text-3: rgb(129, 133, 140);
  --border: rgba(0, 0, 0, 0.1);
  --border-soft: rgba(0, 0, 0, 0.04);
  --field-bg: rgba(38, 49, 72, 0.03);
  --field-bg-focus: rgba(38, 49, 72, 0.05);
  --accent: rgb(65, 118, 230);
  --accent-hover: rgb(56, 104, 205);
  --accent-ring: rgba(65, 118, 230, 0.28);
  --danger: rgb(200, 60, 60);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.08);
  --glow: radial-gradient(60% 60% at 50% 0%, rgba(65, 118, 230, 0.1), transparent 70%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: rgb(21, 21, 23);
    --surface: rgb(35, 35, 36);
    --text: rgb(249, 250, 251);
    --text-2: rgb(207, 211, 214);
    --text-3: rgb(129, 133, 140);
    --border: rgba(255, 255, 255, 0.12);
    --border-soft: rgba(255, 255, 255, 0.06);
    --field-bg: rgba(255, 255, 255, 0.04);
    --field-bg-focus: rgba(255, 255, 255, 0.07);
    --accent: rgb(86, 134, 254);
    --accent-hover: rgb(122, 170, 255);
    --accent-ring: rgba(86, 134, 254, 0.32);
    --danger: rgb(242, 90, 90);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 48px rgba(0, 0, 0, 0.45);
    --glow: radial-gradient(60% 60% at 50% 0%, rgba(86, 134, 254, 0.14), transparent 70%);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(
    --dsw-font-family,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    'PingFang SC',
    'Hiragino Sans GB',
    'Microsoft YaHei',
    'Helvetica Neue',
    Helvetica,
    Arial,
    sans-serif
  );
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--glow);
  pointer-events: none;
}

.shell {
  position: relative;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px 28px;
  box-shadow: var(--shadow);
  animation: rise 0.24s ease-out;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand img {
  display: block;
  border-radius: 9px;
}

.brand-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-2);
}

h1 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0 0 26px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-3);
}

form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

input[type='text'],
input[type='password'] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

input::placeholder {
  color: var(--text-3);
}

input[type='text']:hover,
input[type='password']:hover {
  border-color: var(--border);
  background: var(--field-bg-focus);
}

input[type='text']:focus,
input[type='password']:focus {
  border-color: var(--accent);
  background: var(--field-bg-focus);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.password {
  position: relative;
  display: block;
}

.password input {
  padding-right: 44px;
}

.reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.reveal:hover {
  color: var(--text-2);
  background: var(--field-bg-focus);
}

.reveal:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.error {
  margin: -4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 6px;
}

.error:empty {
  display: none;
}

.error:not(:empty)::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.submit {
  position: relative;
  height: 44px;
  margin-top: 4px;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.06s;
}

.submit:hover:not(:disabled) {
  background: var(--accent-hover);
}

.submit:active:not(:disabled) {
  transform: translateY(1px);
}

.submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.submit:disabled {
  cursor: default;
  opacity: 0.85;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.submit.busy .spinner {
  display: inline-block;
}

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

.foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

@media (max-width: 420px) {
  .card {
    padding: 32px 22px 22px;
    border-radius: 16px;
  }
  h1 {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
