/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Карточки */
.card {
    position: absolute;
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    animation: float 4s ease-in-out infinite;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.service-card.featured {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
}

.article-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.case-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.case-card.case-clickable {
    cursor: pointer;
    position: relative;
}

.case-card.case-clickable:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.case-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.875rem;
}

.case-link i {
    font-size: 0.75rem;
}

.review-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.review-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.author-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.mini-post-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mini-post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* Формы */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

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

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    background: rgba(255, 255, 255, 0.9);
}

/* Модальное окно контактов в стиле iOS + Liquid Glass */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.contact-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.contact-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.contact-modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    width: 60%;
    max-width: 1100px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.contact-modal.active .contact-modal-content {
    transform: scale(1) translateY(0);
}

.contact-modal-header {
    padding: 24px 24px 16px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.1);
}

.contact-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

.contact-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #666;
}

.contact-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: scale(1.05);
}

.contact-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

/* Стили формы контактов */
.contact-form-group {
    margin-bottom: 20px;
}

.contact-form-group label {
    display: block;
    font-weight: 500;
    font-size: 15px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.contact-form-group input,
.contact-form-group select,
.contact-form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    box-sizing: border-box;
    color: #1a1a1a;
}

.contact-form-group input::placeholder,
.contact-form-group textarea::placeholder {
    color: #999;
}

.contact-form-group input:focus,
.contact-form-group select:focus,
.contact-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.contact-form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-hint {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    line-height: 1.4;
}

/* Чекбокс согласия */
.contact-privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #000000;
}

.contact-privacy-checkbox input[type='checkbox'] {
    display: none;
}

.contact-checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
    margin-top: 2px;
    display: inline-table;
}

.contact-privacy-checkbox input[type='checkbox']:checked + .contact-checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.contact-privacy-checkbox input[type='checkbox']:checked + .contact-checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.contact-privacy-text {
    flex: 1;
}

.contact-privacy-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.contact-privacy-link:hover {
    text-decoration: underline;
}

/* Кнопка отправки */
.contact-submit-btn {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #4c51bf 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
}

.contact-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.contact-submit-btn:active {
    transform: translateY(0);
}

/* Мобильная версия */
@media (max-width: 768px) {
    .contact-modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
        max-height: calc(100vh - 40px);
        border-radius: 20px;
    }

    .contact-modal-header {
        padding: 20px 20px 12px;
    }

    .contact-modal-header h3 {
        font-size: 18px;
    }

    .contact-modal-body {
        padding: 20px;
        max-height: calc(100vh - 120px);
    }

    .contact-form-group {
        margin-bottom: 16px;
    }

    .contact-form-group input,
    .contact-form-group select,
    .contact-form-group textarea {
        padding: 12px 14px;
        border-radius: 14px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }

    .contact-submit-btn {
        padding: 14px 18px;
        border-radius: 14px;
        font-size: 15px;
    }
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--secondary-color);
}

.notification.error {
    background: #ef4444;
}

/* Информация о странице */
.blog-info {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    display: inline-block;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none;
}

/* Стили чекбокса согласия */
.privacy-consent {
    margin-bottom: 20px !important;
}

.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: var(--background-color);
}

.privacy-checkbox:hover {
    color: var(--surface-color);
}

.privacy-checkbox input[type='checkbox'] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background-color: var(--background-color);
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
    display: inline-table;
    margin-right: 5px;
}

.privacy-checkbox input[type='checkbox']:checked + .checkmark {
    background-color: var(--background-color);
}

.privacy-checkbox input[type='checkbox']:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--primary-dark);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.privacy-link {
    color: var(--background-color);
    text-decoration: underline;
}

.privacy-link:hover {
    color: var(--surface-color);
    text-decoration: none;
}

/* Стили для каруселей */
.carousel-container {
    position: relative;
    overflow: hidden;
    margin-top: 3rem;
}

.carousel-wrapper {
    overflow: hidden;
    border-radius: 1rem;
    padding-bottom: 20px;
}

.cases-carousel,
.reviews-carousel {
    display: flex;
    transition: transform 0.4s ease;
}

.cases-carousel .case-card,
.reviews-carousel .review-card {
    flex: 0 0 350px;
    max-width: 350px;
    margin-right: 2rem;
}

.cases-carousel .case-card:last-child,
.reviews-carousel .review-card:last-child {
    margin-right: 0;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.carousel-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.carousel-btn:hover {
    background: var(--primary-color);
    opacity: 0.8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.carousel-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.5;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-bottom: 5px;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.carousel-indicator:hover {
    background: var(--primary-color);
    opacity: 0.7;
}

/* Стили для автоматических аватарок */
.author-avatar {
    position: relative;
    display: inline-block;

    display: flex;
    justify-content: center;
    align-items: center;
}

.author-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.3s ease;
    background-color: var(--surface-color);
}

.author-avatar img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

/* Анимация загрузки аватарки */
.author-avatar.loading img {
    opacity: 0.7;
    animation: avatarPulse 1.5s infinite;
}

@keyframes avatarPulse {
    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

/* Fallback стили для сгенерированных аватарок */
.author-avatar .generated-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 24px;
    color: white;
    border: 3px solid var(--surface-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.author-avatar .generated-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.cta-content .cta-buttons .btn-outline {
    border-color: white;
    color: white;
}

.cta-content .fa {
    color: white;
}

/* Адаптивные размеры аватарок */
@media (max-width: 768px) {
    .author-avatar img,
    .author-avatar .generated-avatar {
        width: 50px;
        height: 50px;
        border-width: 2px;
    }

    .author-avatar .generated-avatar {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .author-avatar img,
    .author-avatar .generated-avatar {
        width: 45px;
        height: 45px;
    }

    .author-avatar .generated-avatar {
        font-size: 18px;
    }
}
