:root {
    color-scheme: light dark;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #eef3ff;
    --text: #1a2333;
    --text-muted: #5a6a85;
    --primary: #3f67ff;
    --primary-strong: #294ded;
    --border: #d7deea;
    --shadow: 0 12px 30px rgba(23, 36, 66, 0.12);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #11151f;
        --surface: #1b2332;
        --surface-2: #24314a;
        --text: #f3f6ff;
        --text-muted: #bac7e5;
        --primary: #7f9dff;
        --primary-strong: #95adff;
        --border: #32425f;
        --shadow: 0 18px 36px rgba(3, 8, 20, 0.5);
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(76, 113, 255, 0.18), transparent 40%),
        radial-gradient(circle at bottom left, rgba(25, 184, 214, 0.12), transparent 45%),
        var(--bg);
    color: var(--text);
}

.app-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 18px 32px;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: min(460px, 100%);
    background: linear-gradient(135deg, var(--surface), var(--surface-2));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.login-title {
    margin: 0;
}

.login-subtitle {
    margin: 8px 0 16px;
    color: var(--text-muted);
}

.login-form {
    display: grid;
    gap: 10px;
}

.hero {
    background: linear-gradient(135deg, var(--surface), var(--surface-2));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 26px 24px;
    box-shadow: var(--shadow);
}

.hero-kicker {
    margin: 0 0 8px;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2vw + 1rem, 2.35rem);
}

.hero-subtitle {
    margin: 8px 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.control-panel {
    margin-top: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.control-label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
}

.control-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

select,
input,
button {
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 1rem;
}

select,
input {
    flex: 1 1 260px;
    min-height: 44px;
    padding: 0 12px;
    background: var(--surface);
    color: var(--text);
}

button {
    min-height: 44px;
    min-width: 116px;
    padding: 0 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

button:active {
    transform: translateY(0);
}

.secondary-btn {
    background: transparent;
    color: var(--text);
}

.filter-hint {
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.filter-hint strong {
    color: var(--text);
    font-weight: 600;
}

.status-text {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.gallery-section {
    margin-top: 22px;
}

.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-label {
    font-weight: 600;
    font-size: 0.94rem;
    color: var(--text);
}

.pagination-bar select {
    flex: 0 1 auto;
    min-width: 72px;
    max-width: 140px;
}

.pagination-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.pagination-btn {
    min-width: 104px;
}

.pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.pagination-info {
    font-size: 0.94rem;
    color: var(--text-muted);
    min-width: 10ch;
    text-align: center;
}

.gallery {
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.placeholder-card,
.image-card {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.placeholder-card {
    min-height: 160px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    text-align: center;
    padding: 18px;
}

.image-card img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    image-rendering: auto;
    cursor: zoom-in;
}

.image-meta {
    padding: 10px 12px 12px;
}

.image-name {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    word-break: break-word;
}

.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(2, 7, 18, 0.88);
    z-index: 999;
    padding: 18px;
}

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

.lightbox-image {
    max-width: 96vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.lightbox-close-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    min-width: 86px;
    min-height: 40px;
    z-index: 1000;
}
