:root {
  --bg-light: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --text-main: #0f172a;
  --text-muted: #64748b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  background-color: var(--bg-light);
  color: var(--text-main);
  display: flex;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: #020617;
  border-top: 1px solid #0f172a;
  color: #f8fafc;
  font-size: 0.85rem;
  padding: 10px 20px;
}

.app-footer a {
  color: #e2e8f0;
  text-decoration: none;
}

.app-footer a:hover {
  color: #93c5fd;
}

.left-panel {
  flex: 1.2;
  position: relative;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  overflow: hidden;
}

#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.brand-content {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 600px;
  text-align: left;
  pointer-events: none;
}

.brand-logo {
  height: 48px;
  margin-bottom: 30px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: #000;
  margin-bottom: 24px;
}

.word-rotator {
  display: block;
  position: relative;
  height: 1.1em;
  overflow: hidden;
  margin-top: 5px;
}

.word-rotator-inner {
  display: flex;
  flex-direction: column;
  transition: transform 0.55s ease;
  will-change: transform;
}

.word-rotator span {
  height: 1.1em;
  padding: 0 4px;
  background: linear-gradient(135deg, #2563eb 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 400;
  max-width: 90%;
}

.right-panel {
  flex: 0.8;
  min-width: 450px;
  max-width: 550px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  position: relative;
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.03);
  z-index: 10;
  padding-bottom: 74px;
}

.footer-version {
  color: #94a3b8;
  font-family: monospace;
  font-size: 0.8rem;
  margin-left: 12px;
}

.login-container {
  width: 100%;
  max-width: 400px;
  animation: appear 0.6s ease-out forwards;
  position: relative;
  z-index: 15;
  background: #ffffff;
  padding: 40px 32px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

@keyframes appear {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.login-header { margin-bottom: 24px; }

.login-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #000;
  margin-bottom: 8px;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: color 0.3s;
}

.form-control {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.password-group { position: relative; }

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #475569;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.password-group .form-control { padding-right: 42px; }

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-group:focus-within .form-label { color: var(--primary); }

.remember-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.btn-submit {
  width: 100%;
  background: #0f172a;
  color: white;
  border: none;
  border-radius: 40px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-submit:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-submit.loading {
  color: transparent;
  pointer-events: none;
}

.btn-submit.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
}

.forgot-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s;
  cursor: pointer;
}

.forgot-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.login-footer {
  margin-top: 30px;
  text-align: center;
  background: #020617;
  border: 1px solid #0f172a;
  border-radius: 14px;
  padding: 12px;
}

.copyright {
  font-size: 0.85rem;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.copyright a {
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.version-tag {
  font-size: 0.75rem;
  color: #f8fafc;
  font-family: monospace;
  margin-top: 4px;
}

.version-title {
  font-weight: 700;
  color: #ffffff;
  display: block;
}

.recaptcha-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  body {
    display: block;
    overflow-y: auto;
  }

  .left-panel { display: none; }

  .right-panel {
    width: 100%;
    max-width: 100%;
    min-width: auto;
    min-height: 100vh;
    justify-content: flex-start;
    box-shadow: none;
    padding-top: 24px;
    padding-bottom: 110px;
    overflow-y: auto;
  }

  .home-link {
    margin-left: 8px;
    margin-bottom: 12px;
  }

  .app-footer { position: static; }
}
