@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #003527;
  --primary-vibrant: #00A374;
  --primary-light: #6CF8BB;
  --secondary: #006C49;
  --bg-gradient: radial-gradient(120% 120% at 20% 0%, #F0F7FF 0%, #F9F9FF 50%, #FFF8FE 100%);
  --surface: #FFFFFF;
  --surface-subtle: #F0F3FF;
  --surface-border: #E2E8F8;
  --text-main: #151C27;
  --text-muted: #4A5568;
  --text-subtle: #718096;
  --card-shadow: 0 10px 30px -5px rgba(0, 53, 39, 0.05), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
  --header-shadow: 0 2px 20px rgba(0, 53, 39, 0.04);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-gradient: radial-gradient(120% 120% at 20% 0%, #0d1614 0%, #0b1110 50%, #101618 100%);
    --surface: #131c19;
    --surface-subtle: #192420;
    --surface-border: #23342e;
    --text-main: #F1F5F3;
    --text-muted: #A3B5AE;
    --text-subtle: #738880;
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
    --header-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
  box-shadow: var(--header-shadow);
  transition: all 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(19, 28, 25, 0.88);
  }
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  display: block;
  box-shadow: 0 4px 10px rgba(0, 163, 116, 0.25);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-pill {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.nav-pill:hover {
  color: var(--primary-vibrant);
  background: var(--surface-subtle);
}

.nav-pill.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .nav-pill.active {
    background: var(--primary-vibrant);
    color: #0b1110;
  }
}

.btn-app {
  margin-left: 0.5rem;
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--primary-vibrant) 0%, var(--secondary) 100%);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 163, 116, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-app:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 163, 116, 0.3);
}

/* Page Header Hero */
.hero-section {
  padding: 3.5rem 1.5rem 2rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  color: var(--primary-vibrant);
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 1.5rem;
}

.meta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-subtle);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Main Layout */
.main-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: start;
  flex: 1;
}

/* Sidebar TOC */
.sidebar {
  position: sticky;
  top: 5rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  max-height: calc(100vh - 6.5rem);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--surface-border);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toc-link {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1.4;
  transition: all 0.15s ease;
}

.toc-link:hover {
  color: var(--primary-vibrant);
  background: var(--surface-subtle);
}

.toc-link.active {
  color: var(--primary-vibrant);
  font-weight: 600;
  background: var(--surface-subtle);
  border-left: 3px solid var(--primary-vibrant);
}

/* Content Area */
.legal-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 3rem;
  box-shadow: var(--card-shadow);
}

.legal-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 6rem;
}

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

.legal-section h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--surface-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 1.25rem 0 0.5rem;
}

.legal-section p {
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  font-size: 0.975rem;
}

.legal-section ul,
.legal-section ol {
  margin: 0.75rem 0 1.25rem 1.25rem;
  color: var(--text-muted);
}

.legal-section li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.highlight-box {
  background: var(--surface-subtle);
  border-left: 4px solid var(--primary-vibrant);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.925rem;
  color: var(--text-main);
}

.contact-badge-card {
  background: linear-gradient(135deg, var(--surface-subtle) 0%, var(--surface) 100%);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-vibrant);
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}

.contact-email:hover {
  text-decoration: underline;
}

/* =========================================================
   Support & Contact Form Styles (Root Level)
   ========================================================= */

.support-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 5rem;
  flex: 1;
}

.support-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

.contact-form-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--card-shadow);
}

.form-header {
  margin-bottom: 2rem;
}

.form-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.35rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-label .req {
  color: #BA1A1A;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-vibrant);
  box-shadow: 0 0 0 3px rgba(0, 163, 116, 0.15);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.75rem;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.85rem;
  border-radius: 9999px;
  border: none;
  background: linear-gradient(135deg, var(--primary-vibrant) 0%, var(--secondary) 100%);
  color: #ffffff;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 163, 116, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 163, 116, 0.35);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-outline-mail {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 9999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text-main);
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-outline-mail:hover {
  background: var(--surface-subtle);
  border-color: var(--primary-vibrant);
  color: var(--primary-vibrant);
}

/* Alerts (Strictly hidden unless triggered) */
.form-alert {
  display: none !important;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.925rem;
  align-items: flex-start;
  gap: 0.75rem;
}

.form-alert.is-visible {
  display: flex !important;
}

.form-alert.success {
  background: rgba(0, 163, 116, 0.1);
  border: 1px solid rgba(0, 163, 116, 0.3);
  color: #006C49;
}

@media (prefers-color-scheme: dark) {
  .form-alert.success {
    background: rgba(0, 163, 116, 0.2);
    border: 1px solid rgba(0, 163, 116, 0.4);
    color: #6CF8BB;
  }
}

.form-alert.error {
  background: rgba(186, 26, 26, 0.08);
  border: 1px solid rgba(186, 26, 26, 0.25);
  color: #BA1A1A;
}

@media (prefers-color-scheme: dark) {
  .form-alert.error {
    background: rgba(186, 26, 26, 0.18);
    border: 1px solid rgba(186, 26, 26, 0.35);
    color: #FFB4AB;
  }
}

.support-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
}

.info-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.info-card p:last-child {
  margin-bottom: 0;
}

.faq-mini-item {
  border-top: 1px solid var(--surface-border);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.faq-mini-q {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.faq-mini-a {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* Spinner */
.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--surface-border);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: center;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.footer-links a {
  text-decoration: none;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--primary-vibrant);
}

.footer-copy {
  font-size: 0.825rem;
  color: var(--text-subtle);
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .main-wrapper {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .legal-card {
    padding: 1.75rem 1.5rem;
  }
  .hero-title {
    font-size: 2rem;
  }
  .header-container {
    padding: 0.75rem 1rem;
  }
  .support-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .contact-form-card {
    padding: 1.75rem 1.25rem;
  }
}

@media print {
  .site-header, .site-footer, .sidebar, .btn-app, .nav-links, .btn-submit, .btn-outline-mail {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .legal-card, .contact-form-card {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
  .main-wrapper, .support-container {
    padding: 0 !important;
    display: block !important;
  }
}
