/* ── Reset & Base ─────────────────────────────────────────────── */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #0a0a0a;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

/* ── Views ────────────────────────────────────────────────────── */

.view[hidden] {
    display: none !important;
}

/* ── Login View ───────────────────────────────────────────────── */

#view-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    background: #141414;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
}

.brand {
    text-align: center;
    margin-bottom: 2rem;
}

.brand h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f0f0f0;
}

.brand p {
    color: #666;
    font-size: 0.82rem;
    margin-top: 0.3rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Form Elements ────────────────────────────────────────────── */

.field {
    margin-bottom: 1rem;
}

label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #777;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    background: #0e0e0e;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #555;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: #444;
}

/* ── Buttons ──────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 22px;
    background: #e8e8e8;
    color: #0a0a0a;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.25rem;
}

.btn:hover {
    background: #fff;
}

.btn:active {
    background: #d0d0d0;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    width: auto;
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.link-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #666;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    text-align: center;
    transition: color 0.15s;
}

.link-btn:hover {
    color: #999;
}

/* ── Divider ──────────────────────────────────────────────────── */

.divider {
    height: 1px;
    background: #222;
    margin: 1.5rem 0;
}

/* ── Error Messages ───────────────────────────────────────────── */

.error-msg {
    margin-top: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: #1c0f0f;
    border: 1px solid #3a1a1a;
    border-radius: 8px;
    color: #e57373;
    font-size: 0.82rem;
}

.error-msg[hidden] {
    display: none;
}

/* ── Gallery Header ───────────────────────────────────────────── */

.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #1a1a1a;
    background: #0e0e0e;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.brand-sm {
    font-size: 1rem;
    font-weight: 700;
    color: #f0f0f0;
    letter-spacing: -0.02em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-size: 0.85rem;
    color: #888;
}

/* ── Gallery Main ─────────────────────────────────────────────── */

.gallery-main {
    padding: 3rem 1.5rem;
}

.placeholder {
    text-align: center;
    color: #444;
    font-size: 0.95rem;
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 10px;
    }

    .gallery-header {
        padding: 0.6rem 1rem;
    }

    .gallery-main {
        padding: 2rem 1rem;
    }
}
