:root {
    --bg: #f5f6f8;
    --card: #ffffff;
    --text: #1a1d21;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #f3f4f6;
    --secondary-hover: #e5e7eb;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --success: #10b981;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

body.centered {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.card h1, .container h1 { margin: 0 0 .25rem; font-size: 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.alert { padding: .75rem 1rem; border-radius: 8px; margin: 1rem 0; font-size: .9rem; }
.alert.error { background: var(--error-bg); color: var(--error-text); }

form { margin-top: 1.5rem; }

label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .5rem;
}

input[type="password"],
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: .625rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--card);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

button {
    padding: .625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
button:disabled { opacity: .5; cursor: not-allowed; }

.card form button, .btn-primary {
    background: var(--primary);
    color: white;
}
.card form button:hover:not(:disabled), .btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.card form button { width: 100%; margin-top: 1rem; }

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
    display: inline-block;
    text-align: center;
    cursor: pointer;
}
.btn-secondary:hover { background: var(--secondary-hover); }

.btn-sm { padding: .375rem .75rem; font-size: .875rem; }

.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand { font-weight: 600; }
.link { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }

.container { max-width: 900px; margin: 0 auto; padding: 2rem; }
.container.narrow { max-width: 640px; }

.dropzone {
    margin-top: 1.5rem;
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 1.5rem;
    text-align: center;
    background: var(--card);
    transition: border-color .15s, background .15s;
}
.dropzone.drag {
    border-color: var(--primary);
    background: #eff6ff;
}
.dropzone p { margin: .25rem 0; }

.file-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.file-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.file-list li:last-child { border-bottom: 0; }
.file-list .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .fsize { color: var(--muted); font-size: .875rem; }
.file-list .fremove {
    background: transparent;
    color: var(--muted);
    border: 0;
    font-size: 1.5rem;
    padding: 0 .5rem;
    line-height: 1;
}
.file-list .fremove:hover { color: var(--error-text); }

.meta-fields {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.meta-fields label { margin-bottom: 1rem; font-weight: 500; }
.meta-fields label input, .meta-fields label textarea {
    display: block; margin-top: .375rem; font-weight: normal;
}
.meta-fields button { width: 100%; margin-top: .5rem; }

.progress-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: .5rem;
    font-size: .875rem;
}
.progress-track {
    height: 8px;
    background: var(--secondary);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width .2s;
}

.result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.result h2 { margin: 0 0 .25rem; }
.link-row { display: flex; gap: .5rem; margin-top: 1rem; }
.link-row input { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace; font-size: .875rem; }
.link-row button { flex-shrink: 0; }

.download-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
}
.download-card h1 { margin: 0 0 1rem; }
.message-box {
    background: var(--secondary);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    white-space: pre-wrap;
}

.download-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    border-top: 1px solid var(--border);
}
.download-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.download-list li > div:first-child { flex: 1; min-width: 0; }
.download-list .fname {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
