:root {
  --ink: #111827;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #f3f4f6;
  --input-bg: #f9fafb;
  --input-border: #e5e7eb;
  --card: #ffffff;
  --track: rgb(182, 182, 182);
  --verified: #21cc4c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  color: var(--ink);
  background: #f9fafb;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.stage {
  position: relative;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.auth-stage-video-root {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-stage-video-base {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, #f9fafb, #f3f4f6);
}

.auth-stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.auth-stage-video-scrim {
  position: absolute;
  inset: 0;
  background: rgba(229, 231, 235, 0.8);
}

.stage-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem 1.5rem;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 21rem;
}

.brand-logo {
  position: relative;
  margin-bottom: 1.25rem;
  transition: transform 0.5s ease, margin 0.5s ease;
}

.brand-logo--compact {
  margin-bottom: 0.5rem;
  transform: scale(0.92);
}

.brand-logo-glow {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: linear-gradient(to bottom right, #60a5fa, #a855f7, #ec4899);
  filter: blur(16px);
  opacity: 0.25;
  animation: pulse-glow 2s ease-in-out infinite;
}

.brand-logo img {
  position: relative;
  z-index: 1;
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.12));
}

.brand-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  color: #111827;
  line-height: 1.25;
}

.login-subtitle {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
}

.login-panel {
  width: 100%;
  max-width: 21rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ui-card {
  width: 100%;
  background: var(--card);
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--line);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.field-wrap {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  display: inline-flex;
  pointer-events: none;
}

.ui-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  font: inherit;
  font-size: 0.875rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 0.5rem;
  color: var(--ink);
  outline: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ui-input--password {
  padding-right: 2.25rem;
}

.ui-input::placeholder {
  color: #9ca3af;
}

.ui-input:focus {
  background: #fff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.field-toggle {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #9ca3af;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
}

.field-toggle:hover {
  color: #4b5563;
}

.slider-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.verify-slider {
  position: relative;
  width: 100%;
  height: 34px;
  border-radius: 10px;
  background: var(--track);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
  user-select: none;
  cursor: pointer;
  transition: background-color 0.4s ease;
  outline: none;
}

.verify-slider.is-verified {
  background: var(--verified);
  cursor: default;
}

.verify-slider-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  font-size: 0.75rem;
  color: #4b5563;
}

.verify-slider.is-verified .verify-slider-label {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  gap: 0.375rem;
}

.verify-knob {
  position: absolute;
  width: 26px;
  height: 26px;
  top: 4px;
  left: 4px;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 2;
  cursor: grab;
  transition: left 0.4s ease, box-shadow 0.4s ease;
}

.verify-slider.is-dragging .verify-knob {
  transition: none;
  cursor: grabbing;
}

.verify-slider.is-verified .verify-knob {
  display: none;
}

.ui-btn-gradient {
  width: 100%;
  border: none;
  border-radius: 0.5rem;
  padding: 0.625rem 1rem;
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, #111827 0%, #000 100%);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.ui-btn-gradient:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

.ui-btn-gradient:active {
  transform: scale(0.98);
}

.ui-btn-gradient:disabled {
  opacity: 0.5;
  cursor: wait;
}

.form-hint {
  margin: 0;
  min-height: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.form-hint.error {
  color: #b91c1c;
}

.form-hint.ok {
  color: #047857;
}

.login-back {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
  transition: color 0.15s ease;
}

.login-back:hover {
  color: #374151;
}

.startup-dock {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 100%;
  padding: 0.75rem 1.5rem 1.5rem;
}

.startup-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.startup-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  border-radius: 9999px;
  background: linear-gradient(to right, #111827, #000);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease, filter 0.2s ease;
}

.startup-cta-btn:hover {
  filter: brightness(1.08);
}

.startup-cta-btn:active {
  transform: scale(0.98);
}

.dock-versions {
  margin: 0.25rem 0 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.dock-versions p {
  margin: 0;
}

.dock-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.25rem;
  margin-bottom: 0.5rem;
}

.dock-message {
  font-size: 0.75rem;
  color: #4b5563;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.dock-percent {
  font-size: 0.75rem;
  color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.dock-bar {
  height: 0.375rem;
  width: 100%;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.dock-bar-fill {
  height: 100%;
  background: linear-gradient(to right, #3b82f6, #a855f7);
  border-radius: inherit;
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes startupCtaPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes loginSubtitleEmerge {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loginFormEmerge {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.startup-cta-pop {
  animation: startupCtaPop 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

.login-subtitle-emerge {
  animation: loginSubtitleEmerge 0.45s ease-out 0.18s both;
}

.login-form-emerge {
  animation: loginFormEmerge 0.52s cubic-bezier(0.34, 1.2, 0.64, 1) 0.32s both;
}

.login-back-emerge {
  animation: loginSubtitleEmerge 0.4s ease-out 0.52s both;
}

@media (max-width: 420px) {
  .stage-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .startup-dock {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
