/* =============================================================
   assets/css/policy.css
   Shared stylesheet for all policy pages:
   terms.php, privacy.php — and future policy pages
   Extends: auth.css brand tokens (Red #d32f2f / Yellow #ffc107)
   ============================================================= */

/* ── Reset & Root Variables ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Brand colors (mirrors auth.css) */
  --brand-red:          #d32f2f;
  --brand-red-light:    #ef5350;
  --brand-red-bg:       #ffebee;
  --brand-yellow:       #ffc107;
  --brand-yellow-light: #ffd54f;
  --brand-yellow-bg:    #fff8e1;

  /* Neutrals */
  --white:              #ffffff;
  --light-grey-100:     #f8f9fa;
  --light-grey-200:     #e9ecef;
  --light-grey-300:     #dee2e6;
  --light-grey-400:     #ced4da;
  --grey:               #6c757d;
  --dark-grey:          #343a40;

  /* UI surfaces */
  --bg:                 #f4f5f7;
  --bg-card:            #ffffff;
  --border:             #e9ecef;
  --border-soft:        #f1f3f5;

  /* Text */
  --text:               #212529;
  --text-muted:         #6c757d;
  --text-light:         #adb5bd;

  /* Policy-page layout */
  --sidebar-width:      260px;
  --content-max:        820px;
  --layout-gap:         32px;
  --section-radius:     12px;
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background: linear-gradient(135deg, var(--dark-grey) 0%, #2c2c2c 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
}

/* Subtle dot-pattern overlay (matches auth pages) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  z-index: 0;
}

/* =============================================================
   TOP BAR  (identical to auth.css)
   ============================================================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
  z-index: 10;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-ph {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--brand-yellow);
}

.logo-ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.brand-name span {
  color: var(--brand-yellow);
  font-weight: 400;
  font-size: 11px;
  display: block;
  letter-spacing: 1.5px;
}

.topbar-link {
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.topbar-link:hover { color: var(--brand-yellow); }

/* =============================================================
   HERO / PAGE HEADER
   ============================================================= */
.policy-hero {
  position: relative;
  z-index: 1;
  padding: 48px 24px 36px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.policy-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,193,7,0.12);
  border: 1px solid rgba(255,193,7,0.3);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand-yellow);
  margin-bottom: 16px;
}

.policy-hero-badge svg {
  width: 14px;
  height: 14px;
  stroke: var(--brand-yellow);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.policy-hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(32px, 5vw, 52px);
  color: var(--white);
  letter-spacing: 2px;
  line-height: 1.1;
  margin-bottom: 12px;
}

.policy-hero p {
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  max-width: 520px;
  margin: 0 auto 20px;
  line-height: 1.7;
}

.policy-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.policy-meta svg {
  width: 13px;
  height: 13px;
  stroke: rgba(255,255,255,0.4);
  fill: none;
  stroke-width: 2;
}

/* =============================================================
   MAIN LAYOUT  (sidebar + content)
   ============================================================= */
.policy-wrapper {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 24px 56px;
  max-width: calc(var(--sidebar-width) + var(--content-max) + var(--layout-gap) + 48px);
  margin: 0 auto;
  width: 100%;
}

.policy-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--layout-gap);
  align-items: start;
  padding-top: 36px;
}

/* =============================================================
   SIDEBAR  — Table of Contents
   ============================================================= */
.policy-sidebar {
  position: sticky;
  top: 24px;
}

.sidebar-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--section-radius);
  overflow: hidden;
}

.sidebar-head {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-yellow);
}

.sidebar-nav {
  list-style: none;
  padding: 10px 0;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.18s;
  line-height: 1.35;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  color: var(--white);
  background: rgba(255,255,255,0.05);
  border-left-color: var(--brand-yellow);
}

.sidebar-nav li a svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-footer {
  padding: 12px 18px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  line-height: 1.5;
}

.sidebar-footer a {
  color: rgba(255,193,7,0.6);
  text-decoration: none;
}

.sidebar-footer a:hover { color: var(--brand-yellow); }

/* =============================================================
   POLICY CONTENT AREA
   ============================================================= */
.policy-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* =============================================================
   POLICY SECTION CARD
   (Reusable block — add more by duplicating in PHP)
   ============================================================= */
.policy-section {
  background: var(--white);
  border-radius: var(--section-radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  animation: fadeSlideUp 0.4s ease both;
}

/* Stagger animation for cards */
.policy-section:nth-child(1)  { animation-delay: 0.04s; }
.policy-section:nth-child(2)  { animation-delay: 0.08s; }
.policy-section:nth-child(3)  { animation-delay: 0.12s; }
.policy-section:nth-child(4)  { animation-delay: 0.16s; }
.policy-section:nth-child(5)  { animation-delay: 0.20s; }
.policy-section:nth-child(6)  { animation-delay: 0.24s; }
.policy-section:nth-child(7)  { animation-delay: 0.28s; }
.policy-section:nth-child(8)  { animation-delay: 0.32s; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 18px;
  border-bottom: 2px solid var(--brand-yellow);
  background: linear-gradient(135deg, var(--dark-grey), #3a3a3a);
  cursor: pointer;
  user-select: none;
  position: relative;
}

.section-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255,193,7,0.15);
  border: 1px solid rgba(255,193,7,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--brand-yellow);
  fill: none;
  stroke-width: 2;
}

