:root {
  --primary: #1e3a8a;
  --primary-dark: #172554;
  --secondary: #3b82f6;
  --accent: #f59e0b;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --text-dark: #1e293b;
  --text-medium: #475569;
  --text-light: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --primary: #60a5fa;
  --primary-dark: #3b82f6;
  --secondary: #60a5fa;
  --accent: #fbbf24;
  --bg-light: #0f172a;
  --bg-white: #1e293b;
  --text-dark: #f8fafc;
  --text-medium: #cbd5e1;
  --text-light: #94a3b8;
  --border: #334155;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo svg {
  width: 32px;
  height: 32px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

nav a:hover {
  color: var(--accent);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

nav a:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 5rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 800;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #fbbf24 100%);
  color: #78350f;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  filter: brightness(1.05);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .btn-secondary {
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border-color: var(--secondary);
}

.card-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: white;
  font-size: 1.6rem;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.card p {
  color: var(--text-medium);
  line-height: 1.7;
}

.card .btn {
  margin-top: 1.5rem;
  width: 100%;
  text-align: center;
}

/* Features Section */
.features {
  background: var(--bg-white);
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--bg-light);
  transition: all 0.3s;
}

.feature-item:hover {
  background: rgba(219, 230, 255, 0.4);
}

.feature-icon {
  width: 50px;
  height: 50px;
  background: var(--secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.feature-content h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.feature-content p {
  color: var(--text-medium);
}

/* Content Pages */
.content-page {
  padding: 3rem 0;
  min-height: calc(100vh - 80px);
}

.content-page .container {
  max-width: 900px;
}

.content-page h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.content-page .lead {
  font-size: 1.25rem;
  color: var(--text-medium);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.content-section {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
}

.content-section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--secondary);
}

.content-section h3 {
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem;
  color: var(--primary-dark);
}

.content-section p {
  margin-bottom: 1rem;
  color: var(--text-medium);
  line-height: 1.8;
  font-size: 1.05rem;
}

.content-section ul {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.content-section li {
  margin-bottom: 0.5rem;
  color: var(--text-medium);
  line-height: 1.7;
}

.content-section .highlight {
  background: rgba(219, 230, 255, 0.6);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--secondary);
  margin: 1.5rem 0;
}

.content-section .highlight p {
  color: var(--primary-dark);
  font-weight: 500;
  margin: 0;
}

/* Forms */
.form-container {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary);
}

