/* Custom styles for Speech Card Theme */

/* Общие стили */
td{
    border-width: 1px;
    padding: 5px;
}
table{
    margin: 20px 0;
}
body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f8f9fa;
}
html{
	margin:0 !important;
}
/* Скрытие админ-бара для обычных пользователей */
body:not(.wp-admin) #wpadminbar {
    display: none !important;
}

/* Убираем отступ сверху для обычных пользователей */
body:not(.wp-admin) {
    margin-top: 0 !important;
}
.block-view-bar{
	background: #ffffff;
    padding: 20px;
    border: 1px solid #e3e3ee;
    border-radius: 6px;
}
.block-footer{
	/* Футер автоматически прижимается вниз благодаря grid */
}
.p-white{
    color: #ffffff;
}
.block-text-start b{
    font-size: 19px;
}
.block-text-start p{
    font-size: 14px;
    line-height: 22px;
    font-weight: 500;
}
.block-background{
	background-image:url('../../images/bg2.jpg');
	background-repeat: no-repeat;
    background-size: cover;
	min-height: 100vh;
	display: grid;
	grid-template-rows: auto 1fr auto;
}
.block-text-start-item p{
    margin: 0;
}
.block-text-start-item{
    margin-bottom: 20px;
}
.block-text-start-item-yellow{
    background: linear-gradient(to bottom, #f7c28a, #f69827);
    padding: 20px;
    border-radius: 10px;
}
.block-text-start-item-white{
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
}
.block-text-start-cards {
    align-items: stretch;
}
.block-text-start-cards > [class*="col-"] {
    display: flex;
}
.block-text-start-cards .block-text-start-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    margin-bottom: 0;
}
.block-text-start-cards .block-text-start-item p {
    font-size: 14px;
    line-height: 1.45;
    font-weight: 500;
}
.block-content{
	/*margin: 60px 0;
    padding: 40px 20px;*/
    background: #ffffff;
    border-radius: 20px;
}
.navbar-brand {
    font-weight: bold;
    color: #0d6efd !important;
}
.btn-primary{
    background: linear-gradient(0deg,rgba(246, 152, 39, 1) 0%, rgba(247, 194, 138, 1) 25%, rgba(246, 152, 39, 1) 100%);
    border: 1px solid #dd8924;
    font-weight: 500;
    border-radius: 40px;
}
.btn:hover{
    border: 1px solid #c26b02;
}
.navbar{
    padding: 30px 0;
}
/* Карточки */
.card {
    background: #bcbec0;
    border: none;
    border-radius: 40px !important;
    padding: 20px 10px;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
.form-control{
    height: 50px;
    border-radius: 50px !important;
}
.card-body a{
    color: #fff;
}
.card-header {
    border: none;
        background-color: #bcbec0;
        padding: 20px 0;
        color: #fff;
        text-align: left;
}
.card-header h3{
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    text-align: left;
    padding: 0 20px;
}

/* Контентные карточки (личный кабинет, приветствие, разделы формы — не формы входа/регистрации) */
.content-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
}
.content-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}
.content-card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: #212529;
}
.content-card-header h3,
.content-card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}
.content-card-body {
    padding: 1.25rem;
}
.content-card-body a:not(.btn) {
    color: #0d6efd;
}
.content-card.bg-light {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

/* Формы */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}
lead-start{
	font-size: 18px;
	font-weight: 500;
	line-height: 1.5;
	color: #000000;
}
.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.field-container {
    margin-bottom: 1rem;
}

.field-container.is-invalid .form-control,
.field-container.is-invalid .form-select {
    border-color: #dc3545;
}

