/* ===========================================================================
   iktozvonil.ru — стили.
   Один файл без сборщика: проект отдаёт HTML с сервера, и лишний build-шаг
   здесь только усложнил бы деплой. Порядок: токены → база → компоненты.
   =========================================================================== */

:root {
    color-scheme: light dark;

    --bg:            #f6f7f9;
    --surface:       #ffffff;
    --surface-muted: #f0f2f5;
    --border:        #dfe3e8;
    --text:          #16181d;
    --text-muted:    #61666e;

    --accent:        #1f6feb;
    --accent-dark:   #1558c0;
    --danger:        #d92d20;
    --danger-bg:     #fff4f3;
    --success:       #12805c;

    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 1px 2px rgb(16 24 40 / 6%), 0 4px 12px rgb(16 24 40 / 4%);

    --step:          8px;
    --container:     1120px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:            #0f1115;
        --surface:       #171a21;
        --surface-muted: #1e222b;
        --border:        #2a2f3a;
        --text:          #e8eaed;
        --text-muted:    #9aa1ad;
        --accent:        #5b9dff;
        --accent-dark:   #7bb0ff;
        --danger:        #ff6b5e;
        --danger-bg:     #2a1614;
        --shadow:        0 1px 2px rgb(0 0 0 / 40%);
    }
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 16px;
}
.container--narrow { max-width: 760px; }

.skip-link {
    position: absolute;
    left: -9999px;
}
.skip-link:focus {
    left: 16px; top: 16px;
    z-index: 100;
    padding: 8px 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
}

/* --- Шапка --------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top, 0);
}
.site-header__inner {
    display: flex;
    align-items: center;
    gap: calc(var(--step) * 2);
    min-height: 64px;
    flex-wrap: wrap;
    padding-block: 10px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 18px; }
.logo:hover { text-decoration: none; }
.logo__mark { font-size: 22px; color: var(--accent); }

.site-nav { display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { color: var(--text-muted); font-size: 15px; }
.site-nav a:hover { color: var(--accent); }

/* --- Поиск --------------------------------------------------------------- */
.search { display: flex; gap: 8px; flex: 1 1 260px; min-width: 0; }
.search input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 14px;
    font-size: 16px;
    color: var(--text);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search button {
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
}
.search button:hover { background: var(--accent-dark); }
.search--hero { max-width: 560px; margin-inline: auto; margin-top: 24px; }
.search--inline { margin-block: 24px; }

/* --- Главная ------------------------------------------------------------- */
.hero { padding-block: clamp(32px, 7vw, 72px); text-align: center; }
.hero__title { margin: 0; font-size: clamp(26px, 5vw, 40px); line-height: 1.2; }
.hero__lead { margin: 12px auto 0; max-width: 620px; color: var(--text-muted); }
.hero__hints { margin-top: 16px; font-size: 14px; color: var(--text-muted); }

.section { padding-block: clamp(24px, 5vw, 48px); }
.section--muted { background: var(--surface-muted); }
.section--danger .section__title { color: var(--danger); }
.section__title { margin: 0 0 8px; font-size: clamp(20px, 3vw, 26px); }
.section__lead { margin: 0 0 20px; color: var(--text-muted); }

.section-block { margin-block: clamp(24px, 5vw, 40px); }
.section-block__title { font-size: clamp(18px, 3vw, 23px); margin: 0 0 16px; }