.form-group label .required {
  color: var(--danger);
  margin-left: 0.25rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--secondary);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

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

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* Document Viewer */
.document-viewer {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
  font-family: 'Times New Roman', serif;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

.document-viewer h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-family: 'Times New Roman', serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.document-viewer .signature-line {
  margin-top: 2rem;
  border-top: 1px solid var(--text-dark);
  padding-top: 0.5rem;
  display: inline-block;
  min-width: 200px;
}

/* Footer */
footer {
  background: var(--primary-dark);
  color: white;
  padding: 2rem 0;
  text-align: center;
}

footer p {
  opacity: 0.8;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .content-page h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  nav.active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    padding: 1rem;
  }

  nav.active ul {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Print Styles */
@media print {
  header,
  footer,
  .hero,
  .form-actions,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .form-container,
  .document-viewer,
  .content-section {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  .form-group input,
  .form-group textarea {
    border: none;
    border-bottom: 1px solid #ccc;
    padding: 0.5rem 0;
  }
}

/* Sidebar for content pages */
.content-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.sidebar {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 100px;
  border: 1px solid var(--border);
}

.sidebar h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 0.5rem;
}

.sidebar a {
  color: var(--text-medium);
  text-decoration: none;
  display: block;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(219, 230, 255, 0.6);
  color: var(--primary);
}

@media (max-width: 768px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

/* Table of Contents */
.toc {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--secondary);
}

.toc h3 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.toc ol {
  margin-left: 1.5rem;
}

.toc li {
  margin-bottom: 0.5rem;
}

.toc a {
  color: var(--text-medium);
  text-decoration: none;
}

.toc a:hover {
  color: var(--secondary);
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

/* Form specific */
.form-title {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--primary);
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.form-section:last-child {
  border-bottom: none;
}

.form-section h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
}

.checkbox-group label {
  margin-bottom: 0;
  font-weight: normal;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radio-option input[type="radio"] {
  width: auto;
}

.radio-option label {
  margin-bottom: 0;
  font-weight: normal;
}

/* Alert boxes */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-info {
  background: rgba(219, 230, 255, 0.4);
  border-color: var(--secondary);
  color: var(--primary-dark);
}

.alert-warning {
  background: rgba(254, 243, 195, 0.5);
  border-color: var(--warning);
  color: #92400e;
}

.alert-success {
  background: rgba(209, 250, 233, 0.5);
  border-color: var(--success);
  color: #065f46;
}

/* Dark mode overrides for forms.css */
[data-theme="dark"] nav a {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] nav a:hover {
  color: var(--accent);
}

[data-theme="dark"] nav a.active {
  color: var(--accent);
}

[data-theme="dark"] .card h3 {
  color: var(--text-dark);
}

[data-theme="dark"] .card p {
  color: var(--text-medium);
}

[data-theme="dark"] .content-section h2 {
  color: var(--text-dark);
}

[data-theme="dark"] .content-section h3 {
  color: var(--primary-dark);
}

[data-theme="dark"] .content-section p {
  color: var(--text-medium);
}

[data-theme="dark"] .content-section li {
  color: var(--text-medium);
}

[data-theme="dark"] .content-section .highlight {
  background: rgba(30, 58, 138, 0.3);
}

[data-theme="dark"] .content-section .highlight p {
  color: #bfdbfe;
}

[data-theme="dark"] .alert-info {
  background: #1e3a8a;
  color: #bfdbfe;
}

[data-theme="dark"] .alert-warning {
  background: #78350f;
  color: #fde68a;
}

[data-theme="dark"] .alert-success {
  background: #065f46;
  color: #6ee7b8;
}

[data-theme="dark"] .sidebar a {
  color: var(--text-medium);
}

[data-theme="dark"] .sidebar a:hover,
[data-theme="dark"] .sidebar a.active {
  background: rgba(96, 165, 250, 0.1);
  color: var(--secondary);
}

[data-theme="dark"] .form-group label {
  color: var(--secondary);
}

[data-theme="dark"] .form-section h3 {
  color: var(--text-dark);
}

[data-theme="dark"] .form-title {
  color: var(--text-dark);
}

[data-theme="dark"] .document-viewer h2 {
  color: var(--text-dark);
}

[data-theme="dark"] .document-viewer {
  background: var(--bg-white);
  border-color: var(--border);
}

[data-theme="dark"] .document-viewer .signature-line {
  border-top-color: var(--text-medium);
}

/* Print styles */
@media print {
  [data-theme="dark"] .form-container,
  [data-theme="dark"] .document-viewer,
  [data-theme="dark"] .content-section {
    background: white !important;
  }

  [data-theme="dark"] body {
    background: white !important;
    color: black !important;
  }

  [data-theme="dark"] h1,
  [data-theme="dark"] h2,
  [data-theme="dark"] h3,
  [data-theme="dark"] h4,
  [data-theme="dark"] p,
  [data-theme="dark"] li,
  [data-theme="dark"] label {
    color: black !important;
  }

  [data-theme="dark"] .form-group input[type="text"],
  [data-theme="dark"] .form-group input[type="date"],
  [data-theme="dark"] .form-group textarea,
  [data-theme="dark"] .form-group select {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
  }
}

/* Print styles */
@media print {
  header,
  footer,
  .hero,
  .form-actions .no-print,
  .breadcrumbs,
  .back-to-top,
  .theme-toggle,
  .mobile-menu-btn {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.4;
  }

  .content-page {
    padding: 0;
    min-height: auto;
  }

  .container {
    max-width: 100%;
    padding: 0;
    width: 100%;
  }

  .form-container {
    box-shadow: none;
    border: 1px solid #ccc;
    padding: 20px;
    page-break-inside: avoid;
  }

  .form-section {
    page-break-inside: avoid;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
  }

  .form-section:last-child {
    border-bottom: none;
  }

  .form-group {
    margin-bottom: 12pt;
  }

  .form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: black;
  }

  .form-group input[type="text"],
  .form-group input[type="date"],
  .form-group textarea,
  .form-group select {
    width: 100%;
    border: 1px solid #000;
    padding: 8pt;
    font-size: 11pt;
    background: #fff;
    color: #000;
    box-shadow: inset 0 0 0 0.05em #000;
  }

  .form-row {
    display: flex;
    gap: 15pt;
  }

  .form-row .form-group {
    flex: 1;
  }

  .required::after {
    content: " *";
    color: #d00;
  }

  .signature-line {
    border-top: 1px solid #000;
    padding-top: 20px;
    margin-top: 30px;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    margin: 10pt 0;
  }

  th, td {
    border: 1px solid #000;
    padding: 8pt;
    text-align: left;
  }

  th {
    background: #f0f0f0;
    font-weight: bold;
  }

  .no-print {
    display: none !important;
  }
}
