/* WMPFA shader archive -- matches the reqid.io portfolio palette */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --bg-tertiary: #1a1a24;
    --accent: #9333ea;
    --accent-hover: #a855f7;
    --accent-glow: rgba(147, 51, 234, 0.2);
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: #27272a;
    --danger: #ef4444;
    --ok: #22c55e;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a24 50%, #0a0a0f 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

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

code, .mono {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.9em;
}

.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* ---------- header ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1.25rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.brand {
    font-family: Orbitron, Inter, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #9333ea 0%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand small {
    display: block;
    font-family: Inter, sans-serif;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
}

.topbar-actions { display: flex; align-items: center; gap: 1rem; }
.topbar-actions .who { color: var(--text-muted); font-size: 0.85rem; }

/* ---------- auth card ---------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-card h1 {
    margin: 0 0 0.35rem;
    font-family: Orbitron, Inter, sans-serif;
    font-size: 1.4rem;
}

.auth-card p.sub {
    margin: 0 0 1.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-foot {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.auth-foot a { color: var(--text-muted); }
.auth-foot a:hover { color: var(--accent-hover); }
.auth-foot span { margin: 0 0.4rem; }

label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

input[type=text], input[type=password], input[type=number], input[type=date], select {
    width: 100%;
    padding: 0.75rem 0.9rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input.code-input {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.15rem;
    letter-spacing: 0.22em;
    text-align: center;
    text-transform: uppercase;
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.3rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.btn.ghost:hover { border-color: var(--accent); color: var(--text-primary); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.small { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

.field { margin-bottom: 1.1rem; }

.alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    border: 1px solid;
}

.alert.error { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.alert.ok { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.4); color: #86efac; }
.alert.info { background: var(--accent-glow); border-color: rgba(147, 51, 234, 0.4); color: #d8b4fe; }

/* ---------- catalog ---------- */

.toolbar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.toolbar input[type=text] { flex: 1 1 240px; }
.toolbar select { flex: 0 1 200px; }

.collection-title {
    margin: 2.5rem 0 1rem;
    font-family: Orbitron, Inter, sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.collection-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.1rem;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.card .thumb {
    aspect-ratio: 16 / 9;
    background: var(--bg-tertiary) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-family: Orbitron, Inter, sans-serif;
    font-size: 1.6rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border);
}

.card .body { padding: 1rem 1.1rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.card h3 { margin: 0 0 0.3rem; font-size: 1rem; word-break: break-word; }
.card .meta { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 0.7rem; }
.card .desc { color: var(--text-secondary); font-size: 0.85rem; margin: 0 0 0.9rem; flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.9rem; }

.tag {
    font-size: 0.7rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: var(--accent-glow);
    color: #d8b4fe;
}

/* ---------- paging ---------- */

.result-count {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.pager .btn.small { min-width: 38px; text-align: center; }
.pager .btn.current { background: var(--accent); color: #fff; cursor: default; }
.pager .btn.disabled { opacity: 0.35; pointer-events: none; }
.pager .gap { color: var(--text-muted); padding: 0 0.15rem; }

.empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: 14px;
}

/* ---------- admin ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }

.stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
}

.stat .n { font-family: Orbitron, Inter, sans-serif; font-size: 1.6rem; color: var(--accent-hover); }
.stat .k { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }

.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.panel h2 { margin: 0 0 1.2rem; font-family: Orbitron, Inter, sans-serif; font-size: 1rem; letter-spacing: 0.05em; }

.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.row .field { flex: 1 1 160px; margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { padding: 0.65rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.revoked td { opacity: 0.45; }

.table-scroll { overflow-x: auto; }

.pill {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid;
}

.pill.ok { color: var(--ok); border-color: rgba(34, 197, 94, 0.4); }
.pill.off { color: var(--text-muted); border-color: var(--border); }

.codebox {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.25rem;
    letter-spacing: 0.15em;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px dashed var(--accent);
    border-radius: 10px;
    text-align: center;
    margin: 0.75rem 0;
    user-select: all;
    word-break: break-all;
}

@media (max-width: 640px) {
    .wrap { padding: 1.5rem 1rem 3rem; }
    .grid { grid-template-columns: 1fr; }
}
