:root {
  --bg: #05070f;
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --glass: rgba(9, 13, 28, 0.56);
  --border: rgba(255, 255, 255, 0.16);
  --text: #eef1f8;
  --dim: #a5b4ca;
  --danger: #fca5a5;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 72% 56% at 10% 4%, rgba(59, 130, 246, 0.28), transparent 65%),
    radial-gradient(ellipse 70% 65% at 96% 100%, rgba(139, 92, 246, 0.24), transparent 68%),
    linear-gradient(145deg, #05070f 0%, #090d1c 48%, #060914 100%);
}

.page-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.login-card {
  width: min(100%, 440px);
  padding: 38px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.48), 0 0 52px rgba(59, 130, 246, 0.12);
  backdrop-filter: blur(10px) saturate(125%);
  -webkit-backdrop-filter: blur(10px) saturate(125%);
  animation: card-enter 360ms var(--ease-out) both;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.45));
}

.brand-name {
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-name span { color: #67e8f9; }

.intro { margin-bottom: 28px; }

.eyebrow {
  margin: 0 0 10px;
  color: #a78bfa;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.description {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 0.95rem;
  line-height: 1.7;
}

.login-form { display: grid; gap: 18px; }

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

.label-row { display: flex; align-items: center; justify-content: space-between; }

label {
  color: #dce5f5;
  font-size: 0.9rem;
  font-weight: 500;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  outline: none;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(3, 7, 18, 0.46);
  font: inherit;
  line-height: 1.35;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

input::placeholder { color: #8190aa; }

input:hover { border-color: rgba(255, 255, 255, 0.28); }

input:focus {
  border-color: #8b5cf6;
  background: rgba(3, 7, 18, 0.64);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.28);
}

.password-input { position: relative; }

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

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #b8c5db;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 180ms ease, background-color 180ms ease;
  transform: translateY(-50%);
}

.password-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.password-toggle:focus-visible, .submit-button:focus-visible { outline: 3px solid rgba(103, 232, 249, 0.8); outline-offset: 3px; }
.password-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.form-error {
  min-height: 1.3em;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 0.84rem;
  line-height: 1.45;
}

.submit-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  box-shadow: 0 12px 28px rgba(96, 77, 211, 0.34);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  touch-action: manipulation;
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease, filter 180ms ease;
}

.submit-button:hover { box-shadow: 0 15px 34px rgba(96, 77, 211, 0.52); transform: translateY(-1px); }
.submit-button:active { transform: translateY(0); filter: brightness(0.94); }
.submit-button:disabled { cursor: wait; opacity: 0.72; transform: none; }
.submit-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.session-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 28px 0 0;
  color: #9baac1;
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
}

.session-note svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

@keyframes card-enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .page-shell { padding: 16px; }
  .login-card { padding: 30px 22px 26px; border-radius: 24px; }
  .brand { margin-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
