/* Clean up site.css to avoid conflicts with modern-theme.css */
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    margin: 0;
    padding: 0;
}

/* Page titles should follow modern-theme.css */
h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.content {
    padding-top: 0; /* Remove top gap */
}

/* Keep essential validation styles */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success);
}
.invalid {
    outline: 1px solid var(--danger);
}
.validation-message {
    color: var(--danger);
}

/* Bottom Nav Safe Area - handled in modern-theme.css */

/* === Handbook (Справочник) === */
.handbook {
    max-width: 100%;
    margin: 0;
}

.handbook-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 0.25rem 0 0.75rem 0;
    background: var(--bg-body, #f6f7fb);
}

.handbook-surface {
    background: var(--bg-surface, #ffffff);
    border-radius: var(--radius-lg, 16px);
    padding: 2rem 2.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    margin-bottom: 2rem;
}

@media (max-width: 640.98px) {
    .handbook-surface {
        padding: 1.25rem 1.25rem;
        border-radius: 14px;
    }
}

.handbook-toc-btn {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #000000 !important;
    background: transparent !important;
    border: none !important;
    padding-left: 0;
    text-decoration: none !important;
}

.handbook-toc-btn:hover {
    text-decoration: none !important;
    background: transparent !important;
    opacity: 0.8;
}

.handbook-surface .page-title {
    margin-bottom: 1.5rem;
    color: #000000;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 0.75rem;
}

.handbook-surface h2 {
    color: #2d3748;
    border-left: 4px solid var(--primary, #5a67d8);
    padding-left: 1rem;
    margin-top: 2.5rem !important;
    margin-bottom: 1.25rem !important;
}

.handbook-surface h3 {
    color: #4a5568;
    margin-top: 1.5rem !important;
}

@media (max-width: 640.98px) {
    .handbook-surface .table thead {
        display: none;
    }

    .handbook-surface .table tr {
        display: block;
        border-bottom: 1px solid #e9ecef;
        padding: 0.5rem 0;
    }

    .handbook-surface .table td {
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        border: none;
        padding: 0.35rem 0;
    }

    .handbook-surface .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6c757d;
    }
}

/* === ЕДИНЫЙ СТИЛЬ ДЛЯ КНОПКИ "НАЗАД" (без серой заливки, граница только при наведении) === */
.btn-outline-secondary.cp-back-btn {
    background-color: transparent !important;
    color: #6c757d !important;
    border-color: transparent !important;
}

.btn-outline-secondary.cp-back-btn:hover {
    background-color: transparent !important;
    color: #6c757d !important;
    border-color: #6c757d !important;
}

.btn-outline-secondary.cp-back-btn:focus,
.btn-outline-secondary.cp-back-btn:focus-visible {
    background-color: transparent !important;
    color: #6c757d !important;
    border-color: #6c757d !important;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.15) !important;
}

.btn-outline-secondary.cp-back-btn:active,
.btn-outline-secondary.cp-back-btn.active {
    background-color: transparent !important;
    color: #6c757d !important;
    border-color: #6c757d !important;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.15) !important;
}

/* Blazor Error UI - скрыт по умолчанию, показывается только при ошибках */
#blazor-error-ui {
    display: none;
    background: #d32f2f;
    color: white;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 100000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    line-height: 1;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
    margin-left: 0.5rem;
}
