/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1d3a 50%, #0d1b2a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 15% 75%, rgba(52, 211, 153, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 85% 25%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
  animation: float 30s ease-in-out infinite;
  z-index: -1;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg) scale(1); }
  33% { transform: translateY(-12px) rotate(1deg) scale(1.02); }
  66% { transform: translateY(8px) rotate(-1deg) scale(0.98); }
}

.container {
  width: 100%;
  max-width: 480px;
  padding: 20px;
  z-index: 1;
}

.card {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  border-radius: 28px;
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(99, 102, 241, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.4s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 48px 96px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(99, 102, 241, 0.12);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-header {
  padding: 8px 32px 0;
  text-align: center;
  position: relative;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #059669, #34d399);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
  transition: all 0.3s ease;
}

.security-badge:hover {
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.45);
  transform: translateY(-1px);
}

.card-body {
  padding: 32px;
  text-align: center;
}

.download-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  animation: pulse 3.5s ease-in-out infinite;
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.25);
  position: relative;
}

.download-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 22px;
  opacity: 0.3;
  filter: blur(10px);
  z-index: -1;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

h1 {
  font-size: 29px;
  font-weight: 700;
  color: #f9fafb;
  margin-bottom: 10px;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 16px;
  color: #d1d5db;
  margin-bottom: 32px;
  font-weight: 500;
}

.progress-container {
  margin-bottom: 24px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(55, 65, 81, 0.6);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #34d399);
  background-size: 200% 100%;
  border-radius: 5px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.status-text {
  font-size: 16px;
  color: #e5e7eb;
  margin-bottom: 16px;
  font-weight: 500;
}

.error-text {
  font-size: 14px;
  color: #fb7185;
  margin-bottom: 16px;
  min-height: 1.2em;
  font-weight: 500;
}

.features {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
  flex-wrap: wrap;
  list-style: none;
}

.feature {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: #cbd5e1;
  font-weight: 500;
  padding: 8px 14px;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.15);
  transition: all 0.3s ease;
}

.feature:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateY(-2px);
}

.feature svg {
  color: #34d399;
}

.card-footer {
  background: rgba(9, 14, 27, 0.7);
  padding: 18px 32px;
  text-align: center;
  border-top: 1px solid rgba(99, 102, 241, 0.1);
}

/* Top Navigation Styles */
.top-nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(24px) saturate(180%);
  border-radius: 18px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.12);
  z-index: 1001;
  animation: topNavSlideIn 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes topNavSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.nav-btn {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #e5e7eb;
  padding: 9px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.footer-text {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.modal-content {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(24px);
  margin: 5% auto;
  padding: 36px;
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.15);
  animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.close {
  color: #9ca3af;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close:hover {
  color: #ffffff;
  transform: rotate(90deg);
}

.modal h2 {
  color: #f9fafb;
  margin-bottom: 24px;
  font-size: 26px;
  font-weight: 700;
}

.file-info {
  color: #d1d5db;
}

.file-info p {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.file-info strong {
  color: #f3f4f6;
  display: inline-block;
  width: 140px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form input {
  background: rgba(9, 14, 27, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  padding: 13px 18px;
  color: #f3f4f6;
  font-size: 14px;
  transition: all 0.3s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  background: rgba(9, 14, 27, 0.95);
}

.auth-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #ffffff;
  padding: 13px 26px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35);
}

.auth-link {
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

.auth-link a {
  color: #8b5cf6;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.auth-link a:hover {
  text-decoration: underline;
  color: #a78bfa;
}

/* Info Popup Styles */
.info-popup {
  display: none;
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 480px;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.12);
  z-index: 1000;
  animation: popupSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popupSlideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.info-list {
  margin: 0;
  padding: 0;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  color: #d1d5db;
  font-size: 14px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item dt {
  display: flex;
  align-items: center;
}

.info-item svg {
  color: #8b5cf6;
  flex-shrink: 0;
}

.info-item strong {
  color: #f3f4f6;
}

.info-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.secure-portal-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  padding: 9px 14px;
  color: #f9fafb;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.secure-portal-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.25));
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.secure-portal-btn svg {
  color: #34d399;
}

.auth-buttons {
  display: flex;
  gap: 10px;
}

.auth-btn-small {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #e5e7eb;
  padding: 7px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.auth-btn-small:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Responsive design */
@media (max-width: 480px) {
  .container {
    padding: 16px;
  }

  .card-body {
    padding: 24px;
  }

  .card-header {
    padding: 20px 24px 0;
  }

  h1 {
    font-size: 25px;
  }

  .download-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
  }

  .features {
    gap: 12px;
  }

  .feature {
    font-size: 13px;
    padding: 7px 12px;
  }
}

@media (max-width: 360px) {
  .features {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .action-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .modal-content {
    margin: 10% auto;
    padding: 28px;
    width: 95%;
  }

  .top-nav {
    top: 12px;
    padding: 10px 18px;
    gap: 10px;
  }

  .nav-btn {
    padding: 7px 14px;
    font-size: 12px;
  }

  .info-popup {
    top: 70px;
    width: 95%;
  }
}
