/*
 * SureSuccess - Terms and Conditions Page Stylesheet
 * Optimized styles for legal content and documentation
 */

/* ======================================
   BASE STYLES & VARIABLES
   ====================================== */
:root {
  /* Color Palette */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-lighter: #93c5fd;
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  
  --secondary: #0f172a;
  --secondary-light: #1e293b;
  --secondary-lighter: #334155;
  
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: #fbbf24;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  --background: #ffffff;
  --background-alt: #f8fafc;
  --background-dark: #f1f5f9;
  
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-headings: 'Poppins', var(--font-primary);
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  
  /* Borders */
  --border-radius-sm: 0.25rem;
  --border-radius: 0.5rem;
  --border-radius-lg: 1rem;
  --border-radius-xl: 1.5rem;
  --border-radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transitions */
  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
  --transition-slow: all 0.5s ease;
}

/* ======================================
   RESET & BASE STYLES
   ====================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 100px; /* For anchor links to account for fixed header */
}

body {
  font-family: var(--font-primary);
  color: var(--text-dark);
  line-height: 1.6;
  background-color: var(--background-alt);
  overflow-x: hidden;
  position: relative;
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--secondary);
}

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ======================================
   NAVIGATION
   ====================================== */
.navbar {
  background-color: var(--primary);
  box-shadow: var(--shadow);
  padding: 0.75rem 0;
  transition: var(--transition);
  z-index: 100;
}

.navbar-dark .navbar-brand {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-white);
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  padding: 0.625rem 0.75rem;
  transition: var(--transition-fast);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: var(--text-white);
}

.navbar-dark .navbar-toggler {
  border: none;
  padding: 0.5rem;
  font-size: 1.25rem;
  color: var(--text-white);
}

.navbar-dark .navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

.brand-highlight {
  color: var(--accent) !important;
  font-weight: 700;
}

/* ======================================
   TERMS HEADER
   ====================================== */
.terms-header {
  background: var(--primary-gradient);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  color: var(--text-white);
  box-shadow: var(--shadow-md);
}

.terms-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.1;
  z-index: 0;
}

.terms-header-content {
  position: relative;
  z-index: 1;
}

.terms-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 0.5rem;
}

.terms-header p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* ======================================
   TERMS CARD
   ====================================== */
.terms-card {
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  overflow: hidden;
  background-color: var(--background);
  margin-bottom: 2rem;
}

.terms-card:hover {
  box-shadow: var(--shadow-lg);
}

.terms-card .card-header {
  background-color: var(--background);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
}

.terms-card .card-body {
  padding: 1.75rem;
}

/* ======================================
   TABLE OF CONTENTS
   ====================================== */
.table-of-contents {
  background-color: var(--background-alt);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

.table-of-contents h4 {
  color: var(--text-dark);
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.table-of-contents h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--primary-gradient);
  border-radius: var(--border-radius-full);
}

.table-of-contents ul {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 0;
  columns: 1;
}

@media (min-width: 768px) {
  .table-of-contents ul {
    columns: 2;
  }
}

@media (min-width: 992px) {
  .table-of-contents ul {
    columns: 3;
  }
}

.table-of-contents ul li {
  margin-bottom: 0.75rem;
  break-inside: avoid;
}

.table-of-contents ul li a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
}

.table-of-contents ul li a:hover {
  color: var(--primary-dark);
  transform: translateX(5px);
}

.table-of-contents ul li a::before {
  content: '•';
  margin-right: 0.5rem;
  color: var(--primary);
}

/* ======================================
   TERMS SECTIONS
   ====================================== */
.terms-section {
  padding-top: 1rem;
  margin-bottom: 3rem;
  position: relative;
}

.terms-section h2 {
  color: var(--primary);
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
}

.terms-section h2::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: var(--border-radius-full);
}