/* --- Сетки --------------------------------------------------------------- */
.grid { display: grid; gap: 12px; margin-top: 16px; }
.grid--cards    { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid--tags     { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid--services { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--codes    { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.grid--links    { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

/* --- Карточки ------------------------------------------------------------ */
.number-card, .tag-card, .service-card, .code-card, .link-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    box-shadow: var(--shadow);
    transition: border-color .15s, transform .15s;
}
.number-card:hover, .tag-card:hover, .service-card:hover, .code-card:hover, .link-card:hover {
    border-color: var(--accent);
    text-decoration: none;
    transform: translateY(-1px);
}
.number-card--danger { border-left: 3px solid var(--danger); }
.number-card__phone { font-size: 18px; font-weight: 600; }
.number-card__meta, .tag-card__count, .code-card__count, .link-card__count { font-size: 13px; color: var(--text-muted); }
.tag-card__name, .service-card__title { font-weight: 600; }
.tag-card__text, .service-card__text { font-size: 14px; color: var(--text-muted); }
.code-card { align-items: center; text-align: center; }
.code-card__code { font-size: 20px; font-weight: 700; }
.link-card { flex-direction: row; justify-content: space-between; align-items: center; }

/* --- Метки --------------------------------------------------------------- */
.tag {
    display: inline-block;
    padding: 2px 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    white-space: nowrap;
}
.tag--red, .tag--orange { background: #fde7e5; color: #a01b12; }
.tag--amber, .tag--yellow { background: #fef3d6; color: #8a5a00; }
.tag--green, .tag--emerald { background: #d9f5e6; color: #0b6b4c; }
.tag--blue, .tag--cyan { background: #dceafd; color: #14508f; }
.tag--violet { background: #ece3fd; color: #5b32b8; }
.tag--slate, .tag--gray, .tag--zinc, .tag--stone { background: var(--surface-muted); color: var(--text-muted); }

@media (prefers-color-scheme: dark) {
    .tag--red, .tag--orange { background: #3a1a17; color: #ff9c92; }
    .tag--amber, .tag--yellow { background: #3a2c10; color: #f5c96b; }
    .tag--green, .tag--emerald { background: #12301f; color: #6fd8a6; }
    .tag--blue, .tag--cyan { background: #14263f; color: #86bbff; }
    .tag--violet { background: #241a3d; color: #b79bff; }
}

.tag-votes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tag-votes li { display: flex; align-items: center; gap: 6px; }
.tag-votes__count { font-size: 13px; color: var(--text-muted); }

/* --- Страница номера ----------------------------------------------------- */
.number-page { padding-block: 24px 48px; }

.number-head {
    display: grid;
    gap: 20px;
    padding: clamp(18px, 4vw, 28px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
@media (min-width: 720px) {
    .number-head { grid-template-columns: 1.2fr 1fr; }
}
.number-head--danger { border-left: 4px solid var(--danger); }
.number-head__phone { margin: 0; font-size: clamp(26px, 5vw, 36px); letter-spacing: .5px; }
.number-head__aka { margin: 4px 0 0; font-size: 14px; color: var(--text-muted); }
.number-head__verdict { margin: 16px 0 0; font-size: 16px; }
.number-head__verdict--empty { color: var(--text-muted); }

.number-head__facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0; }
.number-head__facts dt { font-size: 13px; color: var(--text-muted); }
.number-head__facts dd { margin: 2px 0 0; font-weight: 600; }

/* --- Блок «Проверить в базе» --------------------------------------------- */
.enrich {
    margin-top: 20px;
    padding: clamp(18px, 4vw, 26px);
    background: var(--surface-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
}
.enrich__title { margin: 0 0 8px; font-size: 19px; }
.enrich__text { margin: 0 auto 18px; max-width: 520px; color: var(--text-muted); font-size: 15px; }
.enrich__status { margin: 14px 0 0; min-height: 1.6em; font-size: 15px; }
.enrich__status--error { color: var(--danger); }
.enrich__status--ok { color: var(--success); }

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* --- Отзывы -------------------------------------------------------------- */
.reviews { display: grid; gap: 12px; }
.review {
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius);
}
.review--negative { border-left-color: var(--danger); }
.review--positive { border-left-color: var(--success); }
.review__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.review__author { font-weight: 600; }
.review__date { font-size: 13px; color: var(--text-muted); margin-left: auto; }
.review__body { margin: 0; overflow-wrap: anywhere; }
.review__source { margin: 10px 0 0; font-size: 13px; color: var(--text-muted); }
.review__foot { display: flex; gap: 16px; margin-top: 12px; }
.reviews__empty, .empty { color: var(--text-muted); }

.link-button {
    padding: 0;
    font-size: 13px;
    color: var(--text-muted);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
}
.link-button:hover { color: var(--accent); }

/* --- Форма отзыва -------------------------------------------------------- */
.review-form {
    padding: clamp(18px, 4vw, 26px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.review-form__row { margin-bottom: 18px; border: 0; padding: 0; }
.review-form__row legend, .review-form__row > label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 15px; }
.review-form__row--inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 0; }
.review-form__row--inline label { flex-basis: 100%; }
.review-form__row--inline input { flex: 1 1 200px; }
.review-form__hint { margin: 8px 0 0; font-size: 13px; color: var(--text-muted); }

.review-form textarea, .review-form input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    font: inherit;
    color: var(--text);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    resize: vertical;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
    display: inline-block;
    padding: 7px 14px;
    font-size: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Honeypot: видимым быть не должен, но и display:none некоторые боты понимают. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Прочее -------------------------------------------------------------- */
.breadcrumbs { padding-block: 12px; font-size: 13px; color: var(--text-muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 8px; color: var(--border); }

.page-title { margin: 16px 0 8px; font-size: clamp(24px, 4vw, 32px); }
.page-lead { margin: 0 0 8px; color: var(--text-muted); }
.page-count { font-size: 14px; color: var(--text-muted); }

.feed { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.feed__item { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.feed__phone { font-weight: 600; }
.feed__text { margin: 8px 0; font-size: 14px; }
.feed__date { font-size: 13px; color: var(--text-muted); }

.faq__item { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.faq__question { font-weight: 600; cursor: pointer; }
.faq__answer { margin-top: 10px; color: var(--text-muted); }

.prose { line-height: 1.7; }
.prose h2 { margin-top: 32px; font-size: 22px; }
.prose ul, .prose ol { padding-left: 22px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-block: 32px; }
.pagination__status { font-size: 14px; color: var(--text-muted); }

.error-page { padding-block: 48px 72px; text-align: center; }

/* --- Подвал -------------------------------------------------------------- */
.site-footer {
    margin-top: 48px;
    padding-block: 32px calc(32px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 14px;
}
.site-footer__inner { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer__col { display: flex; flex-direction: column; gap: 8px; }
.site-footer__brand { margin: 0; font-weight: 700; }
.site-footer__note { margin: 0; color: var(--text-muted); }
.site-footer__col a { color: var(--text-muted); }
.site-footer__col a:hover { color: var(--accent); }

/* --- Таблица диапазонов нумерации ---------------------------------------- */
/* Таблица шире телефона, поэтому прокручивается сама, не ломая страницу. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.ranges {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.ranges th, .ranges td { padding: 9px 12px; text-align: left; white-space: nowrap; }
.ranges thead th { background: var(--surface-muted); font-size: 13px; color: var(--text-muted); }
.ranges tbody tr + tr td { border-top: 1px solid var(--border); }
.ranges td:nth-child(1), .ranges td:nth-child(2) { font-variant-numeric: tabular-nums; }

/* Сводка по коду: та же вёрстка, что и факты о номере, но отдельным блоком. */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0 0;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.stats-row dd { font-variant-numeric: tabular-nums; }

/* --- Текст о номере ------------------------------------------------------ */
/* Основной читаемый блок страницы: собран из фактов, поэтому оформлен
   как связный текст, а не как таблица характеристик. */
.summary {
    margin-top: 20px;
    padding: clamp(16px, 4vw, 24px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    line-height: 1.7;
}
.summary p { margin: 0 0 12px; }
.summary p:last-child { margin-bottom: 0; }

/* --- Облако слов --------------------------------------------------------- */
/* Размер слова кодирует частоту: пять ступеней, между ними заметная
   разница, иначе облако читается как обычный текст вразнобой. */
.wordcloud {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 6px 14px;
    padding: clamp(18px, 4vw, 28px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}
.wordcloud__word {
    line-height: 1.25;
    color: var(--text-muted);
    cursor: default;
    transition: color .15s;
}
.wordcloud__word:hover { color: var(--accent); }

.wordcloud__word--1 { font-size: 0.95rem; }
.wordcloud__word--2 { font-size: 1.2rem; }
.wordcloud__word--3 { font-size: 1.55rem; color: var(--text); }
.wordcloud__word--4 { font-size: 2rem;  font-weight: 600; color: var(--text); }
.wordcloud__word--5 { font-size: 2.6rem; font-weight: 700; color: var(--accent); }

/* Чередование оттенков делает облако живым, а не полосатым по размеру. */
.wordcloud__word:nth-child(3n) { color: var(--accent); opacity: .85; }
.wordcloud__word:nth-child(5n) { opacity: .7; }
.wordcloud__word--5:nth-child(n) { opacity: 1; }

/* --- Разбор оценок ------------------------------------------------------- */
.ratings {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.ratings__row {
    display: grid;
    grid-template-columns: 7.5rem 1fr 2.5rem;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.ratings__label { color: var(--text-muted); }
.ratings__bar {
    height: 10px;
    background: var(--surface-muted);
    border-radius: 999px;
    overflow: hidden;
}
.ratings__fill { display: block; height: 100%; border-radius: 999px; }
.ratings__fill--negative { background: var(--danger); }
.ratings__fill--neutral  { background: var(--text-muted); }
.ratings__fill--positive { background: var(--success); }
.ratings__count { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 420px) {
    .ratings__row { grid-template-columns: 6rem 1fr 2rem; font-size: 13px; }
}
