/* terms.css */
/* ==================== CSS VARIABLES ==================== */
:root {
  --primary: #0066cc;
  --secondary: #004080;
  --accent: #00b894;
  --bg: #f8fafc;
  --text: #1e293b;
  --text-light: #475569;
  --white: #ffffff;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08);
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --transition: all 0.3s ease;
  --hero-bg: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #004080 100%);
}

body.dark-mode {
  --bg: #0f172a;
  --text: #f1f5f9;
  --text-light: #94a3b8;
  --white: #1e293b;
  --card-bg: #1e293b;
  --border: #334155;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.3);
  --hero-bg: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e293b 100%);
}

/* ==================== RESET ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { padding-left: 20px; }
li { margin-bottom: 6px; }

/* ==================== TOP BAR ==================== */
.top-bar {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.top-bar-container {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; height: 60px;
}
.top-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem; font-weight: 700; color: var(--primary);
}
.top-logo i { font-size: 1.6rem; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  background: none; border: none; color: var(--text); font-size: 1.1rem;
  cursor: pointer; padding: 8px 10px; border-radius: 8px;
  display: flex; align-items: center; gap: 5px; transition: var(--transition);
}
.icon-btn:hover { background: rgba(0,0,0,0.05); }
body.dark-mode .icon-btn:hover { background: rgba(255,255,255,0.05); }
.back-home-link {
  display: flex; align-items: center; gap: 6px; color: var(--text);
  font-size: 0.9rem; font-weight: 500; padding: 8px 14px;
  border-radius: 8px; transition: var(--transition);
}
.back-home-link:hover { background: rgba(0,0,0,0.05); color: var(--primary); }

/* ==================== HERO ==================== */
.terms-hero {
  background: var(--hero-bg);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(0,102,204,0.15), transparent 60%);
}
.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.hero-icon { font-size: 3rem; margin-bottom: 15px; color: #f59e0b; }
.hero-content h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.hero-content h2 { font-size: 1.3rem; font-weight: 500; opacity: 0.9; margin-bottom: 12px; }
.last-updated { font-size: 0.85rem; opacity: 0.8; margin-bottom: 20px; }
.hero-intro {
  font-size: 0.95rem; line-height: 1.7; max-width: 650px; margin: 0 auto; opacity: 0.9;
}

/* ==================== LAYOUT ==================== */
.terms-layout {
  display: flex; max-width: 1200px; margin: 0 auto; padding: 40px 20px; gap: 40px;
}

/* Table of Contents */
.toc-sidebar { width: 260px; flex-shrink: 0; }
.toc-sticky { position: sticky; top: 90px; }
.toc-sticky h3 {
  font-size: 1rem; font-weight: 600; margin-bottom: 15px;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.toc-nav { display: flex; flex-direction: column; gap: 2px; }
.toc-link {
  display: block; padding: 9px 14px; border-radius: 8px; font-size: 0.85rem;
  color: var(--text-light); transition: var(--transition); font-weight: 500;
  border-left: 3px solid transparent;
}
.toc-link:hover { background: rgba(0,102,204,0.05); color: var(--primary); }
.toc-link.active { background: rgba(0,102,204,0.08); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

/* Main Content */
.terms-content { flex: 1; min-width: 0; }

/* Sections */
.terms-section {
  display: flex; gap: 20px; margin-bottom: 35px; padding: 25px;
  background: var(--card-bg); border-radius: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: var(--transition); scroll-margin-top: 90px;
}
.terms-section:hover { box-shadow: var(--shadow-lg); }
.section-icon {
  width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.section-body h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.section-body p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 10px; }
.section-body ul { font-size: 0.9rem; color: var(--text-light); }
.section-body ul li::marker { color: var(--primary); }

/* Contact Card */
.contact-card {
  display: flex; flex-direction: column; gap: 12px; margin-top: 15px;
  padding: 20px; background: var(--bg); border-radius: 12px; border: 1px solid var(--border);
}
.contact-item { display: flex; align-items: center; gap: 14px; }
.contact-item i {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff; background: var(--primary);
}
.contact-item strong { display: block; font-size: 0.8rem; color: var(--text-light); }
.contact-item span { font-size: 0.9rem; color: var(--text); }
.contact-item a { color: var(--primary); }
.contact-item a:hover { text-decoration: underline; }

/* ==================== AGREEMENT SECTION ==================== */
.agreement-section { margin-top: 20px; padding: 0; background: none; box-shadow: none; border: none; }
.agreement-card {
  background: var(--card-bg); border-radius: 16px; padding: 30px;
  box-shadow: var(--shadow-lg); border: 2px solid var(--primary); text-align: center;
}
.agreement-card h2 {
  font-size: 1.3rem; font-weight: 600; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.agreement-card h2 i { color: var(--primary); }

/* Custom Checkbox */
.checkbox-container {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  cursor: pointer; font-size: 0.95rem; margin-bottom: 25px; user-select: none;
  padding: 12px 20px; background: var(--bg); border-radius: 10px; border: 1px solid var(--border);
}
.checkbox-container input { display: none; }
.checkmark {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0; font-size: 0.7rem; color: transparent;
}
.checkbox-container input:checked + .checkmark {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.checkbox-container input:checked + .checkmark::after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; }
.checkbox-text { color: var(--text); }

.agreement-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 10px; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: 2px solid transparent; transition: var(--transition);
  font-family: 'Poppins', sans-serif;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--secondary); border-color: var(--secondary); transform: translateY(-1px); box-shadow: 0 5px 18px rgba(0,102,204,0.3); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ==================== MODAL ==================== */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); z-index: 2000; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card-bg); border-radius: 20px; padding: 30px;
  width: 90%; max-width: 440px; box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  border: 1px solid var(--border); animation: modalSlideIn 0.3s ease; text-align: center;
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-icon { font-size: 3.5rem; margin-bottom: 15px; }
.modal-icon.warning { color: #f59e0b; }
.modal h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.modal p { color: var(--text-light); font-size: 0.9rem; line-height: 1.6; margin-bottom: 8px; }
.modal-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ==================== TOAST ==================== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 14px 22px; border-radius: 12px; color: #fff; font-size: 0.88rem;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  animation: toastIn 0.4s ease, toastOut 0.4s ease 3s forwards;
  font-weight: 500;
}
.toast-success { background: #059669; }
.toast-info { background: #2563eb; }
.toast-warning { background: #d97706; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* ==================== BACK TO TOP ==================== */
.back-to-top {
  position: fixed; bottom: 30px; right: 30px;
  width: 45px; height: 45px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: var(--transition); z-index: 900;
  box-shadow: 0 4px 15px rgba(0,102,204,0.3);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--secondary); transform: translateY(-3px); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
  .terms-layout { flex-direction: column; }
  .toc-sidebar { width: 100%; }
  .toc-sticky { position: static; }
  .toc-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .toc-link { padding: 8px 12px; font-size: 0.78rem; border-left: none; border-bottom: 2px solid transparent; }
  .toc-link.active { border-left-color: transparent; border-bottom-color: var(--primary); }
  .hero-content h1 { font-size: 1.4rem; }
  .hero-content h2 { font-size: 1.1rem; }
}
@media (max-width: 600px) {
  .terms-section { flex-direction: column; padding: 20px; }
  .section-icon { width: 40px; height: 40px; font-size: 1rem; }
  .agreement-card { padding: 20px; }
  .agreement-buttons { flex-direction: column; }
  .btn { width: 100%; }
  .terms-layout { padding: 20px 12px; }
  .terms-hero { padding: 40px 15px; }
  .hero-content h1 { font-size: 1.2rem; }
}