:root {
  --primary: #4f46e5;
  --secondary: #3b82f6;
  --background: #f9fafb;
  --card-bg: #ffffff;
  --text: #1f2937;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background);
  margin: 0;
  
  opacity: 0;
  animation: bodyFade 0.8s ease forwards;
  
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  color: var(--text);
}

@keyframes bodyFade {
  to { opacity: 1; }
}

body.dark {
  --background: #121212;
  --card-bg: #1e1e1e;
  --text: #f0f0f0;
  --primary: #8ab4f8;
  --secondary: #5e9cff;
  background-color: var(--background);
  color: var(--text);
}

.container {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 400px;
  text-align: center;
  animation: fadeIn 0.8s ease;
  transition: background-color 0.3s ease, color 0.3s ease;
  color: var(--text);
}

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

h1 {
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 20px;
}

input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 8px var(--secondary);
  transform: scale(1.02);
}

button {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
/*   transition: background 0.3s ease; */
  margin-top: 10px;
  transition: background 0.3s ease, transform 0.2s ease;
}

button:hover {
  background: var(--secondary);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.portal-button {
  margin-top: 15px;
  background-color: #3b82f6;
  border: none;
  color: white;
  padding: 12px;
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

/* .result {
  margin-top: 20px;
  padding: 15px;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
} */

.result {
  animation: pop 0.4s ease;
}

@keyframes pop {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

body.dark .result {
  background: #2a2a2a;
}

footer {
  margin-top: 30px;
  font-size: 0.85rem;
  color: #6b7280;
  transition: color 0.3s ease;
}

body.dark footer {
  color: #a0a0a0;
}

/* Toggle Switch styles */
.switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  user-select: none;
  font-size: 1rem;
  gap: 8px;
  justify-content: center;
}

.switch input {
  display: none;
}

.slider {
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 34px;
  position: relative;
  transition: 0.4s;
  display: inline-block;
}

.slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
/*   transition: 0.4s; */
  transition: transform 0.4s ease, background-color 0.4s ease;
}

input:checked + .slider {
  background-color: var(--secondary);
}

input:checked + .slider::before {
  transform: translateX(20px);
}
