* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;

}

.trading-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.38;
  zoom: 1.1;
}

.login-wrapper,
.page-controls {
  position: relative;
  z-index: 2;
}

.back-home-btn {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 999;
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background:
    radial-gradient(circle at 35% 30%, rgba(129, 140, 248, 0.14), transparent 58%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(9, 14, 26, 0.98));
  color: #e2e8f0;
  box-shadow:
    0 10px 24px rgba(2, 6, 23, 0.22),
    0 0 18px rgba(99, 102, 241, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.back-home-btn:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: rgba(165, 180, 252, 0.52);
  box-shadow:
    0 16px 30px rgba(2, 6, 23, 0.28),
    0 0 28px rgba(99, 102, 241, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.back-home-btn i {
  font-size: 17px;
  line-height: 1;
  transform: translateX(-1px);
  text-decoration: none;
}

.light-theme .back-home-btn {
  background: #ffffff;
  color: #1a202c;
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.dark-theme .back-home-btn {
  background:
    radial-gradient(circle at 35% 30%, rgba(129, 140, 248, 0.14), transparent 58%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(9, 14, 26, 0.98));
  color: #e2e8f0;
}

.login-container {
  position: relative;
  z-index: 2;
  zoom: 0.85;
}

body {
  transition: background 0.3s ease, color 0.3s ease;
}

/* Light Theme */
.light-theme {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.06), transparent 35%),
    linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #1a202c;
}

.light-theme .login-container {
  background: #ffffff;
}

.light-theme .input-field {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #1a202c;
}

.light-theme .input-field:-webkit-autofill,
.light-theme .input-field:-webkit-autofill:hover,
.light-theme .input-field:-webkit-autofill:focus {
  -webkit-text-fill-color: #1a202c;
  -webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
  box-shadow: 0 0 0px 1000px #ffffff inset;
  caret-color: #1a202c;
}

.light-theme .input-field:focus {
  background: #ffffff;
  border-color: #667eea;
}

.light-theme .illustration-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.light-theme .text-primary {
  color: #1a202c;
}

.light-theme .text-secondary {
  color: #4a5568;
}

.light-theme .divider {
  background: #e2e8f0;
}

.light-theme .divider-text {
  background: #ffffff;
  color: #94a3b8;
}

.light-theme .link-text {
  color: #667eea;
}

.light-theme .feature-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
}

.light-theme .theme-toggle,
.light-theme .language-toggle {
  background: #ffffff;
  color: #1a202c;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.light-theme .btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.light-theme .btn-secondary:hover {
  background: #f8fafc;
}

/* Dark Theme */
.dark-theme {
  background:
    radial-gradient(circle at 15% 18%, rgba(99, 102, 241, 0.16), transparent 26%),
    radial-gradient(circle at 82% 76%, rgba(56, 189, 248, 0.12), transparent 28%),
    radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.08), transparent 35%),
    linear-gradient(135deg, #070b16 0%, #0b1220 52%, #10192d 100%);
  color: #e2e8f0;
}

