/* assets/css/main.css */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
    --bg:         #0f1117;
    --bg-card:    #1a1d27;
    --bg-hover:   #222536;
    --border:     #2e3248;
    --text:       #e8eaf0;
    --text-muted: #7880a0;
    --accent:     #5b8ef5;
    --accent-dim: #2a3d6e;
    --green:      #3ecf7e;
    --green-dim:  #1a3d2e;
    --red:        #f56565;
    --red-dim:    #3d1a1a;
    --orange:     #f5a623;
    --orange-dim: #3d2e10;
    --radius:     10px;
    --radius-lg:  16px;
    --shadow:     0 2px 12px rgba(0,0,0,0.4);
}

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

html { font-size: 16px; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

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

code, .code {
    font-family: 'DM Mono', monospace;
    font-size: 0.875em;
    background: var(--bg-hover);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--accent);
}

/* ── Public center layout ─────────────────────────────────────────────────── */

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

.center-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
    text-align: center;
}

.center-card--wide { max-width: 680px; text-align: left; }

.logo { font-size: 3rem; margin-bottom: 0.5rem; }

h1 { font-size: 1.6rem; font-weight: 600; margin-bottom: 0.5rem; }

.subtitle { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }
.subtitle small { font-size: 0.85em; }

.back-link { color: var(--text-muted); font-size: 0.9rem; }
.back-link:hover { color: var(--text); }

/* ── Forms ────────────────────────────────────────────────────────────────── */

.code-form { display: flex; flex-direction: column; gap: 0.75rem; }

.code-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    text-align: center;
    transition: border-color 0.15s;
}
.code-input:focus { outline: none; border-color: var(--accent); }

.name-field { margin: 1rem 0; }
.name-field label { display: block; margin-bottom: 0.4rem; font-size: 0.9rem; color: var(--text-muted); }
.name-field input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}
.name-field input:focus { outline: none; border-color: var(--accent); }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary   { background: var(--accent); color: #fff; }
.btn--secondary { background: var(--bg-hover); color: var(--text); border-color: var(--border); }
.btn--ghost     { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn--success   { background: var(--green); color: #0f1117; }
.btn--danger    { background: var(--red); color: #fff; }
.btn--warn      { background: var(--orange); color: #0f1117; }
.btn--active    { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.btn--large     { padding: 0.8rem 1.5rem; font-size: 1rem; }
.btn--sm        { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */

.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
.alert--error   { background: var(--red-dim);    border: 1px solid var(--red);    color: var(--red); }
.alert--success { background: var(--green-dim);  border: 1px solid var(--green);  color: var(--green); }
.alert--info    { background: var(--accent-dim); border: 1px solid var(--accent); color: var(--accent); }

/* ── Upload area ─────────────────────────────────────────────────────────── */

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
}
.upload-area:hover,
.upload-area--dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.upload-area__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.upload-area__text { margin-bottom: 0.5rem; }
.upload-area__hint { font-size: 0.8rem; color: var(--text-muted); }
.upload-link { color: var(--accent); cursor: pointer; }

/* ── File list ───────────────────────────────────────────────────────────── */

.file-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}
.file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}
.file-item:last-child { border-bottom: none; }
.file-item__icon { flex-shrink: 0; }
.file-item__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item__size { color: var(--text-muted); flex-shrink: 0; }
.file-item__status { flex-shrink: 0; width: 1.5rem; text-align: center; }
.file-item__status--ok    { color: var(--green); }
.file-item__status--error { color: var(--red); }
.file-item__remove {
    background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0 0.25rem;
    font-size: 0.9rem;
}
.file-item__remove:hover { color: var(--red); }

/* ── Progress bar ────────────────────────────────────────────────────────── */

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.progress-bar__fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}
.progress-text { font-size: 0.85rem; color: var(--text-muted); text-align: center; }

/* ── Badges ──────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge--open   { background: var(--green-dim);  color: var(--green); }
.badge--closed { background: var(--red-dim);    color: var(--red); }
.badge--warn   { background: var(--orange-dim); color: var(--orange); }

/* ── Lightbox ────────────────────────────────────────────────────────────── */

.lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: zoom-out;
    padding: 1rem;
}
.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 3rem 1rem;
    font-size: 0.95rem;
}

.vote-btn {
    display: block;
    width: 100%;
    margin-bottom: 1rem;
    text-align: center;
}
.vote-btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
