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

:root {
    --rose: #b8305f;
    --rose-dark: #8c2148;
    --gold: #cf9b3f;
    --plum: #2c1524;
    --ink: #2a2230;
    --muted: #7a7080;
    --bg: #fbf6f4;
    --card: #ffffff;
    --border: #f0e3e6;
    --shadow: 0 10px 30px rgba(140, 33, 72, 0.08);
    --shadow-hover: 0 16px 40px rgba(140, 33, 72, 0.16);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    background: var(--bg);
    background-image: radial-gradient(circle at 10% 0%, #fdeef1 0%, transparent 45%),
        radial-gradient(circle at 90% 10%, #fbf3e4 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--ink);
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    margin: 0;
}

a {
    color: var(--rose-dark);
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(120deg, var(--plum), var(--rose-dark));
    color: white;
    padding: 20px 32px;
    box-shadow: 0 4px 20px rgba(44, 21, 36, 0.25);
}

.topbar h1 {
    font-size: 1.6rem;
    letter-spacing: 0.3px;
}

.topbar h1::before {
    content: '\2764';
    color: var(--gold);
    margin-right: 10px;
    font-size: 1.2rem;
}

.topbar .brand {
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.15s ease;
}

.topbar .brand:hover {
    opacity: 0.85;
}

.topbar a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 18px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.topbar a:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
}

/* Shared containers */
.filters,
.summary,
.pagination,
.detail-card {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

main {
    padding-bottom: 60px;
}

/* Auth card */
.auth-card {
    max-width: 440px;
    margin: 64px auto;
    padding: 40px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.auth-card h1 {
    font-size: 2rem;
    color: var(--rose-dark);
}

.auth-card > p {
    color: var(--muted);
    margin: 10px 0 24px;
}

form label {
    display: block;
    margin-bottom: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink);
}

input,
select,
button {
    width: 100%;
    padding: 12px 14px;
    margin-top: 6px;
    border-radius: 10px;
    border: 1px solid #e4d5da;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fffdfc;
    color: var(--ink);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(184, 48, 95, 0.12);
}

button {
    background: linear-gradient(120deg, var(--rose), var(--rose-dark));
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-top: 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(184, 48, 95, 0.3);
}

.alert.error {
    background: #fdeaea;
    color: #a3223f;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid #f6cdd4;
}

/* Filters */
.filters {
    margin-top: 28px;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    background: var(--card);
    padding: 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.filter-form button {
    margin-top: 6px;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--ink);
    margin-top: 6px;
}

.checkbox-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0;
    accent-color: var(--rose);
    flex-shrink: 0;
}

.summary {
    margin-top: 20px;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 20px;
    padding: 12px 24px 20px;
    max-width: 1160px;
    margin: 0 auto;
}

.profile-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 22px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3e4e9;
    margin-bottom: 12px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px var(--rose);
}

.avatar.large {
    width: 180px;
    height: 180px;
    box-shadow: 0 0 0 4px var(--rose);
}

.profile-card h2 {
    font-size: 1.15rem;
    color: var(--ink);
    margin-bottom: 6px;
}

.profile-card p {
    margin: 4px 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.profile-card p strong {
    color: var(--ink);
}

.excerpt {
    margin-top: 10px;
    font-style: italic;
    min-height: 40px;
}

.profile-card > a {
    display: inline-block;
    margin-top: 14px;
    text-decoration: none;
    font-weight: 700;
    color: white;
    background: linear-gradient(120deg, var(--rose), var(--rose-dark));
    padding: 9px 22px;
    border-radius: 999px;
    font-size: 0.85rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.profile-card > a:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(184, 48, 95, 0.3);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.page-link {
    padding: 9px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--rose-dark);
    background: var(--card);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.page-link:hover {
    background: #fbeaef;
}

.page-link.active {
    background: linear-gradient(120deg, var(--rose), var(--rose-dark));
    color: white;
    border-color: transparent;
}

/* Detail page */
.detail-card {
    margin-top: 32px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 36px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
}

.detail-card .avatar.large {
    margin: 0 auto;
}

.detail-list p {
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.95rem;
}

.detail-list p:last-child {
    border-bottom: none;
    display: block;
}

.detail-list p strong {
    color: var(--muted);
    font-weight: 600;
    min-width: 140px;
}

/* Image lightbox */
.img-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 8, 15, 0.85);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: zoom-out;
}

.img-lightbox.open {
    display: flex;
}

.img-lightbox img {
    max-width: min(90vw, 520px);
    max-height: 85vh;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 4px solid white;
    object-fit: cover;
}

.img-lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    color: white;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    font-weight: 300;
}

@media (max-width: 640px) {
    .topbar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 20px;
    }

    .detail-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 24px;
    }

    .detail-list p {
        flex-direction: column;
        gap: 4px;
    }
}
