/* CSS Variables */
:root {
  /* Colors */
  --primary: #497CFF;
  --primary-hover: #3d6ae6;
  --text-main: #1a1a1a;
  --text-muted: #6A6A6A;
  --bg-gradient-start: #F0F2F5;
  --bg-gradient-end: #E4E7EB;
  --white: #FFFFFF;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-overlay: rgba(240, 242, 245, 0.6);
  --card-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  --footer-bg: #E8EAED;
  --footer-text: rgba(26, 26, 26, 0.7);
  --border-color: #D1D5DB;
  
  /* Typography */
  --font-family: 'Montserrat', sans-serif;
  --line-height-base: 1.5;
  --line-height-heading: 1.4;
  
  /* Spacing */
  --container-max-width: 1120px;
  --section-padding-desktop: 56px;
  --section-padding-mobile: 36px;
  --gutter: 24px;
  
  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--text-main);
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background decorative elements */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(73, 124, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(73, 124, 255, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(73, 124, 255, 0.03) 0%, transparent 50%),
    linear-gradient(90deg, transparent 98%, rgba(73, 124, 255, 0.02) 100%),
    linear-gradient(0deg, transparent 98%, rgba(73, 124, 255, 0.02) 100%);
  background-size: 400px 400px, 600px 600px, 800px 800px, 100px 100px, 100px 100px;
  pointer-events: none;
  z-index: -1;
}

/* Container */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family);
  font-weight: 700;
  line-height: var(--line-height-heading);
  margin: 0 0 1rem 0;
  color: var(--text-main);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
  margin: 0 0 1rem 0;
  line-height: var(--line-height-base);
}

/* Glassmorphism utility */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.glass-overlay {
  background: var(--glass-overlay);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 48px;
  white-space: nowrap;
}

.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border: 2px solid var(--primary);
  box-shadow: 0 4px 12px rgba(73, 124, 255, 0.2);
  backdrop-filter: blur(12px);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(73, 124, 255, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  border: 2px solid var(--border-color);
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: #F0F2F5;
  border-color: var(--primary);
  color: var(--primary);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: transform var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
}

/* Form elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 16px 20px;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text-main);
  background: var(--white);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-base);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(73, 124, 255, 0.1);
}

.form-input::placeholder {
  color: #6A6A6A;
}

.form-input.error {
  border-color: #dc3545;
}

.error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 0.5rem;
}

/* Progress bar */
.progress-container {
  width: 100%;
  background: #D1D5DB;
  border-radius: var(--radius-sm);
  height: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-sm);
  transition: width var(--transition-base);
}

/* Quiz specific styles */
.quiz-container {
  max-width: 800px;
  margin: 0 auto;
}

.quiz-question {
  display: none;
}

.quiz-question.active {
  display: block;
}

.quiz-header {
  text-align: center;
  margin-bottom: 3rem;
}

.quiz-badges {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 16px;
  background: rgba(73, 124, 255, 0.1);
  border: 1px solid rgba(73, 124, 255, 0.2);
  border-radius: var(--radius-xl);
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
}

.badge svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.quiz-question {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: 32px;
  margin-bottom: 2rem;
  position: relative;
  backdrop-filter: blur(12px);
}

.quiz-question h3 {
  color: var(--text-main);
  margin-bottom: 1.5rem;
  text-align: center;
}

