.terms-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  overflow-y: auto;
  padding: 20px;
  animation: fadeIn 0.3s ease-in-out;
}

body.terms-popup-active {
    overflow: hidden !important;
    height: 100vh !important;
}

body.terms-popup-active #wrapper {
    height: 100vh !important;
    overflow: hidden !important;
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
    -webkit-filter: blur(5px);
}

.terms-popup-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.terms-popup-container {
  background: linear-gradient(135deg, #121212 0%, #222222 100%);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.terms-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terms-popup-title {
  margin: 0;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
}

.terms-popup-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.terms-popup-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.terms-popup-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
}

.terms-content h5 {
  color: #fff;
  margin-bottom: 12px;
  font-size: 1.125rem;
  font-weight: 600;
}

.terms-content > p {
  color: #ccc;
  margin-bottom: 20px;
  line-height: 1.6;
}

.terms-scroll-area {
  max-height: 300px;
  overflow-y: auto;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.terms-scroll-area::-webkit-scrollbar {
  width: 8px;
}

.terms-scroll-area::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.terms-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.terms-scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.terms-scroll-area h6 {
  color: #e9021e;
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.terms-scroll-area h6:first-child {
  margin-top: 0;
}

.terms-scroll-area p {
  color: #ddd;
  margin-bottom: 12px;
  line-height: 1.6;
  font-size: 0.875rem;
}

.terms-agreement-section {
  margin-top: 20px;
}

.terms-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.terms-checkbox {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #e9021e;
}

.terms-checkbox-label {
  color: #fff;
  font-size: 0.9375rem;
  cursor: pointer;
  user-select: none;
  line-height: 1.5;
}

.terms-error-message {
  margin-top: 12px;
  padding: 12px 16px;
  background-color: rgba(220, 53, 69, 0.2);
  border: 1px solid rgba(220, 53, 69, 0.5);
  border-radius: 6px;
  color: #ff6b6b;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.terms-popup-footer {
  padding: 20px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.terms-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  min-width: 120px;
}

.terms-btn-cancel {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.terms-btn-cancel:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.terms-btn-accept {
  background: linear-gradient(135deg, #e9021e 0%, #c00119 100%);
  color: #fff;
}

.terms-btn-accept:hover {
  background: linear-gradient(135deg, #ff0a26 0%, #e9021e 100%);
  box-shadow: 0 4px 12px rgba(233, 2, 30, 0.4);
}

.terms-popup-body::-webkit-scrollbar {
  width: 8px;
}

.terms-popup-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.terms-popup-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.terms-popup-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .terms-popup-container {
    max-width: 95%;
    margin: 10px;
  }

  .terms-popup-header {
    padding: 20px;
  }

  .terms-popup-body {
    padding: 20px;
  }

  .terms-popup-title {
    font-size: 1.25rem;
  }

  .terms-scroll-area {
    max-height: 200px;
  }

  .terms-error-message {
    margin-top: 6px;
    padding: 6px 8px;
    gap: 4px;
  }

  .terms-popup-footer {
    padding: 16px 20px;
    flex-direction: column-reverse;
  }

  .terms-btn {
    width: 100%;
    padding: 6px 12px;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .terms-popup-container {
    max-width: 95%;
    margin: 10px;
  }

  .terms-popup-header {
    padding: 8px;
  }

  .terms-popup-body {
    padding: 8px;
  }

  .terms-popup-title {
    font-size: 1.125rem;
  }

  .terms-scroll-area {
    max-height: 150px;
    padding: 10px;
  }

  .terms-popup-footer {
    padding: 6px 8px;
    flex-direction: column-reverse;
  }

  .terms-btn {
    width: 100%;
    padding: 3px 6px;
    font-size: 0.875rem;
  }
}
