/* ---------- GLOBAL VARIABLES ---------- */
:root {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #5a6a7e;
  --border: #e8ecf1;
  --accent: #00c9a7;
  --accent-glow: rgba(0, 201, 167, 0.25);
  --gradient-1: linear-gradient(135deg, #00c9a7 0%, #00b4d8 100%);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 40px rgba(0, 201, 167, 0.3);
  --radius-sm: 12px;
  --radius-lg: 24px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --warning-bg: #fff8e7;
  --warning-border: #ffd966;
  --warning-text: #8a6d3b;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0f19;
  --surface: #141926;
  --text: #e8ecf1;
  --text-secondary: #8899aa;
  --border: #1e2a3a;
  --accent: #00e6c0;
  --accent-glow: rgba(0, 230, 192, 0.35);
  --gradient-1: linear-gradient(135deg, #00e6c0 0%, #00c9ff 100%);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 50px rgba(0, 230, 192, 0.4);
  --warning-bg: #2a2416;
  --warning-border: #c9a03d;
  --warning-text: #ffdfa5;
  color-scheme: dark;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  position: relative;
  padding: 40px 20px;
}

/* ---------- PARTICLES ---------- */
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: floatUp linear infinite;
  opacity: 0;
}

@keyframes floatUp {
  0% {
    transform: translateY(105vh) scale(0);
    opacity: 0;
  }
  
  10% {
    opacity: 0.7;
  }
  
  90% {
    opacity: 0.1;
  }
  
  100% {
    transform: translateY(-10vh) scale(1.5);
    opacity: 0;
  }
}

/* ---------- THEME TOGGLE ---------- */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 20;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 25px var(--accent-glow);
  transform: rotate(20deg);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: translateY(30px) rotate(-90deg);
}

[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: translateY(-30px) rotate(90deg);
}

/* ---------- TOAST ---------- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 90vw;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 0.9rem;
  animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.5s 2.8s forwards;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.toast.success {
  border-left: 5px solid #2ecc71;
}

.toast.info {
  border-left: 5px solid #4a90d9;
}

@keyframes slideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ========== CARD ANIMATION ========== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- LOGIN CARD ---------- */
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  text-align: center;
  position: relative;
  z-index: 2;
  animation: fadeSlideUp 0.5s ease;
}

.logo-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
  margin: 0 auto 16px;
  box-shadow: 0 0 30px var(--accent-glow);
  animation: pulse-glow 3s ease-in-out infinite;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  padding: 20%;
}

@keyframes pulse-glow {
  
  0%,
  100% {
    box-shadow: 0 0 25px var(--accent-glow);
  }
  
  50% {
    box-shadow: 0 0 50px var(--accent-glow), 0 0 80px rgba(0, 201, 167, 0.2);
  }
}

.login-card h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.login-card p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

/* Improved notice box */
.notice-box {
  background: var(--warning-bg);
  border-left: 4px solid var(--warning-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 24px;
  text-align: left;
  font-size: 0.85rem;
  color: var(--warning-text);
  line-height: 1.5;
}

.notice-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.notice-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.notice-list li:last-child {
  margin-bottom: 0;
}

.notice-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-link {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}

.contact-link:hover {
  text-decoration: none;
}

.input-group {
  margin-bottom: 18px;
  text-align: left;
}

.input-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text);
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border var(--transition), box-shadow var(--transition);
  outline: none;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.error-msg {
  color: #e74c3c;
  font-size: 0.8rem;
  margin-top: 6px;
  display: none;
  font-weight: 500;
}

.btn-login {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 50px;
  background: var(--gradient-1);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  box-shadow: 0 6px 20px var(--accent-glow);
  margin-top: 8px;
  letter-spacing: 0.3px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--accent-glow);
  filter: brightness(1.05);
}

.btn-login:active {
  transform: scale(0.97);
}

/* "Create new account" link */
.signup-prompt {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.signup-prompt a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.signup-prompt a:hover {
  text-decoration: underline;
}

/* ---------- LEGAL CARDS ---------- */
.legal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  position: relative;
  z-index: 2;
  animation: fadeSlideUp 0.5s ease;
}

.legal-card .logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 28px;
  margin-bottom: 12px;
}

.legal-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 6px;
}

.last-updated {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 24px;
}

.section {
  margin-bottom: 22px;
}

.section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section h2::before {
  content: '';
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: var(--gradient-1);
}

.section p,
.section li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 8px;
}

.section ul {
  padding-left: 20px;
  margin-bottom: 8px;
}

.back-to-login {
  display: inline-block;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.back-to-login:hover {
  text-decoration: underline;
}

/* ---------- VIEW TOGGLING ---------- */
.hidden-view {
  display: none;
}

/* ---------- FOOTER (clean) ---------- */
.app-footer {
  text-align: center;
  margin-top: 48px;
  padding: 24px 20px 20px;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 800px;
  background: transparent;
  backdrop-filter: blur(2px);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  z-index: 2;
  position: relative;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s;
  padding: 4px 0;
  position: relative;
}

.footer-links a:hover {
  text-decoration: underline;
  filter: brightness(1.1);
}

.footer-links a:not(:last-child)::after {
  content: "•";
  color: var(--text-secondary);
  opacity: 0.5;
  margin-left: 14px;
  margin-right: -14px;
  pointer-events: none;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

@media (max-width: 650px) {
  body {
    padding: 30px 16px;
  }
  
  .login-card,
  .legal-card {
    padding: 24px 18px;
  }
  
  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  
  .logo-icon {
    width: 50px;
    height: 50px;
    font-size: 26px;
  }
  
  .footer-links {
    gap: 20px;
  }
  
  .footer-links a:not(:last-child)::after {
    margin-left: 10px;
    margin-right: -10px;
  }
}