:root {
  color-scheme: dark;
  --bg-main: #0b0e14;
  --bg-header: rgba(11, 14, 20, 0.78);
  --bg-panel: rgba(20, 25, 34, 0.76);
  --bg-subtle: rgba(39, 39, 42, 0.65);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text-primary: #f8fafc;
  --text-main: #cbd5e1;
  --text-muted: #94a3b8;
  --accent: #34d399;
  --accent-cyan: #38bdf8;
  --accent-dim: rgba(52, 211, 153, 0.14);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.12);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  color: var(--text-main);
  font: 14px/1.6 var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ================= PARTICLE AMBIENT LAYER ================= */
.ambient-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

#login-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.17;
  will-change: transform;
}

.orb-emerald {
  width: 500px;
  height: 500px;
  top: -150px;
  left: -120px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  animation: loginOrbFloatA 18s ease-in-out infinite alternate;
}

.orb-cyan {
  width: 460px;
  height: 460px;
  bottom: -140px;
  right: -120px;
  background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
  animation: loginOrbFloatB 22s ease-in-out infinite alternate;
}

.grid-veil {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 35%, transparent 100%);
}

@keyframes loginOrbFloatA {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(48px, 34px, 0) scale(1.08); }
}

@keyframes loginOrbFloatB {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-44px, -36px, 0) scale(1.08); }
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* ================= HEADER ================= */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 52px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
}

.brand b {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-left: 10px;
  border-left: 1px solid var(--border-strong);
}

.back {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  transition: color 120ms ease, border-color 120ms ease;
}

.back:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  text-decoration: none;
}

/* ================= MAIN LAYOUT ================= */
main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 5vw;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 64px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}

.research-intro h1 {
  margin: 16px 0 18px;
  font-size: clamp(32px, 3.6vw, 48px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.research-intro em {
  font-style: normal;
  background: linear-gradient(95deg, var(--accent) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.research-intro p {
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-muted);
}

.project-image {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  background: rgba(20, 25, 34, 0.72);
  backdrop-filter: blur(12px);
  padding: 12px;
  margin-bottom: 24px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42), 0 0 36px rgba(52, 211, 153, 0.14);
}

.cell-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cell-types span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-main);
  background: rgba(20, 25, 34, 0.72);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
}

/* ================= LOGIN CARD ================= */
.login-panel {
  min-width: 0;
}

.login-card {
  background: var(--bg-panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.login-card h2 {
  margin: 12px 0 8px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.description {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

.description.small {
  font-size: 12px;
  margin: 10px 0 14px;
}

.orcid-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 16px;
  background: #f4f4f5;
  color: #141417;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color 120ms ease, transform 120ms ease;
}

.orcid-button:not(:disabled):hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.orcid-button img {
  width: 22px;
  height: 22px;
}

.orcid-button > span:last-child {
  margin-left: auto;
  opacity: 0.65;
}

.status {
  margin: 12px 0 20px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.privacy-note > span {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.privacy-note p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
}

#mfa-form,
#link-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

#mfa-form label,
#link-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-main);
}

#mfa-form input,
#link-form input {
  height: 38px;
  padding: 0 12px;
  background: var(--bg-main);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: var(--text-primary);
}

button.primary,
button.secondary {
  height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
}

button.primary {
  background: var(--text-primary);
  color: var(--bg-main);
  border-color: transparent;
}

button.secondary {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

button.secondary:hover {
  border-color: var(--text-muted);
}

details {
  margin-top: 18px;
}

summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-main);
  user-select: none;
}

.error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--danger-dim);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--danger);
  font-size: 12px;
}

.register-note {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
}

.login-footer {
  margin-top: 14px;
  padding: 0 4px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ================= FOOTER ================= */
footer {
  position: relative;
  z-index: 1;
  height: 44px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  font-size: 11px;
  color: var(--text-muted);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 860px) {
  main {
    grid-template-columns: 1fr;
    padding: 32px 20px;
    gap: 32px;
  }
  .project-image {
    display: none;
  }
  .login-card {
    padding: 24px 20px;
  }
  footer {
    height: auto;
    padding: 14px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