.dark-theme .login-container {
  background:
    linear-gradient(180deg, rgba(13, 18, 34, 0.94), rgba(10, 15, 28, 0.98));
  border: 1px solid rgba(79, 70, 229, 0.22);
  box-shadow:
    0 26px 72px rgba(2, 6, 23, 0.7),
    0 0 42px rgba(99, 102, 241, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark-theme .input-field {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(9, 14, 26, 0.98));
  border: 1px solid rgba(96, 165, 250, 0.18);
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark-theme .input-field:-webkit-autofill,
.dark-theme .input-field:-webkit-autofill:hover,
.dark-theme .input-field:-webkit-autofill:focus {
  -webkit-text-fill-color: #f8fafc;
  -webkit-box-shadow: 0 0 0px 1000px #111827 inset;
  box-shadow: 0 0 0px 1000px #111827 inset;
  caret-color: #f8fafc;
}

.input-field::placeholder {
  opacity: 0.72;
}

.dark-theme .input-field::placeholder {
  color: rgba(226, 232, 240, 0.72);
}

.dark-theme .input-field:focus {
  background:
    linear-gradient(180deg, rgba(12, 18, 34, 0.98), rgba(7, 12, 24, 1));
  border-color: rgba(129, 140, 248, 0.72);
  box-shadow:
    0 0 0 4px rgba(99, 102, 241, 0.12),
    0 0 26px rgba(56, 189, 248, 0.12);
}

.dark-theme .illustration-section {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(17, 24, 39, 0.98) 100%);
}

.dark-theme .text-primary {
  color: #f8fafc;
}

.dark-theme .text-secondary {
  color: #94a3b8;
}

.dark-theme .divider {
  background: #334155;
}

.dark-theme .divider-text {
  background: #0f172a;
  color: #64748b;
}

.dark-theme .link-text {
  color: #a5b4fc;
}

.dark-theme .feature-card {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(10, 15, 28, 0.88));
  border: 1px solid rgba(129, 140, 248, 0.18);
  backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(2, 6, 23, 0.12);
}

.dark-theme .theme-toggle,
.dark-theme .language-toggle {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(9, 14, 26, 0.98));
  color: #e2e8f0;
  border: 1px solid rgba(99, 102, 241, 0.22);
  box-shadow:
    0 10px 24px rgba(2, 6, 23, 0.22),
    0 0 18px rgba(99, 102, 241, 0.08);
}

.dark-theme .btn-secondary {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(10, 15, 28, 0.98));
  color: #e2e8f0;
  border: 1px solid rgba(96, 165, 250, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 22px rgba(2, 6, 23, 0.22);
}

.dark-theme .btn-secondary:hover {
  background:
    linear-gradient(180deg, rgba(20, 28, 48, 0.98), rgba(12, 18, 34, 1));
}

/* Layout */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-container {
  width: 100%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

/* Left */
.illustration-section {
  position: relative;
  overflow: hidden;
  padding: 60px 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.illustration-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.16), transparent 28%),
    radial-gradient(circle at 78% 68%, rgba(56, 189, 248, 0.12), transparent 26%);
  pointer-events: none;
}

.illustration-content {
  position: relative;
  z-index: 2;
  color: #ffffff;
  text-align: center;
  max-width: 460px;
}

.illustration-title {
  display: inline-block;
  text-decoration: none;
  color: #ffffff;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.34),
    0 0 22px rgba(99, 102, 241, 0.18);
}

.illustration-subtitle {
  font-size: 18px;
  line-height: 1.6;
  opacity: 0.92;
  margin-bottom: 34px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.feature-cards {
  display: grid;
  gap: 16px;
}

.feature-card {
  border-radius: 16px;
  padding: 20px;
  text-align: left;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(9, 14, 26, 0.88));
  border: 1px solid rgba(129, 140, 248, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(2, 6, 23, 0.14);
}

.feature-card:hover {
  transform: translateX(8px);
  border-color: rgba(129, 140, 248, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 28px rgba(2, 6, 23, 0.18),
    0 0 24px rgba(99, 102, 241, 0.1);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.26), rgba(56, 189, 248, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.16);
}

.feature-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #ffffff;
}

.feature-description {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
}

