/* Enhanced Brief AI Agents Styles - SIBUR Edition */

/* Container and Layout */
.brief-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* SIBUR Badge */
.sibur-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FF6B6B, #C44569);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.brief-intro {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    border-radius: 20px;
}

.intro-description {
    max-width: 800px;
    margin: 1.5rem auto;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #888;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.subtitle {
    color: #999;
    font-size: 1.3rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Progress Bar */
.progress-container {
    margin-top: 2rem;
    padding: 1rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    color: #888;
    font-size: 0.9rem;
}

/* Form Styles */
.brief-form {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 0;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Form Sections */
.form-section {
    margin-bottom: 0;
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

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

.form-section:hover {
    background: rgba(255, 255, 255, 0.02);
}

.form-section.active .section-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.section-header {
    padding: 2rem;
    background: transparent;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    user-select: none;
}

.section-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
}

.section-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #fff;
    font-weight: 600;
}

.toggle-icon {
    font-size: 1.5rem;
    color: #667eea;
    transition: transform 0.3s ease;
}

.section-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.section-content {
    padding: 2rem 3rem 3rem;
    display: block;
    animation: slideDown 0.3s ease;
}

.section-content.hidden {
    display: none;
}

/* Form Groups */
.form-group {
    margin-bottom: 3rem;
}

.form-group h4 {
    color: #667eea;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.form-description {
    color: #999;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* Radio and Checkbox Cards */
.radio-group {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.checkbox-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.checkbox-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.radio-card,
.checkbox-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-card input,
.checkbox-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card-content,
.checkbox-content {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.radio-card-content::before,
.checkbox-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0) 0%, rgba(118, 75, 162, 0) 100%);
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.radio-card:hover .radio-card-content,
.checkbox-card:hover .checkbox-content {
    background: rgba(102, 126, 234, 0.05);
    border-color: rgba(102, 126, 234, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
}

.radio-card input:checked ~ .radio-card-content,
.checkbox-card input:checked ~ .checkbox-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    border-color: #667eea;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.25);
}

.radio-card input:checked ~ .radio-card-content::after,
.checkbox-card input:checked ~ .checkbox-content::after {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 25px;
    height: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.radio-card-content strong,
.checkbox-content strong {
    display: block;
    color: #fff;
    margin-bottom: 0.7rem;
    font-size: 1.1rem;
}

.radio-card-content span,
.checkbox-content span {
    display: block;
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.5;
}

.radio-card-content p,
.checkbox-content p {
    margin: 0.5rem 0 0;
    color: #999;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Badge */
.badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

/* Feature Lists */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0.8rem 0 0;
}

.feature-list li {
    color: #999;
    font-size: 0.85rem;
    padding: 0.3rem 0;
    padding-left: 1.2rem;
    position: relative;
}

.feature-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.feature-list.compact li {
    font-size: 0.82rem;
    padding: 0.2rem 0 0.2rem 1.2rem;
}

/* Input Fields */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper label {
    display: block;
    margin-bottom: 0.6rem;
    color: #999;
    font-size: 0.95rem;
    font-weight: 500;
}

.input-wrapper input,
.input-wrapper textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.input-wrapper input:focus,
.input-wrapper textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #667eea;
    box-shadow: 0 0 25px rgba(102, 126, 234, 0.25);
}

.input-wrapper input::placeholder,
.input-wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

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

/* Summary Section */
.summary-section {
    padding: 3rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 20px;
    margin: 2rem 2rem;
}

.summary-section h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.2rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-label {
    color: #888;
    font-size: 0.9rem;
}

.summary-value {
    color: #667eea;
    font-weight: 600;
}

.summary-note {
    color: #999;
    text-align: center;
    margin: 2rem 0 1rem;
}

.deliverables-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.deliverables-list li {
    padding: 0.8rem 0;
    color: #aaa;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.deliverables-list li:last-child {
    border-bottom: none;
}

/* Submit Button */
.form-actions {
    padding: 3rem;
    text-align: center;
}

.submit-button {
    position: relative;
    padding: 1.3rem 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 60px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.35);
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 45px rgba(102, 126, 234, 0.45);
}

.submit-button:hover:before {
    left: 100%;
}

.submit-button:active {
    transform: translateY(-1px);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form Messages */
.form-message {
    margin-top: 2rem;
    padding: 1.2rem;
    border-radius: 12px;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s ease;
    font-weight: 500;
}

.form-message.success {
    background: rgba(52, 211, 153, 0.15);
    border: 2px solid rgba(52, 211, 153, 0.3);
    color: #34d399;
    display: block;
}

.form-message.error {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    display: block;
}

/* Additional Info */
.additional-info {
    padding: 2rem 3rem;
    text-align: center;
}

.info-text {
    color: #888;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-text strong {
    color: #aaa;
}

/* Logo Link */
.bear-link {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    opacity: 0.6;
    transition: all 0.3s ease;
    z-index: 100;
}

.bear-link:hover {
    opacity: 1;
    transform: scale(1.1);
}

.logo-img {
    width: 120px;
    height: auto;
    filter: brightness(0.9);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .checkbox-grid,
    .radio-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .brief-container {
        padding: 1rem;
    }
    
    .gradient-text {
        font-size: 2rem;
    }
    
    .section-content {
        padding: 1.5rem;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .submit-button {
        width: 100%;
        padding: 1.2rem 2rem;
    }
    
    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .section-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .bear-link {
        bottom: 1rem;
        right: 1rem;
    }
    
    .logo-img {
        width: 80px;
    }
}

/* Dark theme optimizations */
@media (prefers-color-scheme: light) {
    body {
        background: #f5f5f5;
    }
    
    .brief-form {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    }
    
    .section-header h3,
    .radio-card-content strong,
    .checkbox-content strong {
        color: #333;
    }
    
    .input-wrapper input,
    .input-wrapper textarea {
        background: rgba(0, 0, 0, 0.03);
        color: #333;
        border-color: rgba(0, 0, 0, 0.08);
    }
    
    .form-section {
        border-bottom-color: rgba(0, 0, 0, 0.05);
    }
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: #fff;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: #fff;
}

/* Фиксация высоты для всех свернутых секций */
.form-section .section-header.collapsed {
    min-height: 100px;
    max-height: 100px;
    box-sizing: border-box;
}

/* Убедимся, что контент в свернутом заголовке выровнен правильно */
.form-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
}

/* Специальное правило для контактной секции, чтобы обеспечить одинаковую высоту */
.form-section[data-section="contact"] .section-header.collapsed {
    min-height: 100px;
    max-height: 100px;
}

/* Переопределение стилей для единообразной высоты всех свернутых секций */
.form-section {
    transition: all 0.3s ease;
}

.form-section .section-header.collapsed {
    height: 100px !important;
    min-height: 100px !important;
    max-height: 100px !important;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    box-sizing: border-box;
}

/* Убедимся, что все секции имеют одинаковое поведение */
.form-section[data-section="contact"] {
    opacity: 1 !important;
}

.form-section[data-section="contact"] .section-header.collapsed {
    height: 100px !important;
    min-height: 100px !important;
    max-height: 100px !important;
}

/* Убираем любые дополнительные отступы для контактной секции */
.form-section[data-section="contact"] {
    margin-bottom: 0;
    padding: 0;
}

/* ФИНАЛЬНОЕ ПЕРЕОПРЕДЕЛЕНИЕ - Унифицированная высота для всех свернутых секций */
.form-section .section-header {
    transition: all 0.3s ease !important;
}

.form-section .section-header.collapsed {
    height: 90px !important;
    min-height: 90px !important; 
    max-height: 90px !important;
    padding: 1.5rem 2rem !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Специально для контактной секции - те же правила */
section[data-section="contact"] .section-header.collapsed {
    height: 90px !important;
    min-height: 90px !important;
    max-height: 90px !important;
}

/* Убедимся, что нет лишних margin/padding для контактной секции */
section[data-section="contact"] {
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   НОВЫЙ БЛОК КОНТАКТНОЙ ИНФОРМАЦИИ
   ============================================ */

.contact-section-final {
    margin-top: 4rem;
    padding: 4rem 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.contact-section-final::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(102, 126, 234, 0.5), 
        rgba(118, 75, 162, 0.5), 
        transparent
    );
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.contact-header {
    text-align: center;
    margin-bottom: 3rem;
}

.contact-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.contact-form-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 3rem;
    backdrop-filter: blur(10px);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

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

.column-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.contact-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required {
    color: #ff6b6b;
}

.contact-input,
.contact-textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: #fff;
    transition: all 0.3s ease;
}

.contact-input:hover,
.contact-textarea:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.contact-input:focus,
.contact-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.contact-input::placeholder,
.contact-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.contact-textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-full-width {
    margin-bottom: 2rem;
}

.contact-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.privacy-agreement {
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.privacy-link {
    color: rgba(102, 126, 234, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.privacy-link:hover {
    color: #667eea;
    text-decoration: underline;
}

.contact-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.contact-submit-btn:hover::before {
    left: 100%;
}

.contact-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.contact-submit-btn:hover .btn-icon {
    transform: translateX(5px);
}

/* Адаптивность для контактной формы */
@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-form-wrapper {
        padding: 2rem 1.5rem;
    }
    
    .contact-title {
        font-size: 2rem;
    }
    
    .contact-actions {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }
    
    .contact-submit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Темная тема совместимость */
@media (prefers-color-scheme: light) {
    .contact-section-final {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    }
    
    .contact-form-wrapper {
        background: rgba(255, 255, 255, 0.8);
        border-color: rgba(0, 0, 0, 0.1);
    }
    
    .contact-input,
    .contact-textarea {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 0, 0, 0.1);
        color: #333;
    }
    
    .field-label,
    .column-title {
        color: #333;
    }
    
    .contact-input::placeholder,
    .contact-textarea::placeholder {
        color: rgba(0, 0, 0, 0.4);
    }
}

/* Фикс для последней секции формы */
.form-section[data-section="8"] {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
}

.form-section[data-section="8"].active {
    height: auto !important;
}

/* Убедимся, что секция в свернутом состоянии имеет фиксированную высоту */
.form-section[data-section="8"] .section-header.collapsed {
    height: 90px !important;
    min-height: 90px !important;
    max-height: 90px !important;
}

/* Когда секция раскрыта, высота должна быть автоматической */
.form-section[data-section="8"] .section-content {
    height: auto !important;
    max-height: none !important;
}

/* Убираем любые flex-grow для всех секций */
.form-section {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
}

/* Главный контейнер формы не должен растягиваться */
.brief-form {
    display: block !important;
    height: auto !important;
    min-height: unset !important;
}

/* Выравнивание заголовков секций по левому краю */
.section-header {
    padding: 2rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.section-title {
    display: flex !important;
    align-items: center !important;
    gap: 1.5rem !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Убедимся, что номера секций и заголовки выровнены правильно */
.section-number {
    flex-shrink: 0 !important;
    margin-left: 0 !important;
}

.section-title h3 {
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

/* Выравнивание контента секций с заголовками */
.section-content {
    padding: 2rem !important;
    padding-top: 0 !important;
}

/* Специальное выравнивание для первой и последней секций */
.form-section[data-section="1"] .section-title,
.form-section[data-section="8"] .section-title {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Убедимся, что все заголовки секций имеют одинаковый отступ слева */
.form-section .section-header {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

/* Выравнивание номеров секций */
.section-number {
    width: 50px !important;
    text-align: center !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Консистентное выравнивание для всех секций */
.form-section {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
    .section-header {
        padding: 1.5rem !important;
    }
    
    .section-content {
        padding: 1.5rem !important;
        padding-top: 0 !important;
    }
    
    .form-section .section-header {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

/* ============================================
   ФИНАЛЬНОЕ ИСПРАВЛЕНИЕ ВЫРАВНИВАНИЯ СЕКЦИЙ
   ============================================ */

/* Сброс всех предыдущих стилей выравнивания */
.form-section {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Все заголовки секций должны иметь одинаковые отступы */
.form-section .section-header {
    margin: 0 !important;
    padding: 1.5rem 2rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Контент секций тоже должен иметь одинаковые отступы */
.form-section .section-content {
    margin: 0 !important;
    padding: 0 2rem 2rem 2rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Убираем любые дополнительные отступы у brief-form */
.brief-form {
    padding: 0 !important;
    overflow: hidden !important;
}

/* Первая секция должна иметь закругление сверху */
.form-section:first-child .section-header {
    border-top-left-radius: 25px !important;
    border-top-right-radius: 25px !important;
}

/* Последняя видимая секция формы (не контактная) */
.form-section[data-section="8"] {
    border-bottom-left-radius: 25px !important;
    border-bottom-right-radius: 25px !important;
    overflow: hidden !important;
}

/* Убедимся, что номера и заголовки выровнены */
.section-title {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    flex: 1 !important;
}

.section-number {
    width: 40px !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.section-title h3 {
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 !important;
}

/* Toggle icon выравнивание */
.toggle-icon {
    margin-left: auto !important;
    flex-shrink: 0 !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .form-section .section-header {
        padding: 1.25rem 1.5rem !important;
    }
    
    .form-section .section-content {
        padding: 0 1.5rem 1.5rem 1.5rem !important;
    }
}

/* Убедимся, что все секции имеют одинаковую ширину */
.brief-container .form-section {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ============================================
   ПРОДВИНУТАЯ МОБИЛЬНАЯ АДАПТИВНОСТЬ
   ============================================ */

/* Базовые мобильные стили (все телефоны) */
@media (max-width: 480px) {
    /* Оптимизация контейнера для маленьких экранов */
    .brief-container {
        padding: 0.75rem !important;
        max-width: 100% !important;
    }
    
    /* Форма занимает всю ширину на мобильных */
    .brief-form {
        border-radius: 15px !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Заголовок страницы */
    header h1 {
        font-size: 1.5rem !important;
        padding: 1rem !important;
        line-height: 1.3 !important;
    }
    
    /* Секции формы - улучшенная touch-область */
    .form-section .section-header {
        padding: 1rem !important;
        min-height: 60px !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1) !important;
    }
    
    /* Номера секций адаптивны */
    .section-number {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.875rem !important;
    }
    
    /* Заголовки секций */
    .section-title h3 {
        font-size: 1rem !important;
        font-weight: 600 !important;
    }
    
    /* Toggle иконка больше для удобства касания */
    .toggle-icon {
        font-size: 1.25rem !important;
        padding: 0.5rem !important;
        margin: -0.5rem -0.5rem -0.5rem 0 !important;
    }
    
    /* Контент секций */
    .section-content {
        padding: 0 1rem 1rem 1rem !important;
    }
    
    /* Заголовки внутри секций */
    .form-group h4 {
        font-size: 1.125rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* Описания */
    .form-description {
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Карточки с чекбоксами - вертикальная ориентация */
    .checkbox-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .checkbox-card {
        padding: 1rem !important;
        border-radius: 12px !important;
    }
    
    /* Радио-кнопки - вертикальная ориентация */
    .radio-group {
        gap: 0.75rem !important;
    }
    
    .radio-card {
        padding: 1rem !important;
    }
    
    .radio-card-content {
        padding-left: 2rem !important;
    }
    
    /* Списки внутри карточек */
    .feature-list {
        font-size: 0.8125rem !important;
        padding-left: 1.25rem !important;
    }
    
    .feature-list li {
        margin-bottom: 0.375rem !important;
    }
    
    /* Бейджи */
    .badge {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
}

/* Планшеты в портретной ориентации */
@media (min-width: 481px) and (max-width: 768px) {
    .brief-container {
        padding: 1.5rem !important;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .section-header {
        padding: 1.25rem 1.5rem !important;
    }
    
    .section-content {
        padding: 0 1.5rem 1.5rem 1.5rem !important;
    }
    
    .section-number {
        width: 36px !important;
        height: 36px !important;
    }
}

/* Маленькие планшеты и большие телефоны в ландшафтной ориентации */
@media (min-width: 481px) and (max-width: 768px) and (orientation: landscape) {
    .checkbox-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    header h1 {
        font-size: 1.75rem !important;
        padding: 1.25rem !important;
    }
}

/* Большие планшеты */
@media (min-width: 769px) and (max-width: 1024px) {
    .brief-container {
        padding: 2rem !important;
        max-width: 900px !important;
    }
    
    .checkbox-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .checkbox-grid.compact {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   КОНТАКТНАЯ ФОРМА - МОБИЛЬНАЯ АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    /* Заголовок контактной формы */
    .contact-title {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .contact-subtitle {
        font-size: 1rem !important;
        padding: 0 1rem !important;
    }
    
    /* Контейнер формы */
    .contact-container {
        padding: 0 1rem !important;
    }
    
    .contact-form-wrapper {
        padding: 1.5rem !important;
        border-radius: 12px !important;
    }
    
    /* Сетка - одна колонка на мобильных */
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Заголовки колонок */
    .column-title {
        font-size: 1.125rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* Поля ввода */
    .contact-input,
    .contact-textarea {
        font-size: 16px !important; /* Предотвращает зум на iOS */
        padding: 0.75rem !important;
    }
    
    /* Лейблы */
    .field-label {
        font-size: 0.8125rem !important;
    }
    
    /* Кнопка отправки */
    .contact-submit-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 1rem 2rem !important;
        font-size: 1rem !important;
    }
    
    /* Privacy agreement */
    .contact-actions {
        flex-direction: column !important;
        gap: 1.25rem !important;
    }
    
    .privacy-agreement {
        width: 100% !important;
    }
    
    .checkbox-label {
        font-size: 0.8125rem !important;
    }
}

@media (max-width: 480px) {
    /* Еще более компактные стили для маленьких экранов */
    .contact-section-final {
        padding: 2rem 0 !important;
        margin-top: 2rem !important;
    }
    
    .contact-header {
        margin-bottom: 2rem !important;
    }
    
    .contact-form-wrapper {
        padding: 1.25rem !important;
        border: none !important;
        background: rgba(255, 255, 255, 0.01) !important;
    }
    
    .contact-field {
        margin-bottom: 1rem !important;
    }
    
    .contact-textarea {
        min-height: 80px !important;
    }
}

/* ============================================
   СПЕЦИАЛЬНЫЕ МОБИЛЬНЫЕ УЛУЧШЕНИЯ
   ============================================ */

/* Улучшенные состояния для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    /* Увеличенные области касания */
    .checkbox-card,
    .radio-card {
        min-height: 60px !important;
    }
    
    /* Убираем hover эффекты на touch устройствах */
    .checkbox-card:hover,
    .radio-card:hover {
        background: inherit !important;
    }
    
    /* Active состояние для feedback */
    .checkbox-card:active,
    .radio-card:active,
    .section-header:active {
        background: rgba(102, 126, 234, 0.05) !important;
        transform: scale(0.98) !important;
    }
    
    /* Кнопки с лучшим feedback */
    .contact-submit-btn:active {
        transform: scale(0.97) !important;
    }
    
    /* Увеличенные чекбоксы для мобильных */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px !important;
        height: 20px !important;
        cursor: pointer !important;
    }
}

/* Оптимизация для iPhone X и новее (с notch) */
@supports (padding-top: env(safe-area-inset-top)) {
    .brief-container {
        padding-left: calc(1rem + env(safe-area-inset-left)) !important;
        padding-right: calc(1rem + env(safe-area-inset-right)) !important;
    }
    
    header {
        padding-top: env(safe-area-inset-top) !important;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    header h1 {
        font-size: 1.5rem !important;
        padding: 0.75rem !important;
    }
    
    .form-section .section-header {
        padding: 0.75rem 1rem !important;
        min-height: 50px !important;
    }
    
    .contact-section-final {
        padding: 2rem 0 !important;
    }
}

/* Доступность - увеличенный размер шрифта */
@media (prefers-contrast: high) {
    .form-description,
    .field-label,
    .checkbox-label {
        font-weight: 500 !important;
    }
    
    .checkbox-card,
    .radio-card {
        border-width: 2px !important;
    }
}

/* Оптимизация производительности для слабых устройств */
@media (max-width: 768px) {
    /* Отключаем тяжелые эффекты на мобильных */
    .brief-form {
        backdrop-filter: none !important;
        background: rgba(20, 20, 30, 0.95) !important;
    }
    
    .contact-form-wrapper {
        backdrop-filter: none !important;
        background: rgba(30, 30, 40, 0.95) !important;
    }
    
    /* Упрощаем тени */
    * {
        box-shadow: none !important;
    }
    
    .brief-form,
    .contact-form-wrapper {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    }
}

/* Печатающийся текст на мобильных */
@media (max-width: 480px) {
    .typewriter-text {
        font-size: 1.25rem !important;
        min-height: 2.5em !important;
    }
    
    .typewriter-cursor {
        font-size: 1.25rem !important;
    }
}

/* Фикс для клавиатуры на мобильных */
@media (max-height: 500px) and (max-width: 768px) {
    /* Когда открыта клавиатура */
    .contact-section-final {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    header {
        display: none !important;
    }
}

/* Улучшенная прокрутка на iOS */
@supports (-webkit-overflow-scrolling: touch) {
    .brief-container {
        -webkit-overflow-scrolling: touch !important;
    }
}

/* ============================================
   УЛУЧШЕННАЯ АНИМАЦИЯ РАСКРЫТИЯ ПАНЕЛЕЙ
   ============================================ */

/* Сброс всех предыдущих анимаций для секций */
.form-section .section-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform-origin: top !important;
    overflow: hidden !important;
}

/* Скрытое состояние - используем max-height для плавной анимации */
.form-section .section-content.hidden {
    max-height: 0 !important;
    opacity: 0 !important;
    transform: scaleY(0) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    visibility: hidden !important;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                transform 0.3s ease,
                padding 0.3s ease,
                margin 0.3s ease,
                visibility 0s 0.4s !important;
}

/* Открытое состояние */
.form-section .section-content:not(.hidden) {
    max-height: 5000px !important;
    opacity: 1 !important;
    transform: scaleY(1) !important;
    visibility: visible !important;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease 0.1s,
                transform 0.3s ease,
                padding 0.3s ease,
                margin 0.3s ease,
                visibility 0s !important;
}

/* Специальная обработка для первой секции */
/* Removed section-1 specific transform - using common animation instead */
/* .form-section[data-section="1"] .section-content { */
/*     transform-origin: top center !important; */
/* } */


/* Removed section-1 specific transform - using common animation instead */
/* .form-section[data-section="1"] .section-content.hidden { */
/*     transform: scaleY(0) translateY(-10px) !important; */
/* } */


/* Removed section-1 specific transform - using common animation instead */
/* .form-section[data-section="1"] .section-content:not(.hidden) { */
/*     transform: scaleY(1) translateY(0) !important; */
/* } */


/* Анимация иконки toggle */
.toggle-icon {
    transition: transform 0.3s ease !important;
    display: inline-block !important;
}

.section-header.collapsed .toggle-icon {
    transform: rotate(-90deg) !important;
}

.section-header:not(.collapsed) .toggle-icon {
    transform: rotate(0deg) !important;
}

/* Дополнительные эффекты при раскрытии */
.form-section.active {
    background: rgba(255, 255, 255, 0.02) !important;
    transition: background 0.3s ease !important;
}

/* Плавное появление контента внутри секции */
.section-content:not(.hidden) > * {
    animation: contentFadeIn 0.5s ease forwards;
    opacity: 0;
}

.section-content:not(.hidden) > *:nth-child(1) { animation-delay: 0.1s; }
.section-content:not(.hidden) > *:nth-child(2) { animation-delay: 0.15s; }
.section-content:not(.hidden) > *:nth-child(3) { animation-delay: 0.2s; }
.section-content:not(.hidden) > *:nth-child(4) { animation-delay: 0.25s; }
.section-content:not(.hidden) > *:nth-child(5) { animation-delay: 0.3s; }

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Оптимизация для мобильных устройств */
@media (max-width: 768px) {
    .form-section .section-content {
        transition-duration: 0.3s !important;
    }
    
    /* Отключаем сложные анимации на мобильных */
    .section-content:not(.hidden) > * {
        animation: none !important;
        opacity: 1 !important;
    }
}

/* Убедимся, что все секции используют одинаковую анимацию */
/* .form-section[data-section="1"] .section-content, */
.form-section[data-section="2"] .section-content,
.form-section[data-section="3"] .section-content,
.form-section[data-section="4"] .section-content,
.form-section[data-section="5"] .section-content,
.form-section[data-section="6"] .section-content,
.form-section[data-section="7"] .section-content,
.form-section[data-section="8"] .section-content {
    transform-origin: top center !important;
    will-change: max-height, transform, opacity !important;
}

/* Предотвращаем горизонтальное расширение */
.form-section {
    overflow-x: hidden !important;
}

.form-section .section-content {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Фикс для Firefox */
@-moz-document url-prefix() {
    .form-section .section-content.hidden {
        display: none !important;
    }
    
    .form-section .section-content:not(.hidden) {
        display: block !important;
    }
}


/* ==================================
   UNIFIED VERTICAL SLIDE ANIMATION FIX
   ================================== */

/* Ensure all sections use consistent vertical slide animation */
.form-section .section-content {
    transform: none !important;
    transform-origin: top center !important;
}

.form-section .section-content.hidden {
    display: none !important;
    transform: none !important;
}

.form-section .section-content:not(.hidden) {
    display: block !important;
    animation: slideDown 0.3s ease forwards !important;
    transform: none !important;
}

/* Override section 1 explicitly */
.form-section[data-section="1"] .section-content {
    transform: none !important;
}
.form-section[data-section="1"] .section-content.hidden {
    display: none !important;
    transform: none !important;
}
.form-section[data-section="1"] .section-content:not(.hidden) {
    display: block !important;
    animation: slideDown 0.3s ease forwards !important;
    transform: none !important;
}
