:root {
    --bg: #0f1115;
    --card: #1a1d24;
    --card-hover: #21252e;
    --border: #2a2f3a;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --primary: #e53935;
    --primary-hover: #d32f2f;
    --success: #2e7d32;
    --success-hover: #1b5e20;
    --danger: #ff5252;
}

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

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.brand span {
    color: var(--muted);
    font-weight: 600;
}

.logout {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.logout:hover {
    color: var(--danger);
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px;
    flex: 1;
}

.hero {
    text-align: center;
    margin-bottom: 32px;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--muted);
}

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h2 {
    font-size: 1.1rem;
}

/* ---------- Form ---------- */
.input-row {
    display: flex;
    gap: 12px;
}

input[type="url"],
input[type="password"],
input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

.hint {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background: var(--primary);
    color: #fff;
}

.btn.primary:hover {
    background: var(--primary-hover);
}

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

.btn.success {
    background: var(--success);
    color: #fff;
    text-align: center;
}

.btn.success:hover {
    background: var(--success-hover);
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn.ghost:hover {
    color: var(--text);
    border-color: var(--muted);
}

/* ---------- Progress ---------- */
.progress-section {
    margin-top: 20px;
}

.progress-bar {
    height: 10px;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), #ff8a80);
    border-radius: 6px;
    transition: width 0.4s ease;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 16px;
}

.alert.error {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.4);
    color: var(--danger);
}

.hidden {
    display: none;
}

/* ---------- File list ---------- */
.file-list {
    list-style: none;
}

.file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    transition: background 0.2s;
}

.file-list li:hover {
    background: var(--card-hover);
}

.file-list .file-name {
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
    flex: 1;
}

.file-list .file-size {
    color: var(--muted);
    font-size: 0.8rem;
    margin-right: 12px;
    white-space: nowrap;
}

.file-list .download {
    color: var(--success);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.file-list .download:hover {
    text-decoration: underline;
}

.file-list .empty {
    color: var(--muted);
    text-align: center;
    background: transparent;
    border: none;
}

/* ---------- Login ---------- */
.login-card {
    width: 100%;
    max-width: 380px;
    margin: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.login-card .logo {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-card h1 {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.login-card form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-card input {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
    .input-row {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

