/**
 * GiftSparky Legal Documents Styles (Terms of Service & Privacy Policy)
 * Clean typographic layout with dark/light themes, mobile-first responsive design.
 */

:root {
  --bg-main: #0c0f17;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-callout: rgba(0, 122, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-callout: rgba(0, 122, 255, 0.25);
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #007aff;
  --accent-blue-hover: #0062cc;
  --accent-cyan: #38bdf8;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-main: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-callout: rgba(0, 122, 255, 0.06);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-callout: rgba(0, 122, 255, 0.2);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.legal-page-container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 20px 80px 20px;
}

/* Header */
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.legal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.legal-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #007aff, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

.legal-brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.legal-brand-sub {
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 13px;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 4px;
}

.legal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.legal-btn-back:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
}

.legal-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.legal-theme-btn:hover {
  color: var(--text-primary);
}

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Document Header */
.legal-title-section {
  margin-bottom: 28px;
}

.legal-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-callout);
  border: 1px solid var(--border-callout);
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legal-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.25;
}

.legal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Callout Box */
.legal-callout {
  background: var(--bg-callout);
  border: 1px solid var(--border-callout);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 28px;
  font-size: 13.5px;
  color: var(--text-primary);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.legal-callout-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1.2;
}

/* Table of contents */
.legal-toc {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 36px;
}

.legal-toc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legal-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-toc-list a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 13.5px;
  transition: opacity 0.2s;
}

.legal-toc-list a:hover {
  text-decoration: underline;
}

/* Content Sections */
.legal-section {
  margin-bottom: 36px;
}

.legal-section h2 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
}

.legal-section p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.65;
}

.legal-section ul, .legal-section ol {
  margin-left: 20px;
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legal-section strong {
  color: var(--text-primary);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.legal-table th, .legal-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.legal-table th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
  color: var(--text-primary);
}

.legal-table td {
  color: var(--text-secondary);
}

/* Footer of legal page */
.legal-footer {
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.legal-footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.legal-footer-links a {
  color: var(--accent-cyan);
  text-decoration: none;
}

.legal-footer-links a:hover {
  text-decoration: underline;
}
