/* === Нотариусы России — компонентные стили (в дополнение к Tailwind) === */

:root {
    --brand: #1e3a8a;
    --brand-dark: #16255f;
    --brand-light: #2f56b8;
    --accent: #c9a227;
    --bg: #f4f6fb;
    --card-border: #e3e8f0;
    --ink: #1f2937;
}

/* Базовый текст: +0.1rem к дефолту (вся шкала шрифтов увеличена пропорционально) */
body { font-size: 1.1rem; }

/* ===== Навигация ===== */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.7rem;
    border-radius: 0.55rem;
    color: #3b4658;
    transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover { color: var(--brand); background: rgba(47, 86, 184, 0.08); }
.nav-link i { color: var(--brand-light); }

.footer-link { color: #b9c3d9; }
.footer-link:hover { color: #fff; }
.footer-link i { color: rgba(201, 162, 39, 0.85); }

/* ===== Выпадающие меню навигации ===== */
.nav-dropdown {
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14);
    padding: 0.4rem;
}
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.7rem;
    border-radius: 0.55rem;
    color: #3b4658;
    font-size: 0.975rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown-item:hover { background: rgba(47, 86, 184, 0.08); color: var(--brand); }
.nav-dropdown-item i { color: var(--brand-light); }
/* Плавное появление выпадающего меню (состояние is-open ставит JS) */
.nav-dd-panel {
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    pointer-events: none;
}
.nav-dd.is-open .nav-dd-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.nav-dd.is-open .nav-dd-toggle { color: var(--brand); background: rgba(47, 86, 184, 0.08); }
/* Позиционирующий контейнер меню не должен ловить курсор, пока меню закрыто,
   иначе закрытое меню перекрывает открытое соседнее */
.nav-dd-menu { pointer-events: none; }
.nav-dd.is-open .nav-dd-menu { pointer-events: auto; }

/* ===== Кнопки ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 0.6rem;
    font-weight: 600;
    font-size: 1.025rem;
    line-height: 1.25;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.925rem; border-radius: 0.5rem; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1.15rem; border-radius: 0.7rem; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-light); }

.btn-success { background: #15803d; color: #fff; }
.btn-success:hover { background: #166534; }

.btn-outline { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn-outline:hover { background: var(--brand); color: #fff; }

.btn-outline-light { border-color: rgba(255, 255, 255, 0.6); color: #fff; background: transparent; }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.15); border-color: #fff; }

.btn-ghost { border-color: var(--card-border); color: #3b4658; background: #fff; }
.btn-ghost:hover { border-color: var(--brand-light); color: var(--brand); }

/* ===== Формы ===== */
.input, .select {
    display: block;
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--card-border);
    border-radius: 0.6rem;
    background: #fff;
    font-size: 1.025rem;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus {
    outline: none;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px rgba(47, 86, 184, 0.15);
}
.label { display: block; font-size: 0.9rem; font-weight: 600; color: #6b7280; margin-bottom: 0.35rem; }

/* ===== Бейджи ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

/* ===== Алерты ===== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    border-radius: 0.7rem;
    border: 1px solid;
    font-size: 1rem;
}
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-secondary { background: #f8fafc; border-color: var(--card-border); color: #475569; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert a { text-decoration: underline; font-weight: 600; }

/* ===== Хлебные крошки ===== */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-size: 0.95rem; }
.crumbs a { color: #6b7280; }
.crumbs a:hover { color: var(--brand); }
.crumbs .crumb-sep { color: #c3cbdb; }
.crumbs .crumb-active { color: var(--brand-dark); font-weight: 600; }

/* ===== Hero-секция ===== */
.hero-section {
    position: relative;
    border-radius: 1.25rem;
    padding: 3.5rem 2rem;
    margin-bottom: 2.5rem;
    color: #fff;
    background:
        radial-gradient(900px 320px at 88% -20%, rgba(201, 162, 39, 0.28), transparent 60%),
        linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 55%, var(--brand-light) 100%);
    box-shadow: 0 14px 34px rgba(30, 58, 138, 0.25);
}
.hero-section::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit; /* точечный узор повторяет скругления — не режет dropdown */
    background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}
.hero-section > * { position: relative; z-index: 1; }

/* ===== Заголовки секций ===== */
.section-title {
    position: relative;
    padding-bottom: 0.55rem;
    color: var(--brand-dark);
    font-weight: 800;
}
.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), rgba(201, 162, 39, 0));
}
.section-title i { color: var(--brand-light); }

/* ===== Карточки ===== */
.app-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 0.9rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.10);
    border-color: #cfd8ea;
}

/* Аватар-инициалы нотариуса */
.notary-initials {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.18);
}