.terms-section h3 {
  font-size: 1.35rem;
  margin-top: 1.75rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.terms-section p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.terms-section ul, 
.terms-section ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.terms-section ul li, 
.terms-section ol li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ======================================
   BACK TO TOP BUTTON
   ====================================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: var(--primary-gradient);
  color: var(--text-white);
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  background-color: var(--primary-dark);
  color: var(--text-white);
  box-shadow: var(--shadow-lg);
}

/* ======================================
   FOOTER
   ====================================== */
footer {
  background-color: var(--secondary);
  color: var(--text-white);
  margin-top: 4rem;
  padding-top: 4rem;
}

footer h4, footer h5 {
  color: var(--text-white);
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: white;
  transition: var(--transition-fast);
}

.social-links a:hover {
  background-color: var(--primary);
  transform: translateY(-3px);
  color: white;
}

.footer-links {
  list-style: none;
  padding-left: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-lighter);
  text-decoration: none;
  padding-left: 5px;
}

/* ======================================
   PRINT STYLES
   ====================================== */
@media print {
  nav, 
  .back-to-top, 
  footer {
    display: none !important;
  }
  
  .terms-header {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    background: none !important;
    color: var(--text-dark) !important;
    box-shadow: none !important;
  }
  
  .terms-header h1 {
    color: var(--text-dark) !important;
  }
  
  .terms-header p {
    color: var(--text-muted) !important;
  }
  
  .terms-card {
    box-shadow: none !important;
    margin: 0 !important;
  }
  
  .terms-section h2::before {
    display: none !important;
  }
  
  a {
    text-decoration: underline !important;
    color: var(--text-dark) !important;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 90%;
  }
  
  a[href^="#"]:after {
    content: "";
  }
  
  .table-of-contents {
    break-inside: avoid;
  }
  
  .terms-section {
    page-break-inside: avoid;
  }
}

/* ======================================
   MISC STYLES
   ====================================== */
.text-last-updated {
  font-style: italic;
  color: var(--text-light);
  text-align: right;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* ======================================
   RESPONSIVE ADJUSTMENTS
   ====================================== */
@media (max-width: 991.98px) {
  .terms-header {
    padding: 2rem;
  }
  
  .terms-header h1 {
    font-size: 2.25rem;
  }
  
  .table-of-contents {
    padding: 1.25rem;
  }
  
  .terms-section h2 {
    font-size: 1.5rem;
  }
  
  .terms-section h3 {
    font-size: 1.25rem;
  }
  
  .terms-section p,
  .terms-section ul li,
  .terms-section ol li {
    font-size: 1rem;
  }
  
  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

@media (max-width: 767.98px) {
  .terms-header {
    padding: 1.75rem;
    text-align: center;
  }
  
  .terms-header h1 {
    font-size: 2rem;
  }
  
  .terms-card .card-body {
    padding: 1.25rem;
  }
  
  .table-of-contents {
    padding: 1rem;
    margin-bottom: 2rem;
  }
  
  .table-of-contents h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  
  .terms-section {
    margin-bottom: 2.5rem;
  }
  
  .terms-section h2 {
    font-size: 1.4rem;
    padding-bottom: 0.5rem;
  }
  
  .terms-section h3 {
    font-size: 1.2rem;
  }
  
  .back-to-top {
    width: 2.5rem;
    height: 2.5rem;
  }
}

@media (max-width: 575.98px) {
  .terms-header {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .terms-header h1 {
    font-size: 1.75rem;
  }
  
  .terms-header p {
    font-size: 0.95rem;
  }
  
  .terms-card .card-body {
    padding: 1rem;
  }
  
  .table-of-contents ul li {
    margin-bottom: 0.5rem;
  }
  
  .terms-section {
    margin-bottom: 2rem;
  }
  
  .terms-section h2 {
    font-size: 1.3rem;
  }
  
  .terms-section h3 {
    font-size: 1.1rem;
  }
  
  .terms-section p,
  .terms-section ul li,
  .terms-section ol li {
    font-size: 0.95rem;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
  }
}