html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Main content */
main {
  flex: 1;
}

/* Hero Section */
.hero-section {
  padding: 3rem 0;
  display: flex;
  align-items: center;
}

/* Generator Cards */
.generator-card {
  border: none;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: white;
}

.generator-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

.generator-icon {
  font-size: 3.5rem;
  color: #0d6efd;
  margin-bottom: 1rem;
}

.generator-card .card-title {
  font-weight: 600;
  color: #212529;
  font-size: 1.1rem;
}

.generator-card .btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.generator-card .btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
  transform: scale(1.02);
}

/* Form Cards */
.card {
  border-radius: 12px;
  border: none;
}

.card-header {
  border-radius: 12px 12px 0 0 !important;
  border: none;
  padding: 1.5rem;
}

.card-header.bg-primary {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%) !important;
}

.card-body {
  padding: 2rem;
}

.form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.5rem;
}

.form-control {
  border-radius: 8px;
  border: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn-secondary {
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
}

/* Navbar */
.navbar-brand {
  font-size: 1.25rem;
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #fff;
}

/* Footer */
footer {
  margin-top: auto;
}

/* Modern Minimalist Design for Consent Collection Form */

/* Main Card */
.modern-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.card-header-modern {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem;
  border-bottom: none;
}

.card-title-modern {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}

.card-body-modern {
  padding: 2.5rem;
  background: #ffffff;
}

/* Form Sections */
.form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.form-note {
  background-color: #f8f9fa;
  border-left: 3px solid #667eea;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 1rem;
}

.form-note strong {
  color: #1f2937;
  display: block;
  margin-bottom: 0.5rem;
}

.form-note p {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.form-note ul {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

.form-note li {
  margin-bottom: 0.25rem;
  line-height: 1.6;
}

.form-section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Labels */
.label-modern {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.required-mark {
  color: #ef4444;
  font-weight: 700;
}

/* Modern Input Fields */
.input-modern {
  width: 100%;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  color: #1f2937;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  transition: all 0.2s ease;
  outline: none;
}

.input-modern:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  background: #ffffff;
}

.input-modern::placeholder {
  color: #9ca3af;
}

.input-modern-sm {
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.9rem;
  color: #1f2937;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
  outline: none;
}

.input-modern-sm:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-modern-sm::placeholder {
  color: #9ca3af;
}

textarea.input-modern {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
  width: 100%;
}

/* Modern Select */
.select-modern {
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.9rem;
  color: #1f2937;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
  outline: none;
  cursor: pointer;
}

.select-modern:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.select-modern option {
  padding: 0.5rem;
}

/* Table Modern */
.table-wrapper-modern {
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  background: #ffffff;
}

.table-modern {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  margin: 0;
}

.table-modern thead {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.table-modern thead th {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
  letter-spacing: -0.01em;
}

.table-modern tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.table-modern tbody tr:last-child td {
  border-bottom: none;
}

.table-modern tbody tr:hover {
  background: #f9fafb;
}

.table-modern .table-danger {
  background: #fef2f2;
}

.table-modern .table-danger td {
  background: #fef2f2;
  border-color: #fecaca;
}

.table-modern .is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Selected Methods Display */
.selected-methods-modern {
  min-height: 70px;
  padding: 1rem;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.selected-methods-modern .badge {
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem;
  margin: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 20px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.selected-methods-modern .badge.bg-primary {
  background: #667eea !important;
}

.selected-methods-modern .badge.bg-success {
  background: #10b981 !important;
}

.badge-modern {
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem;
  margin: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 20px;
  font-weight: 500;
  transition: all 0.2s ease;
  background: #667eea;
  color: #ffffff;
}

.badge-modern.badge-custom {
  background: #10b981 !important;
  color: #ffffff;
}

.badge-modern .badge-close {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.85em;
  opacity: 0.9;
  transition: opacity 0.2s ease;
  padding: 0;
  margin-left: 0.25rem;
  display: inline-flex;
  align-items: center;
}

.badge-modern .badge-close:hover {
  opacity: 1;
}

.selected-methods-modern .badge i {
  cursor: pointer;
  font-size: 0.85em;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.selected-methods-modern .badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.selected-methods-modern .badge i:hover {
  opacity: 1;
}

.no-methods-message {
  color: #6b7280;
  font-size: 0.875rem;
  font-style: italic;
  padding: 0.5rem 0;
}

/* Dropdown Modern */
.dropdown-modern {
  position: relative;
  margin-bottom: 1rem;
}

.dropdown-btn-modern {
  width: 100%;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: #1f2937;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  outline: none;
}

.dropdown-btn-modern:hover {
  border-color: #667eea;
  background: #f9fafb;
}

.dropdown-btn-modern:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.dropdown-btn-modern[aria-expanded="true"] {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.dropdown-btn-modern[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

.dropdown-btn-modern .bi-chevron-down {
  transition: transform 0.2s ease;
  margin-left: auto;
  font-size: 0.875rem;
  color: #6b7280;
}

.dropdown-menu-modern {
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.5rem;
  margin-top: 0.5rem;
  z-index: 1000;
  display: none;
}

.dropdown-menu-modern.show {
  display: block;
}

.dropdown-item-modern {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-bottom: 0.25rem;
}

.dropdown-item-modern:hover {
  background: #f9fafb;
}

.checkbox-modern {
  width: 18px;
  height: 18px;
  margin-right: 0.75rem;
  cursor: pointer;
  accent-color: #667eea;
}

/* Custom Input Group */
.custom-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.custom-input-group .input-modern-sm {
  flex: 1;
}

/* Icon Buttons */
.btn-icon-danger,
.btn-icon-success {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 2px solid;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn-icon-danger {
  color: #ef4444;
  border-color: #fecaca;
}

.btn-icon-danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
  transform: scale(1.05);
}

.btn-icon-success {
  color: #10b981;
  border-color: #a7f3d0;
}

.btn-icon-success:hover {
  background: #ecfdf5;
  border-color: #10b981;
  transform: scale(1.05);
}

/* Modern Buttons */
.btn-modern {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
  text-decoration: none;
}

.btn-primary-modern {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
  color: #ffffff;
}

.btn-secondary-modern {
  background: #ffffff;
  color: #374151;
  border: 2px solid #e5e7eb;
}

.btn-secondary-modern:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

/* Compact Add Row Button */
.btn-add-row {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.btn-add-row:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
  color: #ffffff;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 2px solid #f3f4f6;
}

/* Alert Modern */
.alert-modern {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.alert-danger-modern {
  background: #fef2f2;
  border: 2px solid #fecaca;
  color: #991b1b;
}

/* Error Text */
.error-text {
  display: block;
  font-size: 0.875rem;
  color: #ef4444;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Radio buttons */
input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

label:has(input[type="radio"]) {
  cursor: pointer;
  user-select: none;
}

/* Modal styles */
.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  padding: 1.5rem;
}

.modal-title {
  font-weight: 600;
  color: #333;
}

.modal-body {
  padding: 0;
  overflow-y: auto;
  overflow-x: auto;
  max-height: calc(100vh - 200px);
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1.5rem;
}

#previewContent iframe {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Document preview styles - имитация Word документа */
.word-document-preview {
  background: #f5f5f5;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

.word-page {
  background: white;
  width: 210mm; /* A4 ширина */
  min-height: 297mm; /* A4 высота */
  padding: 25.4mm 20mm 25.4mm 30mm; /* Верх 1" (25.4mm), Низ 1" (25.4mm), Справа 2cm (20mm), Слева 3cm (30mm) */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  font-family: 'Times New Roman', serif;
  font-size: 11pt;
  line-height: 1.5;
  color: #000;
  text-align: left;
  margin: 0;
  flex-shrink: 0;
}

.word-title {
  font-family: 'Times New Roman', serif;
  font-size: 12pt;
  font-weight: bold;
  text-align: center !important;
  margin: 0 0 1.5rem 0;
  padding: 0;
  line-height: 1.5;
  width: 100%;
}

.word-page p {
  font-family: 'Times New Roman', serif;
  font-size: 11pt;
  text-align: left;
  margin: 0.5rem 0;
  padding: 0;
  line-height: 1.5;
}

.word-text {
  font-family: 'Times New Roman', serif;
  font-size: 11pt;
  font-weight: normal;
  text-align: left;
  margin: 0.5rem 0;
  padding: 0;
  line-height: 1.5;
}

.word-text-bold {
  font-family: 'Times New Roman', serif;
  font-size: 11pt;
  font-weight: bold;
  text-align: left;
  margin: 0.5rem 0;
  padding: 0;
  line-height: 1.5;
}

.word-text-center {
  display: block;
  text-align: center;
  font-family: 'Times New Roman', serif;
  font-size: 11pt;
}

.word-signature-block {
  margin-top: 2rem;
}

.word-signature-line {
  font-family: 'Times New Roman', serif;
  font-size: 11pt;
  margin: 0;
  padding: 0;
  white-space: pre;
  text-align: left;
}

.word-signature-labels {
  font-family: 'Times New Roman', serif;
  font-size: 11pt;
  margin: 0.5rem 0 0 0;
  padding: 0;
  white-space: pre;
  text-align: left;
}

.word-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-family: 'Times New Roman', serif;
  font-size: 11pt;
}

.word-page table td,
.word-page table th {
  border: 1px solid #000;
  padding: 8px;
  text-align: left;
  font-family: 'Times New Roman', serif;
  font-size: 11pt;
}

.word-page table th {
  background-color: #f0f0f0;
  font-weight: bold;
  text-align: center;
}

/* Стили для жирного текста */
.word-page strong,
.word-page b {
  font-weight: bold;
}

/* Стили для маркированного списка */
.word-bullet-list {
  font-family: 'Times New Roman', serif;
  font-size: 11pt;
  line-height: 1.5;
  margin: 0.5rem 0;
  padding-left: 0;
  text-align: left;
  white-space: pre-line;
}

.word-bullet-list br {
  display: block;
  content: "";
  margin-top: 0;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .word-document-preview {
    padding: 1rem;
  }
  
  .word-page {
    width: 100%;
    padding: 15mm 10mm;
  }
}

/* Spinner animation */
.spinner-border {
  width: 2rem;
  height: 2rem;
  border-width: 0.2em;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* Disabled button styles */
.btn-modern:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-modern.btn-secondary-modern:disabled {
  background: #6c757d;
  border-color: #6c757d;
}

/* Download button animation */
#downloadBtn:disabled {
  opacity: 0.7;
}

#downloadBtnSpinner {
  margin-left: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .card-body-modern {
    padding: 1.5rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn-modern {
    width: 100%;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  #previewContent iframe {
    height: 400px;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 0;
  }
  
  .generator-icon {
    font-size: 2.5rem;
  }
  
  .card-body {
    padding: 1.5rem;
  }

  #purposesTable {
    font-size: 0.8rem;
  }

  #purposesTable th,
  #purposesTable td {
    padding: 0.5rem 0.25rem;
  }
}