:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-input: #0d0d0d;
  --accent: #dc2626;
  --accent-hover: #ef4444;
  --accent-glow: rgba(220, 38, 38, 0.3);
  --accent-soft: rgba(220, 38, 38, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #a1a1a1;
  --text-muted: #6b6b6b;
  --border: #262626;
  --border-hover: #363636;
  --success: #22c55e;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* Background Effects */
.bg-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
}

.glow-1 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -200px;
  right: -200px;
  animation: float 8s ease-in-out infinite;
}

.glow-2 {
  width: 400px;
  height: 400px;
  background: #7c3aed;
  bottom: -100px;
  left: -100px;
  animation: float 10s ease-in-out infinite reverse;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-30px, 30px) scale(1.1);
  }
}

/* Logo */
.logo {
  position: fixed;
  top: 32px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 18px;
  z-index: 100;
  transition: opacity 0.2s;
}

.logo:hover {
  opacity: 0.8;
}

.logo svg {
  color: var(--accent);
}

/* Auth Container */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 20px;
  width: 100%;
  max-width: 440px;
  z-index: 10;
}

/* Card */
.card {
  width: 100%;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 20px 50px -20px rgba(0, 0, 0, 0.5), 0 0 100px -50px
    var(--accent-glow);
  animation: cardEnter 0.5s ease;
}

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

.card-header {
  text-align: center;
  margin-bottom: 32px;
}

.card-header h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Form Content */
.form-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-content.hidden {
  display: none;
}

/* Input Group */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

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

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--accent);
}

/* Toggle Password */
.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
}

.toggle-password:hover {
  color: var(--text-secondary);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
}

.toggle-password .hidden {
  display: none;
}

/* Forgot Link */
.forgot-link {
  text-align: right;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  transition: color 0.2s;
  margin-top: -8px;
}

.forgot-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #b91c1c);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-primary:hover svg {
  transform: translateX(4px);
}

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

.btn-google {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-google:hover {
  background: var(--bg-card);
  border-color: var(--border-hover);
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Switch */
.switch {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.switch a {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s;
  margin-left: 4px;
}

.switch a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Security Badge */
.security-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 100px;
  font-size: 12px;
  color: var(--success);
}

.security-badge svg {
  width: 16px;
  height: 16px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

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

.modal-content {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  animation: modalEnter 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-header {
  text-align: center;
  margin-bottom: 28px;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 16px;
  color: var(--accent);
}

.modal-icon.success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.modal-icon svg {
  width: 28px;
  height: 28px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-header p strong {
  color: var(--accent);
}

/* Code Inputs */
.code-label {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.code-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.code-inputs input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  transition: all 0.2s;
}

.code-inputs input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.code-inputs input.filled {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Resend Code */
.resend-code {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.resend-code a {
  color: var(--accent);
  cursor: pointer;
  transition: color 0.2s;
}

.resend-code a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 480px) {
  .logo {
    top: 20px;
    left: 20px;
  }

  .card {
    padding: 28px;
    border-radius: 20px;
  }

  .card-header h1 {
    font-size: 22px;
  }

  .code-inputs input {
    width: 42px;
    height: 50px;
    font-size: 18px;
  }
}
