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

:root {
    --bg: #0d0d0d;
    --surface: #1a1a1a;
    --surface2: #242424;
    --border: #333;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #8b1a1a;
    --accent-light: #b22222;
    --accent-glow: #d4342480;
    --danger: #ff4444;
    --success: #2ea043;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container { width: 100%; max-width: 480px; padding: 1rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.card.wide { max-width: 600px; }

.container:has(.wide) { max-width: 640px; }

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--accent-light);
}

h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }

.subtitle { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.field { margin-bottom: 1.25rem; }

.field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 0.65rem 0.75rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus { border-color: var(--accent-light); }

.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.btn:hover { background: var(--accent-light); box-shadow: 0 0 12px var(--accent-glow); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-light);
    color: var(--accent-light);
}

.btn-outline:hover { background: var(--accent); color: #fff; }

.error {
    margin-top: 1rem;
    padding: 0.6rem 0.75rem;
    background: #441111;
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    color: var(--danger);
    font-size: 0.85rem;
}

.hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }

.file-input {
    width: 100%;
    padding: 0.5rem;
    background: var(--surface2);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
}

.file-input::-webkit-file-upload-button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 0.75rem;
}

.breadcrumb {
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb .crumb { color: var(--accent-light); }
.breadcrumb .crumb:hover { text-decoration: underline; }
.breadcrumb .crumb:last-child { color: var(--text); cursor: default !important; }
.breadcrumb .crumb:last-child:hover { text-decoration: none; }
.breadcrumb .crumb-sep { color: var(--text-muted); margin: 0 0.15rem; }

.file-list {
    margin: 1rem 0;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    background: var(--surface2);
}

.file-list .file-item {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-list .file-item:last-child { border-bottom: none; }

.file-item .name { word-break: break-all; flex: 1; }
.file-item .icon { margin-right: 0.4rem; }
.folder-item { cursor: pointer; }
.folder-item:hover { background: var(--surface); }
.file-item .size { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; margin-left: 0.5rem; }

.file-item .btn-dl {
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.file-item .btn-dl:hover { background: var(--accent-light); }

.progress {
    margin-top: 1rem;
    background: var(--surface2);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    height: 28px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    width: 0;
    transition: width 0.3s;
}

.progress span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 600;
}

.success-box {
    text-align: center;
}

.success-box h2 { color: var(--success); }

.link-box {
    display: flex;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.link-box input {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.5rem;
    font-size: 0.85rem;
}

@media (max-width: 520px) {
    .card { padding: 1.25rem; }
    h1 { font-size: 1.25rem; }
}
