@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: rgba(14, 165, 233, 0.15);
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.35);
  --bg-dark: #090d16;
  --card-bg: rgba(15, 23, 42, 0.8);
  --card-border: rgba(255, 255, 255, 0.1);
  --input-bg: rgba(30, 41, 59, 0.7);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-focus: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

body.login-body {
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 16px;
}

/* Background Ambient Orbs */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb-1 {
  position: absolute;
  top: -10%;
  left: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.16) 0%, rgba(2, 132, 199, 0) 70%);
  border-radius: 50%;
  filter: blur(60px);
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-2 {
  position: absolute;
  bottom: -15%;
  right: 10%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.14) 0%, rgba(79, 70, 229, 0) 70%);
  border-radius: 50%;
  filter: blur(80px);
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

.orb-3 {
  position: absolute;
  top: 40%;
  right: 35%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.07) 0%, rgba(16, 185, 129, 0) 70%);
  border-radius: 50%;
  filter: blur(70px);
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Container */
.login-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 10;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Card */
.login-card {
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px 30px 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65),
              0 0 0 1px rgba(255, 255, 255, 0.05),
              0 0 35px rgba(14, 165, 233, 0.1);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #6366f1);
}

/* Header */
.login-header {
  text-align: center;
  margin-bottom: 22px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--primary-light);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.brand-badge svg {
  width: 14px;
  height: 14px;
}

.brand-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
  margin-bottom: 4px;
}

.brand-title span {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Alert Notification */
.alert-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 0.85rem;
  line-height: 1.4;
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.alert-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* Steps Transition */
.step-pane {
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-pane.hidden {
  display: none !important;
  opacity: 0;
  transform: translateX(20px);
}

.step-pane.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
  animation: slideIn 0.35s ease forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* User Badge for Step 2 */
.user-badge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
}

.user-badge-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-text-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-text-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-change-user {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.btn-change-user:hover {
  background: rgba(56, 189, 248, 0.12);
  text-decoration: underline;
}

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  width: 17px;
  height: 17px;
  pointer-events: none;
  transition: color 0.2s;
}

.form-control {
  width: 100%;
  padding: 11px 14px 11px 42px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.94rem;
  outline: none;
  transition: all 0.25s ease;
}

.form-control:focus {
  border-color: var(--input-focus);
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control:focus + .input-icon {
  color: var(--accent);
}

.toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.toggle-password:hover {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
}

/* 2FA Box */
.ga-section {
  background: rgba(14, 165, 233, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 18px;
  position: relative;
}

.ga-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ga-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
}

.ga-timer-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

.input-token {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 7px;
  text-align: center;
  padding: 12px 14px;
}

.input-token::placeholder {
  letter-spacing: 5px;
  color: #475569;
  font-size: 1.15rem;
}

.ga-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 0.8rem;
}

.btn-qr-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-qr-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 50%, #38bdf8 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 20px -5px rgba(2, 132, 199, 0.4);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -5px rgba(2, 132, 199, 0.6);
  filter: brightness(1.08);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.btn-submit:hover svg {
  transform: translateX(3px);
}

/* Footer info */
.login-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.78rem;
  color: #64748b;
}

/* QR Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #0f172a;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  padding: 26px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.qr-box {
  background: #fff;
  padding: 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  width: 190px;
  height: 190px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.secret-key-display {
  background: rgba(30, 41, 59, 0.8);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.secret-key-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: var(--accent);
  letter-spacing: 1px;
}

.btn-copy {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: var(--accent);
  color: #0f172a;
}

.modal-instructions {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
}

.modal-instructions ol {
  padding-left: 18px;
}

.modal-instructions li {
  margin-bottom: 3px;
}