.section-title-wrap { flex: 1; }

.section-title-wrap h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.section-title-wrap p {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
}

.section-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.3s;
}

.section-toggle svg {
  width: 14px;
  height: 14px;
  stroke: rgba(255,255,255,0.5);
  fill: none;
  stroke-width: 2.5;
  transition: transform 0.3s;
}

.section-header:hover .section-toggle {
  background: rgba(255,193,7,0.2);
}

.section-header.collapsed .section-toggle svg {
  transform: rotate(-90deg);
}

/* ── Section Body ── */
.section-body {
  padding: 24px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.section-body.hidden {
  display: none;
}

/* ── Policy Items ── */
.policy-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.policy-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.policy-item:first-child {
  padding-top: 0;
}

.policy-item-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.policy-item-num {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--brand-red-bg);
  border: 1px solid rgba(211,47,47,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-red);
  flex-shrink: 0;
  margin-top: 2px;
}

.policy-item-title {
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.policy-item-body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.75;
  padding-left: 38px;
}

.policy-item-body p + p {
  margin-top: 8px;
}

/* ── Callout / Highlight boxes ── */
.policy-callout {
  display: flex;
  gap: 12px;
  background: var(--brand-yellow-bg);
  border: 1px solid rgba(255,193,7,0.4);
  border-left: 4px solid var(--brand-yellow);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--dark-grey);
  line-height: 1.6;
}

.policy-callout svg {
  width: 16px;
  height: 16px;
  stroke: #b08800;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
  margin-top: 2px;
}

.policy-callout.callout-red {
  background: var(--brand-red-bg);
  border-color: rgba(211,47,47,0.4);
  border-left-color: var(--brand-red);
}

.policy-callout.callout-red svg {
  stroke: var(--brand-red);
}

/* ── Bullet lists inside policy items ── */
.policy-list {
  list-style: none;
  padding-left: 38px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.policy-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

.policy-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-red);
  flex-shrink: 0;
  margin-top: 8px;
}

/* ── Tag / Badge labels on items ── */
.policy-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 8px;
}

.tag-required { background: var(--brand-red-bg); color: var(--brand-red); border: 1px solid rgba(211,47,47,0.25); }
.tag-notice   { background: var(--brand-yellow-bg); color: #8a6000; border: 1px solid rgba(255,193,7,0.3); }
.tag-info     { background: #e3f2fd; color: #0d6efd; border: 1px solid rgba(13,110,253,0.2); }

/* ── Intro paragraph above first section ── */
.policy-intro-card {
  background: var(--white);
  border-radius: var(--section-radius);
  padding: 22px 26px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border-left: 4px solid var(--brand-red);
  animation: fadeSlideUp 0.3s ease both;
}

.policy-intro-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
}

.policy-intro-card strong {
  color: var(--text);
}

/* =============================================================
   FOOTER
   ============================================================= */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.2);
  border-top: 1px solid rgba(255,255,255,0.05);
  line-height: 1.6;
}

footer strong { color: var(--brand-yellow); }

/* =============================================================
   MOBILE BOTTOM NAVIGATION  (TOC for small screens)
   ============================================================= */
.mobile-toc-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  background: var(--brand-red);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  transition: background 0.2s;
}

.mobile-toc-btn:hover { background: var(--brand-yellow); color: var(--dark-grey); }

.mobile-toc-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.mobile-toc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.7);
}

.mobile-toc-overlay.open { display: block; }

.mobile-toc-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e1e1e;
  border-top: 2px solid var(--brand-yellow);
  border-radius: 16px 16px 0 0;
  padding: 20px 0 32px;
  z-index: 201;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.mobile-toc-overlay.open .mobile-toc-panel {
  transform: translateY(0);
}

.mobile-toc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-yellow);
}

.mobile-toc-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.mobile-toc-links {
  list-style: none;
  padding: 8px 0;
}

.mobile-toc-links li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: all 0.15s;
}

.mobile-toc-links li a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.05);
}

.mobile-toc-links li a svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  opacity: 0.6;
  flex-shrink: 0;
}

/* =============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================= */

/* Tablet */
@media (max-width: 900px) {
  .policy-layout {
    grid-template-columns: 1fr;
  }

  .policy-sidebar {
    display: none;
  }

  .mobile-toc-btn {
    display: flex;
  }

  .policy-hero {
    padding: 36px 16px 28px;
  }

  .policy-wrapper {
    padding: 0 16px 48px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
  .brand-name span { display: none; }

  .policy-hero h1 { font-size: 28px; }
  .policy-hero p  { font-size: 13px; }

  .policy-layout { padding-top: 24px; }

  .section-header { padding: 16px 18px; }
  .section-body   { padding: 18px; }

  .policy-item-body { padding-left: 0; }
  .policy-list      { padding-left: 0; }

  .section-icon { width: 32px; height: 32px; border-radius: 6px; }
  .section-icon svg { width: 15px; height: 15px; }

  .section-title-wrap h2 { font-size: 15px; }
  .section-title-wrap p  { font-size: 11px; }
}

@media (max-width: 400px) {
  .policy-callout { flex-direction: column; gap: 6px; }
}