/* =========================================================
   ГРАНИТ — Дизайн в стиле Госуслуг
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&display=swap');

:root {
    --primary: #0d4cd3;
    --primary-dark: #0a3ba8;
    --primary-light: #e8efff;
    --primary-hover: #0b41b8;

    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f0f2f5;

    --danger: #dc2626;
    --danger-light: #fef2f2;
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #ea580c;
    --warning-light: #fff7ed;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ===== Сброс ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 88px; /* место под нижнюю навигацию */
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ===== Контейнер ===== */
.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
}

.container-wide { max-width: 1200px; }

/* ===== Шапка ===== */
.app-header {
    background: var(--primary);
    color: #fff;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.app-header__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.app-header__logo {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 1px;
    color: #fff;
    text-decoration: none;
}

.app-header__logo:hover { text-decoration: none; }

.app-header__sep {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
}

.app-header__cabinet {
    font-weight: 500;
    opacity: 0.95;
}

.app-header__spacer { flex: 1; }

.app-header__user {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: background 0.15s;
}
.app-header__user:hover { background: rgba(255, 255, 255, 0.22); }

.app-header__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
}
.app-header__avatar img { width: 100%; height: 100%; object-fit: cover; }

.app-header__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s;
}
.app-header__back:hover { background: rgba(255, 255, 255, 0.22); text-decoration: none; }

/* ===== Меню пользователя (dropdown) ===== */
.user-menu {
    position: absolute;
    top: 60px;
    right: 16px;
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 260px;
    padding: 8px;
    z-index: 200;
    display: none;
}
.user-menu.open { display: block; }

