/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --bg-dark: #0f0f23;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: rgba(255, 255, 255, 0.1);
  --success: #4ade80;
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.1);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== ANIMATED BACKGROUND ===== */
.login-page {
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0f0f23 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-light);
  border-radius: 50%;
  opacity: 0;
  animation: float-up 6s infinite;
}

@keyframes float-up {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: 0.6; }
  90% { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ===== LOGIN CONTAINER ===== */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  background: rgba(30, 30, 60, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: card-appear 0.6s ease-out;
}

@keyframes card-appear {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== HEADER ===== */
.card-header {
  text-align: center;
  margin-bottom: 32px;
}

.wifi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 20px;
  margin-bottom: 20px;
  color: white;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6); }
}

.admin-icon {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.card-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(to right, #fff, #a1a1aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ===== ALERT ===== */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  animation: shake 0.4s ease-in-out;
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--error);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ===== FORM ===== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.3s;
}

.input-group input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

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

.input-group input:focus {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-group input:focus ~ .input-icon,
.input-group input:focus + .input-icon {
  color: var(--primary-light);
}

.input-group:has(input:focus) .input-icon {
  color: var(--primary-light);
}

.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  transition: color 0.3s;
}

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

/* ===== BUTTON ===== */
.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
  text-decoration: none;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

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

.btn-continue {
  background: linear-gradient(135deg, #10b981, #059669);
}

.btn-continue:hover {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* ===== FOOTER ===== */
.card-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.card-footer p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.card-footer a {
  color: var(--primary-light);
  text-decoration: none;
}

.card-footer a:hover {
  text-decoration: underline;
}

.powered-by {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== SUCCESS PAGE ===== */
.success-card {
  text-align: center;
}

.success-icon {
  margin-bottom: 20px;
  animation: checkmark-pop 0.6s ease-out;
}

@keyframes checkmark-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.welcome-text {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.info-text {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.connection-info {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 24px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.info-row + .info-row {
  border-top: 1px solid var(--border-color);
}

.info-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.info-value {
  font-weight: 600;
  font-size: 0.9rem;
}

.status-active {
  color: var(--success);
}

.logout-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.logout-link:hover {
  color: var(--error);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
    border-radius: 20px;
  }

  .card-header h1 {
    font-size: 1.5rem;
  }

  .wifi-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .wifi-icon svg {
    width: 36px;
    height: 36px;
  }
}