.quiz-options {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.quiz-option {
  position: relative;
}

.quiz-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.quiz-option label {
  display: block;
  padding: 20px 24px;
  background: #F0F2F5;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  font-weight: 500;
  color: var(--text-main);
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-option input[type="radio"]:checked + label {
  background: rgba(73, 124, 255, 0.1);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 2px rgba(73, 124, 255, 0.1);
}

.quiz-option label:hover {
  border-color: var(--primary);
  background: rgba(73, 124, 255, 0.05);
}

.quiz-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
}

.quiz-progress {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Modal/Popup */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 520px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform var(--transition-base);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 50%;
  transition: all var(--transition-base);
}

.modal-close:hover {
  background: #f8f9fa;
  color: var(--text-main);
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform var(--transition-base);
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid #28a745;
}

.toast.error {
  border-left: 4px solid #dc3545;
}

/* Header */
header {
  padding: var(--section-padding-desktop) 0;
  text-align: center;
  position: relative;
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
}

.header-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.header-badges {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

/* Info section */
.info-section {
  padding: var(--section-padding-desktop) 0;
  margin: 2rem 0;
  position: relative;
  background-image: 
    linear-gradient(90deg, rgba(73, 124, 255, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(73, 124, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: 0 0, 0 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.info-card {
  text-align: center;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  transition: transform var(--transition-base);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
}

.info-card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-card-icon svg {
  width: 32px;
  height: 32px;
  fill: var(--white);
}

.info-card h3 {
  color: var(--text-main);
  margin-bottom: 1rem;
}

.info-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Footer */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--text-main);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-section p,
.footer-section a {
  color: var(--footer-text);
  margin-bottom: 0.5rem;
  font-size: 14px;
  line-height: 1.6;
}

.footer-section a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  font-size: 14px;
  color: var(--footer-text);
}

/* Responsive design */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
}

@media (max-width: 992px) {
  .container {
    max-width: 720px;
  }
  
  .quiz-question {
    padding: 24px;
  }
  
  .modal-content {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  .container {
    max-width: 540px;
  }
  
  :root {
    --section-padding-desktop: var(--section-padding-mobile);
  }
  
  .quiz-options {
    grid-template-columns: 1fr;
  }
  
  .quiz-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  
  .header-badges {
    flex-direction: column;
    gap: 1rem;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 16px;
  }
  
  .quiz-question {
    padding: 20px;
  }
  
  .modal-content {
    padding: 24px;
    margin: 20px;
  }
  
  .btn {
    padding: 14px 24px;
    font-size: 14px;
  }
  
  .card {
    padding: 20px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .quiz-option label,
  .btn,
  .card,
  .modal-content {
    transition: none;
  }
}

/* Focus styles for keyboard navigation */
.btn:focus-visible,
.form-input:focus-visible,
.quiz-option input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 1002;
  box-shadow: 0 2px 8px rgba(73, 124, 255, 0.3);
}

.skip-link:focus {
  top: 6px;
}

/* Loading states */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Privacy Policy specific styles */
.privacy-section {
  padding: var(--section-padding-desktop) 0;
}

.privacy-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.toc {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  height: fit-content;
  position: sticky;
  top: 2rem;
  box-shadow: var(--card-shadow);
}

.toc h2 {
  color: var(--text-main);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li {
  margin-bottom: 0.5rem;
}

.toc a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.4;
  transition: color var(--transition-base);
  display: block;
  padding: 0.5rem 0;
  border-radius: var(--radius-sm);
}

.toc a:hover,
.toc a.active {
  color: var(--primary);
  background: rgba(73, 124, 255, 0.1);
}

.policy-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-md);
  padding: 3rem;
  box-shadow: var(--card-shadow);
}

.policy-content section {
  margin-bottom: 3rem;
}

.policy-content section:last-child {
  margin-bottom: 0;
}

.policy-content h2 {
  color: var(--text-main);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.policy-content p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.policy-content ul {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.policy-content li {
  margin-bottom: 0.5rem;
}

.contact-info {
  background: rgba(73, 124, 255, 0.08);
  border: 1px solid rgba(73, 124, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin-top: 1rem;
}

.contact-info p {
  margin-bottom: 0.5rem;
}

.contact-info a {
  color: var(--primary);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(73, 124, 255, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(73, 124, 255, 0.4);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

/* Checkbox styles */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-main);
  padding: 12px;
  background: #F0F2F5;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary);
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--white);
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.checkbox-label .checkbox-text {
  flex: 1;
  word-wrap: break-word;
  word-break: normal;
  line-height: 1.5;
  min-width: 0; /* Allows flex item to shrink */
}

.checkbox-label a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  display: inline;
  white-space: nowrap; /* Prevents breaking inside the link text */
}

.checkbox-label:hover {
  background: #E8EAED;
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(73, 124, 255, 0.2);
}

.checkbox-label a:hover {
  text-decoration: underline;
}

/* Quiz section specific styles */
.quiz-section {
  padding: var(--section-padding-desktop) 0;
}

.quiz-container {
  max-width: 800px;
  margin: 0 auto;
}

.quiz-header {
  text-align: center;
  margin-bottom: 3rem;
}

.quiz-header h2 {
  color: var(--text-main);
  margin-bottom: 1rem;
}

.quiz-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Modal open state */
body.modal-open {
  overflow: hidden;
}

/* Toast styles */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform var(--transition-base);
  max-width: 400px;
  font-weight: 500;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid #28a745;
  color: #155724;
}

.toast.error {
  border-left: 4px solid #dc3545;
  color: #721c24;
}

.toast.info {
  border-left: 4px solid var(--primary);
  color: #161616;
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Responsive adjustments for privacy policy */
@media (max-width: 992px) {
  .privacy-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .toc {
    position: static;
    order: -1;
  }
  
  .policy-content {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .policy-content {
    padding: 1.5rem;
  }
  
  .toc {
    padding: 1.5rem;
  }
  
  .checkbox-label {
    font-size: 0.85rem;
    padding: 10px;
    gap: 0.5rem;
  }
  
  .checkbox-label .checkbox-text {
    line-height: 1.4;
  }
  
  .checkbox-label a {
    white-space: normal; /* Allow wrapping on mobile if needed */
    word-break: keep-all;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }
  
  .back-to-top svg {
    width: 20px;
    height: 20px;
  }
}