.field-container.is-invalid .form-control:focus,
.field-container.is-invalid .form-select:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Условные поля */
.field-container[style*="display: none"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.field-container:not([style*="display: none"]) {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Навигация по шагам */
.step-indicator {
    font-weight: bold;
    color: #0d6efd;
}

.btn-next,
.btn-prev {
    min-width: 120px;
}

.save-card-btn {
    min-width: 200px;
}

.speech-form-sidebar {
    position: sticky;
    top: 1rem;
}

.speech-sidebar-link {
    border: 0;
    border-bottom: 1px solid #eef0f2;
    text-align: left;
}

.speech-sidebar-link .speech-section-status {
    font-size: 0.65rem;
}

/* Документный вид карты (просмотр / печать) */
.speech-card-document.speech-card-document {
    overflow: visible;
}

.speech-doc-page {
    font-family: "Times New Roman", Times, serif;
    font-size: 12pt;
    line-height: 1.5;
    color: #111;
    text-align: justify;
    max-width: 210mm;
    margin-left: auto;
    margin-right: auto;
}

.speech-doc-title {
    font-size: 18pt;
    font-weight: bold;
    text-align: center;
    margin: 0 0 0.85em 0;
    color: #000;
}

.speech-doc-meta {
    margin-bottom: 1.1em;
}

.speech-doc-meta-row {
    margin: 0.3em 0;
    font-size: 12pt;
    text-align: justify;
}

.speech-doc-meta-k {
    font-weight: bold;
}

.speech-doc-body {
    margin-top: 0.35em;
}

.speech-doc-section {
    font-size: 15.5pt;
    font-weight: bold;
    margin: 1.35em 0 0.5em 0;
    padding-bottom: 0.15em;
    text-align: left;
    color: #000;
    border-bottom: none;
    line-height: 1.3;
}

.speech-doc-section-body {
    margin-bottom: 0.6em;
    padding-top: 0.15em;
}

.speech-doc-subtitle {
    margin: 0.55em 0 0.3em 0;
    font-size: 12pt;
    text-align: left;
}

.speech-doc-field {
    margin: 0 0 0.55em 0;
    font-size: 12pt;
    text-align: justify;
}

.speech-doc-label {
    font-weight: bold;
}

.speech-doc-empty {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    margin-top: 1rem;
}

/* Прогресс бар */
.progress {
    height: 8px;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* Таблицы */
.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

.table th {
    border-top: none;
    font-weight: 600;
    background-color: #f8f9fa;
}

/* Статусы */
.badge {
    font-size: 0.75em;
}

/* Сообщения */
.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Автосохранение */
.autosave-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 250px;
}

.unsaved-changes-warning {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    min-width: 300px;
}

/* Валидация */
.validation-errors {
    margin-bottom: 1rem;
}

.validation-errors .alert {
    margin-bottom: 0;
}

/* Телефонные поля */
.phone-field .phones-container {
    margin-top: 0.5rem;
}

.phone-item {
    margin-bottom: 0.5rem;
}

.add-phone {
    margin-top: 0.5rem;
}

/* Кнопки действий */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
        border-radius: 0.375rem !important;
    }
    
    .autosave-indicator,
    .unsaved-changes-warning {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        transform: none;
        margin-bottom: 1rem;
    }
}

/* Печать */
@media print {
    .btn,
    .navbar,
    .autosave-indicator,
    .unsaved-changes-warning,
    .validation-messages,
    .d-flex.justify-content-between {
        display: none !important;
    }
    
    body {
        font-size: 12px;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .card {
        border: 1px solid #000 !important;
        margin-bottom: 20px;
        page-break-inside: avoid;
        display: block !important;
    }
    
    .card-header {
        border: none;
        background-color: #bcbec0;
    }
    
    .card-body {
        padding: 15px;
        display: block !important;
    }
    
    .content-card {
        border: 1px solid #000 !important;
        margin-bottom: 20px;
        page-break-inside: avoid;
        display: block !important;
    }
    
    .content-card-header {
        border: none;
        background-color: #f8f9fa;
    }
    
    .content-card-body {
        padding: 15px;
        display: block !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000;
        page-break-after: avoid;
    }
    
    .row {
        margin-bottom: 5px;
    }
    
    .badge {
        border: 1px solid #000;
        background: #fff;
        color: #000;
        padding: 2px 6px;
    }
    
    .text-muted {
        color: #000 !important;
    }
    
    @page {
        margin: 2cm;
        size: A4;
    }
}

/* Анимации */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.slide-down {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

/* Загрузка */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Дополнительные утилиты */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.user-select-none {
    user-select: none;
}
