/* ==========================================================================
   Anonist — design tokens
   ink   — тёмный индиго: шапка, подвал, подписи к фото, заливка выбора
   paper — фон страницы
   rose  — основной акцент: кнопки, ссылки
   gold  — второстепенный акцент: бейдж возраста
   mist  — светлые поверхности, разделители
   plum  — приглушённый текст
   ========================================================================== */

:root {
    --ink: #1C1830;
    --paper: #F6F3FB;
    --rose: #D6335A;
    --rose-dark: #B32447;
    --gold: #C7871A;
    --mist: #E1DBEE;
    --plum: #6B6280;

    --font-display: 'Unbounded', 'Segoe UI', sans-serif;
    --font-body: 'Manrope', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

a { color: var(--rose); text-decoration: none; }
a:hover { color: var(--rose-dark); }

h1, h2 {
    font-family: var(--font-display);
    color: var(--ink);
    margin: 0 0 16px;
    line-height: 1.12;
    letter-spacing: -0.3px;
}
h1 { font-weight: 800; font-size: clamp(28px, 4.6vw, 42px); }
h2 { font-weight: 700; font-size: clamp(22px, 3.6vw, 28px); }

p { margin: 0 0 12px; }

/* ---------- Header & footer bands ---------- */

.site-header { background: var(--ink); }
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 21px;
    color: #fff;
}
.logo:hover { color: #fff; opacity: 0.85; }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { color: rgba(255, 255, 255, 0.82); font-weight: 600; font-size: 15px; }
.main-nav a:hover { color: #fff; }
.main-nav .btn-nav {
    background: var(--rose);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
}
.main-nav .btn-nav:hover { background: var(--rose-dark); color: #fff; }

main.container { padding-top: 36px; padding-bottom: 64px; min-height: 55vh; }

.site-footer {
    background: var(--ink);
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    padding: 26px 0;
    font-size: 14px;
    margin-top: 56px;
}
.site-footer p { margin: 0; }

/* ---------- Alerts ---------- */

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 22px;
    font-weight: 600;
    font-size: 15px;
}
.alert-success { background: #DEF2E4; color: #1F7A45; }
.alert-error { background: #FBE0E5; color: #A32243; }
.alert-warning { background: #FBF0D9; color: #8A5A10; }
.alert-error ul { margin: 0; padding-left: 20px; font-weight: 500; }
.alert-error li { margin-bottom: 2px; }

.inline-form { display: inline; }
.link-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}
.text-center { text-align: center; }

/* Honeypot: скрыто от людей, но заметно простым ботам-заполнителям форм. */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

/* ---------- Homepage hero + search picker ---------- */

.hero { padding-bottom: 8px; }
.hero-copy { max-width: 640px; margin-bottom: 32px; }
.hero-copy p { font-size: 17px; color: var(--plum); max-width: 62ch; }

.picker-form {
    display: flex;
    flex-direction: column;
    gap: 26px;
    max-width: 540px;
    margin-bottom: 8px;
}
.picker-label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
    margin-bottom: 10px;
}

.pill-row { display: flex; gap: 10px; }
.pill {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    background: var(--mist);
    color: var(--ink);
    font-weight: 700;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.pill input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.pill:has(input:checked) { background: var(--ink); color: #fff; }
.pill input:focus-visible ~ span { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 4px; }

.band-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--ink);
    border-radius: 8px;
    overflow: hidden;
}
.band {
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px 18px;
    background: var(--mist);
    color: var(--ink);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.band input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.band:has(input:checked) { background: var(--ink); color: #fff; }
.band input:focus-visible ~ span { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 4px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 16px;
    padding: 14px 30px;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    text-align: center;
}
.btn-primary { background: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-dark); color: #fff; }
.btn-secondary { background: var(--mist); color: var(--ink); }
.btn-secondary:hover { background: #d2c9e6; color: var(--ink); }
.btn-block { width: 100%; }
.btn:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

/* ---------- Profile grid (search results) ---------- */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
    margin-top: 44px;
}

.profile-tile {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    background: var(--ink);
}
.tile-photo {
    aspect-ratio: 1 / 1;
    background: var(--mist);
    overflow: hidden;
}
.tile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.avatar-placeholder { width: 100%; height: 100%; display: block; }
.profile-tile:hover .tile-photo img { transform: scale(1.05); }

.tile-caption { padding: 12px 14px 14px; }
.tile-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.tile-badge {
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
.tile-badge-age { background: var(--gold); color: var(--ink); }
.tile-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    text-align: center;
    color: var(--plum);
    padding: 70px 20px;
    font-size: 17px;
}

/* ---------- Pagination ---------- */

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pagination a {
    padding: 9px 15px;
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    border: 1.5px solid var(--mist);
    font-weight: 700;
    font-size: 14px;
}
.pagination a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Forms (register / login / cabinet) ---------- */

.form-page {
    max-width: 560px;
    margin: 8px auto 0;
    background: #fff;
    border: 1.5px solid var(--mist);
    border-radius: 14px;
    padding: 34px;
}
.form-page-narrow { max-width: 440px; }
.form-page > p.muted:first-of-type { margin-top: -8px; }

.site-form .form-group { margin-bottom: 22px; }
.site-form label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 14px; }

select,
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
input[type="file"] {
    font-family: var(--font-body);
    font-size: 16px;
    padding: 12px 14px;
    border: 1.5px solid var(--mist);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    width: 100%;
}
select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--rose);
}
textarea { resize: vertical; font-family: var(--font-body); }

.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-group-vertical { flex-direction: column; gap: 2px; background: var(--ink); border-radius: 8px; overflow: hidden; }
.radio-group-vertical .radio-pill { border-radius: 0; }

.radio-pill {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--mist);
    border-radius: 8px;
    padding: 13px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    flex: 1;
    min-width: 140px;
    transition: background 0.15s ease, color 0.15s ease;
}
.radio-pill input { accent-color: var(--rose); }
.radio-pill:has(input:checked) { background: var(--ink); color: #fff; }

.form-check label,
.checkbox-inline {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
}
.checkbox-inline { margin-top: 10px; }

.form-footer-link { text-align: center; margin-top: 22px; color: var(--plum); font-size: 15px; }

.current-photo img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 10px;
}

.muted { color: var(--plum); }

/* ---------- Single profile page ---------- */

.card-detail {
    display: flex;
    gap: 30px;
    background: #fff;
    border: 1.5px solid var(--mist);
    border-radius: 14px;
    padding: 30px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.card-detail-photo {
    width: 260px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--mist);
    flex-shrink: 0;
}
.card-detail-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-detail-info { flex: 1; min-width: 240px; }
.badges { margin-bottom: 16px; }
.badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    background: var(--mist);
    color: var(--ink);
    margin-right: 6px;
}
.badge-age { background: #F7E7C9; color: #8A5A10; }
.card-detail-text {
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-line;
    max-width: 60ch;
    margin-bottom: 24px;
}

/* ---------- Admin panel ---------- */

.admin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.admin-bar h1 { margin: 0; }

.admin-table-wrap {
    background: #fff;
    border: 1.5px solid var(--mist);
    border-radius: 14px;
    overflow-x: auto;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.admin-table th, .admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--mist);
}
.admin-table th { font-weight: 700; color: var(--plum); font-size: 13px; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-text-cell { white-space: normal; max-width: 260px; color: var(--plum); }
.admin-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--mist);
}
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-actions a { margin-right: 12px; font-weight: 700; }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
    .form-page { padding: 24px; }
    .card-detail { padding: 20px; flex-direction: column; }
    .card-detail-photo { width: 100%; }
    .pill-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