/* Профиль нотариуса */
.profile-header {
    border-radius: 1.1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    color: #fff;
    background:
        radial-gradient(600px 200px at 90% -30%, rgba(201, 162, 39, 0.30), transparent 60%),
        linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    box-shadow: 0 10px 26px rgba(30, 58, 138, 0.22);
}
.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2.1rem;
    border: 3px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* Иконка услуги */
.service-icon {
    width: 52px;
    height: 52px;
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--brand);
    background: linear-gradient(135deg, #eef3ff, #e2eaff);
    border: 1px solid #d8e2f7;
}

/* Статистика */
.stat-number {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--brand);
}

/* ===== Цена (акцентное отображение) ===== */
.price-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 800;
    color: var(--brand);
}

/* ===== Карты ===== */
#yandex-map,
#yandex-map-small,
#district-map,
#service-map,
#metro-map {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid var(--card-border);
    overflow: hidden;
}
#yandex-map, #district-map, #service-map, #metro-map { height: 450px; }
#yandex-map-small { height: 300px; border-radius: 0; border: 0; }

/* ===== Tooltip (значок «?» с полным текстом тарифа) ===== */
.tt {
    position: relative;
    display: inline-flex;
    cursor: help;
    color: var(--brand-light);
    outline: none;
}
.tt::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    max-width: 78vw;
    background: #1f2937;
    color: #f9fafb;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease;
    pointer-events: none;
    z-index: 70;
}
.tt:hover::after,
.tt:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

/* ===== Автоподсказки ===== */
.suggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 4px;
    border-radius: 0.6rem;
    border: 1px solid var(--card-border);
    background: #fff;
    box-shadow: 0 10px 26px rgba(16, 24, 40, 0.12);
}
.suggest-dropdown a {
    display: block;
    padding: 0.5rem 0.85rem;
    font-size: 0.975rem;
    color: var(--ink);
    border-bottom: 1px solid #f1f4f9;
}
.suggest-dropdown a:hover { background: #f4f6fb; }

/* ===== Избранное ===== */
.btn-favorite {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 2;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #9aa7bd;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.btn-favorite:hover { color: var(--accent); background: rgba(201, 162, 39, 0.12); }
.btn-favorite.favorite-active { color: var(--accent); }

/* ===== FAQ (details/summary) ===== */
.faq-item { border: 1px solid var(--card-border); border-radius: 0.7rem; background: #fff; overflow: hidden; }
.faq-item + .faq-item { margin-top: 0.5rem; }
.faq-item summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    color: var(--brand-dark);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "\F282"; /* bi-chevron-down */
    font-family: "bootstrap-icons";
    margin-left: auto;
    color: var(--brand-light);
    transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item .faq-body { padding: 0 1.1rem 1rem; color: #4b5563; font-size: 1.025rem; }

/* ===== Модальное окно ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(16, 24, 40, 0.55);
    padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 1rem;
    max-width: 24rem;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* ===== Таблицы ===== */
.tbl { width: 100%; border-collapse: collapse; font-size: 1rem; }
.tbl td, .tbl th { padding: 0.5rem 0.75rem; border-bottom: 1px solid #eef1f6; }
.tbl tr:last-child td { border-bottom: 0; }

/* ===== Спиннер ===== */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(30, 58, 138, 0.2);
    border-radius: 50%;
    border-top-color: var(--brand);
    animation: spin 0.8s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Адаптивность ===== */
@media (max-width: 768px) {
    .hero-section { padding: 2rem 1rem; }
    #yandex-map, #district-map, #service-map { height: 300px; }
    .profile-header { text-align: center; }
}

/* ===== Рейтинг: звёзды + число + кол-во отзывов ===== */
.rating-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9125rem;
    line-height: 1;
}
.stars {
    position: relative;
    display: inline-block;
    font-size: 1.0375rem;
    line-height: 1;
    letter-spacing: 1px;
}
.stars-bg { color: #d6dbe6; }
.stars-fill {
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    white-space: nowrap;
    color: #f59e0b;
}
.rating-num { color: #1f2937; font-weight: 700; }
.rating-cnt { color: #6b7280; font-size: 0.85rem; }

/* Вариант в шапке карточки (на тёмном фоне) */
.rating-line.rating-on-dark .rating-num { color: #fff; }
.rating-line.rating-on-dark .rating-cnt { color: rgba(255, 255, 255, .8); }
.rating-line.rating-on-dark .stars-bg { color: rgba(255, 255, 255, .35); }

/* ===== Горшочек мёда (скрытое поле-ловушка от ботов) ===== */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

/* ===== Форма отзыва: выбор оценки звёздами ===== */
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label {
    cursor: pointer;
    font-size: 1.85rem;
    line-height: 1;
    color: #d6dbe6;
    transition: color .12s ease;
}
.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label { color: #f59e0b; }
.star-input input:focus-visible ~ label:first-of-type { outline: none; }
