
.ask-q {
  padding: 15px 20px;
  font-size: 18px;
    background: #2c3e50;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgb(50 62 75 / 30%)
}

.ask-q:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,123,255,0.4);
  background: #0069d9;
}

.ask-q:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(0,123,255,0.2);
}
/* Изолированные стили модалки */
#custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    display: none;
    z-index: 2147483647;
    backdrop-filter: blur(5px);
}

#custom-modal {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    width: 100%;
    max-width: 700px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
    z-index: 2147483647;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 30px;
}

#custom-modal.visible {
    bottom: 0;
}

/* Стили формы */
#form4 {
    position: relative;
}

#form4 input,
#form4 textarea {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

#form4 button[type="submit"] {
    padding: 15px 30px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
}

.custom-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
}


 :root {
            --primary-color: #2c3e50;
            --secondary-color: #3498db;
            --accent-color: #e74c3c;
            --light-color: #ecf0f1;
            --dark-color: #2c3e50;
            --success-color: #27ae60;
            --warning-color: #f39c12;
            --border-radius: 8px;
            --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }
        
















        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        
        body {
            font-family: 'PT Serif', serif;
            line-height: 1.6;
            color: #333;
            background-color: #f5f7fa;
            padding: 0;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }
        
        /* Header */
        header {
            background-color: var(--primary-color);
            color: white;
            padding: 20px 0;
            box-shadow: var(--box-shadow);
            position: sticky;
            top: 0;
            z-index: 100;
        }
        
        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .logo {
            font-family: 'Roboto', sans-serif;
            font-size: 24px;
            font-weight: 700;
            display: flex;
            align-items: center;
        }
        
        .logo-icon {
            margin-right: 10px;
            font-size: 28px;
        }
        
        /* Main content */
        .main-content {
            display: flex;
            min-height: calc(100vh - 80px);
        }
        
        /* Sidebar */
        .sidebar {
            width: 280px;
            background-color: white;
            padding: 25px 20px;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
            position: sticky;
            top: 80px;
            height: calc(100vh - 80px);
            overflow-y: auto;
        }
        
        .sidebar-title {
            font-family: 'Roboto', sans-serif;
            font-size: 18px;
            font-weight: 500;
            margin-bottom: 20px;
            color: var(--primary-color);
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
        }
        
        .template-list {
            list-style: none;
        }
        
        .template-item {
            margin-bottom: 10px;
        }
        
        .template-btn {
            display: block;
            width: 100%;
            padding: 10px 15px;
            background-color: var(--light-color);
            border: none;
            border-radius: var(--border-radius);
            font-family: 'Roboto', sans-serif;
            text-align: left;
            cursor: pointer;
            transition: var(--transition);
        }
        
        .template-btn:hover {
            background-color: var(--secondary-color);
            color: white;
        }
        
        .template-btn.active {
            background-color: var(--secondary-color);
            color: white;
        }
        
        /* Document area */
        .document-area {
            flex: 1;
            padding: 30px;
            background-color: white;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
            margin: 20px;
            border-radius: var(--border-radius);
        }
        
        .document-header {
            text-align: center;
            margin-bottom: 30px;
        }
        
        .document-title {
            font-size: 22px;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 10px;
        }
        
        .document-meta {
            font-size: 14px;
            color: #777;
            margin-bottom: 20px;
        }
        
        /* Controls */
        .controls {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-bottom: 30px;
            flex-wrap: wrap;
        }
        
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: var(--border-radius);
            font-family: 'Roboto', sans-serif;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .btn-primary {
            background-color: var(--secondary-color);
            color: white;
        }
        
        .btn-primary:hover {
            background-color: #2980b9;
        }
        
        .btn-secondary {
            background-color: var(--light-color);
            color: var(--dark-color);
        }
        
        .btn-secondary:hover {
            background-color: #d5dbdb;
        }
        
        .btn-danger {
            background-color: var(--accent-color);
            color: white;
        }
        
        .btn-danger:hover {
            background-color: #c0392b;
        }
        
        .btn-icon {
            font-size: 16px;
        }
        
        /* Contract text */
        .contract-text {
            white-space: pre-wrap;
            font-size: 15px;
            line-height: 1.8;
        }
        
        .gap {
            display: inline-block;
            min-width: 150px;
            border-bottom: 1px solid #000;
            margin: 0 2px;
            cursor: pointer;
            position: relative;
            vertical-align: bottom;
            height: 22px;
            transition: var(--transition);
            background-image: linear-gradient(to right, #000 75%, transparent 75%);
            background-size: 4px 1px;
            background-repeat: repeat-x;
            background-position: left bottom;
            padding-bottom: 3px;
        }
        
        .gap.filled {
            background-image: none;
            color: var(--secondary-color);
            border-bottom: 1px solid var(--secondary-color);
            font-weight: 500;
        }
        
        .gap:hover {
            background-color: rgba(52, 152, 219, 0.1);
        }
        
        .input-popup {
            position: absolute;
            top: -50px;
            left: 50%;
            transform: translateX(-50%);
            background: white;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            z-index: 10;
            display: none;
            width: 250px;
        }
        
        .input-popup input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: var(--border-radius);
            font-family: 'PT Serif', serif;
            font-size: 14px;
        }
        
        .input-popup input:focus {
            outline: none;
            border-color: var(--secondary-color);
        }
        
        /* Signatures */
        .signature-line {
            display: flex;
            justify-content: space-between;
            margin-top: 60px;
            gap: 40px;
        }
        
        .signature {
            width: 100%;
            max-width: 350px;
        }
        
        .signature-title {
            font-weight: 700;
            margin-bottom: 15px;
        }
        
        /* Footer */
        footer {
            background-color: var(--primary-color);
            color: white;
            padding: 20px 0;
            text-align: center;
            margin-top: 40px;
        }
        
        .footer-text {
            font-family: 'Roboto', sans-serif;
            font-size: 14px;
        }
        
        /* Responsive */
        @media (max-width: 992px) {
            .main-content {
                flex-direction: column;
            }
            
            .sidebar {
                width: 100%;
                position: static;
                height: auto;
                margin-bottom: 20px;
            }
            
            .document-area {
                margin: 0;
                padding: 20px;
            }
        }
        
        @media (max-width: 768px) {
            .controls {
                flex-direction: column;
                align-items: center;
            }
            
            .btn {
                width: 100%;
                max-width: 300px;
                justify-content: center;
            }
            
            .signature-line {
                flex-direction: column;
                gap: 30px;
            }
            
            .signature {
                max-width: 100%;
            }
        }
        
        /* Print styles */
        @media print {
            header, .sidebar, .controls, footer {
                display: none !important;
            }
            
            .document-area {
                margin: 0;
                padding: 0;
                box-shadow: none;
            }
            
            .gap {
                background-image: none !important;
                color: #000 !important;
                border-bottom: 1px solid #000 !important;
            }
   
.search-container {
  display: flex;
  gap: 20px;
  margin: 20px;
}

.search-group {
  position: relative;
  width: 300px;
}

.search-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.output-results {
  position: absolute;
  width: 100%;
  background: white;
  border: 1px solid #ddd;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.result-item {
  display: block;
  padding: 8px;
  color: #333;
  text-decoration: none;
}

.result-item:hover {
  background: #f0f0f0;
}

.search-group p {
  color: #666;
  font-size: 0.9em;
  margin: 5px 0;
}