/* Right */
.form-section {
  padding: 60px 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-box {
  width: 100%;
  max-width: 430px;
}

.logo {
  display: inline-block;
  font-size: 32px;
  font-weight: 800;
  text-decoration: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.title {
  font-size: 34px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.28),
    0 0 18px rgba(99, 102, 241, 0.12);
}

.subtitle {
  font-size: 15px;
  margin: 0 0 28px;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
}

/* Top controls */
.page-controls {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 999;
}

.theme-toggle,
.language-toggle {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  box-shadow:
    0 10px 24px rgba(2, 6, 23, 0.22),
    0 0 18px rgba(99, 102, 241, 0.08);
  padding: 0;
}

.theme-toggle:hover {
  transform: rotate(180deg);
}

.language-toggle:hover {
  transform: translateY(-2px);
}

.language-toggle img {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  object-fit: cover;
  filter: blur(0.25px) saturate(0.9) contrast(0.95);
}

/* Inputs */
.input-group {
  position: relative;
  margin-bottom: 18px;
  transition: transform 0.2s ease;
}

.input-group.focused {
  transform: translateY(-2px);
}

.input-field {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  outline: none;
  padding: 14px 44px 14px 44px;
  font-size: 14px;
  transition: all 0.25s ease;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  opacity: 0.9;
  pointer-events: none;
  color: #64748b;
  font-size: 15px;
}

.dark-theme .input-icon {
  color: #cbd5e1;
}

.light-theme .input-icon {
  color: #475569;
}

.password-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: #cbd5e1;
  cursor: pointer;
  opacity: 0.72;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: #667eea;
}

/* Options */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
}

.checkbox-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #667eea;
  cursor: pointer;
}

.link-text {
  text-decoration: none;
  font-weight: 600;
}

.strong-link {
  margin-left: 6px;
}

/* Buttons */
.btn-primary {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(165, 180, 252, 0.42);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.98), rgba(79, 70, 229, 0.98));
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  box-shadow:
    0 16px 34px rgba(79, 70, 229, 0.26),
    0 0 24px rgba(124, 58, 237, 0.14);
}

.btn-primary:hover {
  transform: translateY(-1px);
  border-color: rgba(196, 181, 253, 0.6);
  box-shadow:
    0 20px 42px rgba(79, 70, 229, 0.34),
    0 0 28px rgba(124, 58, 237, 0.2);
}

.btn-primary:disabled {
  cursor: not-allowed;
}

.btn-secondary {
  min-height: 48px;
  border-radius: 14px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: rgba(129, 140, 248, 0.28);
  box-shadow:
    0 14px 28px rgba(2, 6, 23, 0.22),
    0 0 18px rgba(99, 102, 241, 0.08);
}

.social-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

/* Divider */
.divider {
  height: 1px;
  margin: 28px 0;
  position: relative;
}

.divider-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

/* Signup row */
.signup-row {
  text-align: center;
  font-size: 14px;
}

/* Alerts */
.alert {
  display: none;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 18px;
}

.alert.show {
  display: flex;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.dark-theme .alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.dark-theme .alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Loading */
.btn-primary.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-primary.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 17px;
  margin-top: -8.5px;
  margin-left: -8.5px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Floating shapes */
.floating-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
  animation: float 6s ease-in-out infinite;
}

.shape-1 {
  top: 10%;
  left: 10%;
  width: 100px;
  height: 100px;
  background: #ffffff;
}

.shape-2 {
  bottom: 14%;
  right: 10%;
  width: 150px;
  height: 150px;
  background: #ffffff;
  animation-delay: 2s;
}

.shape-3 {
  top: 62%;
  left: 22%;
  width: 80px;
  height: 80px;
  background: #ffffff;
  animation-delay: 4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

/* Responsive */
@media (max-width: 968px) {
  .login-container {
    grid-template-columns: 1fr;
  }

  .illustration-section {
    display: none;
  }

  .form-section {
    padding: 42px 28px;
  }

  .title {
    font-size: 30px;
  }
}

@media (max-width: 520px) {
  .back-home-btn {
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
  }

  .login-wrapper {
    padding: 16px;
  }

  .form-section {
    padding: 30px 20px;
  }

  .logo {
    font-size: 28px;
  }

  .title {
    font-size: 28px;
  }

  .subtitle {
    font-size: 14px;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-controls {
    top: 16px;
    right: 16px;
    gap: 10px;
  }

  .theme-toggle,
  .language-toggle {
    width: 44px;
    height: 44px;
  }
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
  text-decoration: none;
}

.logo-full {
  width: 500px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.twofa-input-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.twofa-input-group {
  width: 100%;
  max-width: 180px;
}

.twofa-input {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  padding-left: 2.8rem;
  padding-right: 1rem;
}

