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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul {
  list-style: none;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.text-accent {
  color: var(--accent-color);
}

.text-white {
  color: var(--white);
}

/* ===== BUTTON STYLES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  min-width: 140px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-dark);
  border: 2px solid var(--gray-300);
}

.btn-outline:hover {
  background-color: var(--gray-50);
  border-color: var(--gray-400);
  transform: translateY(-2px);
}

/* ===== HERO SECTION ===== */
.hero {
  background: var(--gradient-primary);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
}

.hero-content h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
  opacity: 0;
  transform: translateY(30px);
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 1.875rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(30px);
}

.last-updated {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.625rem 1.25rem;
  border-radius: 25px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(30px);
}

/* ===== MAIN CONTENT LAYOUT ===== */
.main-content {
  padding: 60px 0;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: start;
}

/* ===== TABLE OF CONTENTS ===== */
.toc-sidebar {
  position: sticky;
  top: 20px;
}

.toc-container {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.toc-container h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-dark);
}

.toc-nav {
  display: flex;
  flex-direction: column;
}

.toc-link {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--gray-600);
  border-radius: var(--border-radius);
  margin-bottom: 0.25rem;
  transition: var(--transition);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.toc-link:hover {
  background-color: var(--gray-50);
  color: var(--primary-color);
  transform: translateX(5px);
}

.toc-link.active {
  background-color: var(--primary-color);
  color: var(--white);
  border-left-color: var(--secondary-color);
}

/* ===== POLICY CONTENT ===== */
.policy-content {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.policy-section {
  margin-bottom: 3.125rem;
  opacity: 0;
  transform: translateY(20px);
}

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

.policy-section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.5625rem;
  padding-bottom: 0.9375rem;
  border-bottom: 3px solid var(--primary-color);
}

.policy-section h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 1.875rem 0 0.9375rem 0;
}

.policy-section p {
  margin-bottom: 1.25rem;
  color: var(--gray-700);
  line-height: 1.7;
}

.policy-section ul {
  margin: 1.25rem 0;
  padding-left: 1.25rem;
}

.policy-section li {
  margin-bottom: 0.5rem;
  color: var(--gray-700);
  line-height: 1.6;
  position: relative;
}

.policy-section li::before {
  content: "•";
  color: var(--primary-color);
  font-weight: bold;
  position: absolute;
  left: -1rem;
}

/* ===== CONTACT GRID ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.875rem;
  margin: 1.875rem 0;
}

.contact-item {
  background: var(--gray-50);
  padding: 1.5625rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
}

.contact-item h3 {
  color: var(--primary-color);
  margin-bottom: 0.9375rem;
  font-size: 1.1rem;
}

.contact-item p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

/* ===== CONTACT FORM ===== */
.contact-form {
  background: var(--gray-50);
  padding: 1.875rem;
  border-radius: var(--border-radius-lg);
  margin-top: 2.5rem;
  border: 1px solid var(--gray-200);
}

.contact-form h3 {
  color: var(--primary-color);
  margin-bottom: 1.5625rem;
  font-size: 1.3rem;
}

.form-group {
  margin-bottom: 1.5625rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--white);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(60, 9, 108, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.95rem;
  gap: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.submit-btn {
  background: var(--gradient-primary);
  color: var(--white);
  padding: 0.9375rem 1.875rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 1.875rem;
  right: 1.875rem;
  width: 3.125rem;
  height: 3.125rem;
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

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

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ===== FORM VALIDATION STYLES ===== */
.field-error {
  color: #e53e3e;
  font-size: 0.875rem;
  margin-top: 0.3125rem;
}

.form-group input:invalid,
.form-group select:invalid,
.form-group textarea:invalid {
  border-color: #e53e3e;
}

/* ===== NOTIFICATION STYLES ===== */
.notification {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.9375rem 1.25rem;
  border-radius: var(--border-radius);
  color: var(--white);
  font-weight: 500;
  z-index: 10000;
  max-width: 25rem;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.notification-success {
  background: linear-gradient(135deg, #48bb78, #38a169);
}

.notification-error {
  background: linear-gradient(135deg, #f56565, #e53e3e);
}

.notification-info {
  background: var(--gradient-primary);
}

/* ===== ACCESSIBILITY ===== */
.skip-link {
  position: absolute;
  top: -2.5rem;
  left: 0.375rem;
  background: var(--primary-color);
  color: var(--white);
  padding: 0.5rem;
  text-decoration: none;
  border-radius: var(--border-radius);
  z-index: 10000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0.375rem;
}

/* Focus states for accessibility */
.btn:focus,
.toc-link:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-content p {
    font-size: 1.1rem;
  }

  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 1.875rem;
  }

  .toc-sidebar {
    position: static;
    order: -1;
  }

  .toc-container {
    padding: 1.25rem;
  }

  .policy-content {
    padding: 1.5625rem;
  }

  .policy-section h2 {
    font-size: 1.6rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .contact-form {
    padding: 1.25rem;
  }

  .container {
    padding: 0 0.9375rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 3.75rem 0;
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .main-content {
    padding: 2.5rem 0;
  }

  .policy-content {
    padding: 1.25rem;
  }

  .back-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 2.8125rem;
    height: 2.8125rem;
  }
}

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

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

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.6s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.6s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.loaded {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* ===== PRINT STYLES ===== */
@media print {
  .toc-sidebar,
  .back-to-top {
    display: none;
  }

  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .policy-content {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  .hero {
    background: var(--primary-color) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .btn {
    display: none;
  }
}

/* ===== LOADING STATES ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ===== UTILITY CLASSES ===== */
.text-center {
  text-align: center;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-2 {
  margin-top: 1rem;
}

.opacity-0 {
  opacity: 0;
}

.opacity-100 {
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}