.user-menu__title {
    font-size: 12px;
    color: var(--text-light);
    padding: 8px 12px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.12s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.user-menu__item:hover { background: var(--border-light); text-decoration: none; }
.user-menu__item.is-active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.user-menu__item--danger { color: var(--danger); }

.user-menu__icon { font-size: 20px; width: 24px; text-align: center; }
.user-menu__check { margin-left: auto; color: var(--primary); }

.user-menu__sep {
    height: 1px;
    background: var(--border-light);
    margin: 6px 8px;
}

/* ===== Заголовки страниц ===== */
.page-title {
    font-size: 30px;
    font-weight: 700;
    margin: 20px 0 16px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px;
}

/* ===== Карточки ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.card--flat {
    box-shadow: none;
    border: 1px solid var(--border);
}

.card--link {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
    text-decoration: none;
    color: inherit;
}
.card--link:hover {
    box-shadow: var(--shadow-md);
    text-decoration: none;
    transform: translateY(-1px);
}
.card--link:active { transform: translateY(0); }

.card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: var(--primary-light);
    color: var(--primary);
    flex-shrink: 0;
}

.card__body { flex: 1; min-width: 0; }
.card__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.card__text {
    font-size: 14px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}
.card__arrow {
    color: var(--text-light);
    font-size: 20px;
    flex-shrink: 0;
}

/* ===== Карточки услуг (плитка, как на скрине) ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 600px) {
    .services-grid { grid-template-columns: repeat(3, 1fr); }
}

.service-tile {
    position: relative;
    border-radius: var(--radius);
    padding: 14px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow);
}
.service-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.service-tile--blue   { background: linear-gradient(135deg, #e0ecff 0%, #c8dcff 100%); }
.service-tile--green  { background: linear-gradient(135deg, #d9f5e7 0%, #b8ecd0 100%); }
.service-tile--purple { background: linear-gradient(135deg, #e8ddff 0%, #d4c0ff 100%); }
.service-tile--orange { background: linear-gradient(135deg, #ffe6d1 0%, #ffd0a8 100%); }
.service-tile--pink   { background: linear-gradient(135deg, #ffdde8 0%, #ffc0d4 100%); }
.service-tile--yellow { background: linear-gradient(135deg, #fff4cc 0%, #ffe9a3 100%); }

.service-tile__icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 8px;
}

.service-tile__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
}

/* ===== Кнопки ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    text-decoration: none;
    line-height: 1.2;
}

.btn:active { transform: scale(0.98); }
.btn:hover { text-decoration: none; }

.btn--primary {
    background: var(--primary);
    color: #fff;
}
.btn--primary:hover { background: var(--primary-hover); }

.btn--secondary {
    background: var(--primary-light);
    color: var(--primary);
}
.btn--secondary:hover { background: #d8e5ff; }

.btn--outline {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn--outline:hover { background: var(--border-light); }

.btn--danger {
    background: var(--danger);
    color: #fff;
}
.btn--danger:hover { background: #b91c1c; }

.btn--block { width: 100%; }
.btn--lg { padding: 16px 24px; font-size: 16px; }
.btn--sm { padding: 8px 14px; font-size: 14px; border-radius: 8px; }

.btn--ghost {
    background: transparent;
    color: var(--primary);
    padding: 8px 12px;
}
.btn--ghost:hover { background: var(--primary-light); }

/* ===== Формы ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-label--required::after {
    content: ' *';
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 16px;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236b7280' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form-hint {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

.form-error {
    font-size: 13px;
    color: var(--danger);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ===== Alert / Flash ===== */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.alert--success { background: var(--success-light); color: var(--success); }
.alert--error   { background: var(--danger-light);  color: var(--danger); }
.alert--warning { background: var(--warning-light); color: var(--warning); }
.alert--info    { background: var(--primary-light); color: var(--primary); }

/* ===== Красный баннер ограничений ===== */
.restriction-banner {
    display: block;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
    position: relative;
    overflow: hidden;
    animation: pulse 2.5s infinite;
}
.restriction-banner:hover { text-decoration: none; color: #fff; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3); }
    50%      { box-shadow: 0 4px 24px rgba(220, 38, 38, 0.55); }
}

.restriction-banner__title {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.restriction-banner__text {
    font-size: 14px;
    opacity: 0.95;
}

/* ===== Нижняя навигация (мобильная) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
}

.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px;
    color: var(--text-light);
    font-size: 11px;
    text-decoration: none;
    transition: color 0.15s;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}
.bottom-nav__item:hover { text-decoration: none; color: var(--primary); }
.bottom-nav__item.is-active { color: var(--primary); }

.bottom-nav__icon {
    font-size: 22px;
    line-height: 1;
    position: relative;
}

.bottom-nav__badge {
    position: absolute;
    top: -2px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.bottom-nav__center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.bottom-nav__center-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(13, 76, 211, 0.4);
    margin-top: -18px;
    text-decoration: none;
    transition: transform 0.15s;
}
.bottom-nav__center-logo:hover { transform: scale(1.05); text-decoration: none; color: #fff; }

/* ===== Таблицы ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 15px;
}

.table th {
    background: var(--border-light);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafbfc; }

/* ===== Бейджи статусов ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.badge--success { background: var(--success-light); color: var(--success); }
.badge--danger  { background: var(--danger-light);  color: var(--danger); }
.badge--warning { background: var(--warning-light); color: var(--warning); }
.badge--info    { background: var(--primary-light); color: var(--primary); }
.badge--muted   { background: var(--border-light);  color: var(--text-muted); }

/* ===== Карточки документов (Для предъявления) ===== */
.docs-preview {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.docs-preview__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
}

.docs-preview__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 480px) {
    .docs-preview__grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

.doc-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}
.doc-mini:hover { text-decoration: none; }

.doc-mini__icon {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
}

.doc-mini__icon--passport { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.doc-mini__icon--pension  { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.doc-mini__icon--oms      { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.doc-mini__icon--other    { background: linear-gradient(135deg, #e5e7eb, #9ca3af); }

.doc-mini__label {
    font-size: 12px;
    text-align: center;
    color: var(--text);
    font-weight: 500;
    line-height: 1.2;
}

/* ===== Приветствие ===== */
.hello {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}
.hello__sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ===== Пустой экран ===== */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty__icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty__title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty__text { font-size: 14px; }

/* ===== Мобильный адаптив ===== */
@media (max-width: 600px) {
    .page-title { font-size: 24px; }
    .hello { font-size: 19px; }
    .app-header__cabinet { display: none; }
}

/* ===== Утилиты ===== */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }