* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brand-50: #f0f9ff;
    --brand-100: #e0f2fe;
    --brand-500: #0ea5e9;
    --brand-600: #0284c7;
    --brand-700: #0369a1;
    --brand-800: #075985;
    --brand-900: #0c4a6e;
    --slate-900: #0f172a;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --white: #ffffff;
    --accent-500: #f59e0b;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--slate-50);
    color: var(--slate-900);
    line-height: 1.5;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    flex: 1;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.content-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ===== Заголовок ===== */
.registry-header {
    margin-bottom: 0.5rem;
}

.registry-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    max-width: 100%;
    white-space: normal;
}

@media (min-width: 768px) {
    .registry-title {
        font-size: 2.5rem;
    }
}

.registry-subtitle {
    color: var(--slate-600);
    font-size: 1rem;
    max-width: 100%;
}

/* ===== Карточка фильтров ===== */
.controls-card {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--slate-200);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background-color: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    background-color: var(--white);
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px var(--brand-100);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--slate-400);
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--slate-500);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    display: block;
}

.filter-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chip {
    padding: 0.5rem 1rem;
    background-color: var(--slate-100);
    border: 1px solid var(--slate-200);
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--slate-600);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.chip:hover {
    background-color: var(--slate-200);
}

.chip.active {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
    color: var(--white);
}

/* ===== Таблица ===== */
.table-card {
    background: var(--white);
    border-radius: 1rem;
    border: 1px solid var(--slate-200);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    overflow-x: auto;
}

.registry-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 500px;
}

.registry-table th {
    background-color: var(--brand-900);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
}

.registry-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-600);
    font-size: 0.9rem;
}

.registry-table tr:hover {
    background-color: var(--brand-50);
}

.address-text {
    color: var(--slate-900);
    font-weight: 600;
}

.district-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--brand-700);
    background: var(--brand-100);
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    text-transform: uppercase;
    display: inline-block;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--brand-600);
    color: var(--white);
    padding: 0.4rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-download:hover {
    background-color: var(--brand-700);
    transform: translateY(-1px);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--slate-400);
    font-size: 1rem;
}

.empty-state span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* ===== Футер ===== */
.footer {
    background-color: var(--slate-900);
    color: var(--slate-400);
    padding: 2rem 1.5rem;
    border-top: 4px solid var(--brand-600);
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-text {
    margin-bottom: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Адаптивное сжатие текста в футере */
@media (max-width: 768px) {
    .footer-text {
        max-width: 60%;
        margin: 0 auto;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .footer-text {
        max-width: 70%;
        margin: 0 auto;
    }
}

.footer-link {
    color: var(--slate-300);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
    font-weight: 500;
}

.footer-link:hover {
    color: var(--accent-500);
    text-decoration: underline;
}

.footer-copyright-symbol {
    font-size: 0.85rem;
    color: var(--slate-400);
    margin-right: 0.25rem;
}

/* ===== Кнопка "Наверх" ===== */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background-color: var(--brand-600);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top:hover {
    background-color: var(--brand-800);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.scroll-to-top:active {
    transform: translateY(0) scale(0.98);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 640px) {
    .main-content {
        padding: 1.5rem;
    }
    
    .registry-title {
        font-size: 1.5rem;
    }
    
    .chip {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .footer {
        padding: 1.5rem;
    }
    
    .footer-link {
        font-size: 0.75rem;
    }

    .footer-copyright-symbol {
        font-size: 0.75rem;
    }

    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
}

/* ===== Модальное окно для капчи ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: 2rem;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalFadeIn 0.3s ease;
    position: relative;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--slate-400);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--slate-900);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 0.5rem;
}

.modal-text {
    color: var(--slate-600);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

#turnstile-container {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

/* Адаптация для мобильных */
@media (max-width: 640px) {
    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
}