@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-0: #14171b;
  --bg-1: #1b1f24;
  --bg-2: #232932;
  --border: #14181c;
  --border-soft: rgba(255,255,255,0.08);
  --text: #dfe5eb;
  --text-dim: #aeb7c1;
  --text-faint: #7f8993;
  --accent: #3d79c4;
  --accent-2: #8dc8ff;
  --success: #7fb0eb;
  --error: #d98787;
  --shadow-lg: 0 26px 54px rgba(0,0,0,0.36);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body.login-body {
  font-family: 'IBM Plex Sans', 'Inter', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 16%, rgba(78, 154, 255, 0.12), transparent 28%),
    radial-gradient(circle at 74% 48%, rgba(86, 190, 255, 0.08), transparent 24%),
    linear-gradient(135deg, var(--bg-0) 0%, var(--bg-1) 44%, #16191e 100%);
  overflow: hidden;
}

.login-wrap {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-preview {
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.preview-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 28px 30px 32px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}

.preview-scroll::-webkit-scrollbar {
  width: 10px;
}

.preview-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.preview-poster-wrap {
  position: relative;
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(36px);
  animation: glowFloat 9s ease-in-out infinite;
}

.poster-glow-a {
  width: 320px;
  height: 320px;
  left: -2%;
  top: 12%;
  background: rgba(61, 121, 196, 0.16);
}

.poster-glow-b {
  width: 260px;
  height: 260px;
  right: 2%;
  bottom: 8%;
  background: rgba(141, 200, 255, 0.11);
  animation-delay: -3s;
}

.preview-poster {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  border: 1px solid var(--border-soft);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  box-shadow: var(--shadow-lg);
  animation: posterRise .7s ease;
}

.preview-poster img {
  display: block;
  width: 100%;
  height: auto;
}

.login-card {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 32px 36px;
  border-left: 1px solid rgba(255,255,255,0.05);
  background: linear-gradient(180deg, rgba(30, 33, 38, 0.98), rgba(23, 25, 29, 0.98));
}

.login-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.login-back-link {
  color: var(--text-faint);
  text-decoration: none;
  font-size: 12px;
  transition: color .12s ease;
}

.login-back-link:hover {
  color: var(--accent-2);
}

.auth-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  padding: 2px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}

.auth-tab {
  flex: 1;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.auth-tab:hover {
  color: var(--text-dim);
  background: rgba(255,255,255,0.03);
}

.auth-tab.active {
  color: var(--text);
  background: linear-gradient(180deg, #353a41 0%, #2d3238 100%);
  border-color: rgba(255,255,255,0.06);
}

.auth-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.login-form.auth-form {
  display: none;
}

.login-form.auth-form.active {
  display: flex;
}

.login-form {
  flex-direction: column;
}

.login-heading {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.login-desc {
  margin: 0 0 24px;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.6;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}

.login-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #14181c;
  border-radius: 10px;
  background: linear-gradient(180deg, #1e2126 0%, #181b20 100%);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.login-field input::placeholder {
  color: rgba(255,255,255,0.22);
}

.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61,121,196,0.16);
}

.login-btn {
  width: 100%;
  height: 42px;
  margin-top: 4px;
  border: 1px solid #214f82;
  border-radius: 10px;
  background: linear-gradient(180deg, #4b86cf 0%, #326bac 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .12s ease, transform .08s ease;
}

.login-btn:hover {
  filter: brightness(1.06);
}

.login-btn:active {
  transform: scale(0.985);
}

.auth-toggle-text {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}

.auth-toggle-text a {
  color: var(--accent-2);
  text-decoration: none;
}

.auth-toggle-text a:hover {
  text-decoration: underline;
}

.login-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-msg {
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.6;
}

.footer-msg.is-error {
  color: var(--error);
}

.footer-msg.is-success {
  color: var(--success);
}

@keyframes glowFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.04); }
}

@keyframes posterRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Privacy ── */
.privacy-note {
  margin-top: 10px;
  text-align: center;
  font-size: 10px;
  color: var(--text-faint);
}

.privacy-note a {
  color: var(--accent-2);
  text-decoration: none;
}

.privacy-note a:hover {
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .login-wrap {
    grid-template-columns: 1fr;
  }

  .login-preview {
    display: none;
  }

  .login-card {
    height: 100vh;
    border-left: none;
  }
}

@media (max-width: 560px) {
  body.login-body {
    overflow-y: auto;
  }

  .login-card {
    min-height: 100vh;
    height: auto;
    padding: 28px 18px;
  }

  .login-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-stage {
    min-height: 0;
  }
}

/* ── Auth extras (captcha, password hint, toast, etc.) ── */
.input-stack {
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-stack input {
  flex: 1;
}

.input-toggle {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #14181c;
  border-radius: 10px;
  background: linear-gradient(180deg, #35393d 0%, #2e3135 100%);
  color: var(--text-faint);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s ease;
}

.input-toggle:hover {
  color: var(--text);
}

.auth-error {
  min-height: 20px;
  margin: 2px 0;
  font-size: 11px;
  color: #cb5c5c;
}

.pw-hint {
  min-height: 18px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-faint);
}

.login-field input.error {
  border-color: #cb5c5c;
}

.login-field input.valid {
  border-color: #63b56d;
}

.captcha-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.captcha-canvas {
  flex-shrink: 0;
  border: 1px solid #14181c;
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  background: #202328;
}

.captcha-canvas canvas {
  display: block;
  border-radius: 10px;
}

.captcha-row input {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #14181c;
  border-radius: 10px;
  background: linear-gradient(180deg, #202328 0%, #1b1e22 100%);
  color: var(--text);
  font-size: 14px;
  font-family: monospace;
  outline: none;
  letter-spacing: 2px;
  transition: border-color .12s ease;
}

.captcha-row input:focus {
  border-color: var(--accent);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-container .toast {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #14181c;
  background: rgba(40,43,48,0.96);
  color: var(--text);
  font-size: 11px;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: auto;
  text-align: center;
}

.toast-container .toast.show {
  opacity: 1;
}

.toast-container .toast.toast-success {
  border-color: rgba(99,181,109,0.3);
}

.toast-container .toast.toast-error {
  border-color: rgba(203,92,92,0.3);
  color: #ffd2d2;
}
