/* ── Reset & base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:       #0f1117;
    --surface:  #1a1d27;
    --border:   #2a2d3a;
    --text:     #e2e4e9;
    --muted:    #8b8fa3;
    --accent:   #6366f1;
    --accent2:  #8b5cf6;
    --success:  #22c55e;
    --danger:   #ef4444;
    --radius:   12px;
}

html { height: 100%; }

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

/* ── Card ──────────────────────────────────────────────── */
.card {
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
}

/* ── Header ────────────────────────────────────────────── */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header img {
    width: 64px;
    height: 64px;
    margin-bottom: .75rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.header p {
    color: var(--muted);
    font-size: .875rem;
}

/* ── Drop zone ─────────────────────────────────────────── */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    margin-bottom: 1.25rem;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent);
    background: rgba(99,102,241,.06);
}

.dropzone-icon {
    font-size: 2rem;
    margin-bottom: .5rem;
}

.dropzone-text {
    color: var(--muted);
    font-size: .875rem;
}

.dropzone-text strong {
    color: var(--accent);
    cursor: pointer;
}

.file-info {
    display: none;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: rgba(99,102,241,.08);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: .875rem;
}

.file-info.show { display: flex; }

.file-info .name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info .size { color: var(--muted); white-space: nowrap; }

.file-info .remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 .25rem;
}

/* ── Options row ───────────────────────────────────────── */
.options {
    display: flex;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.field { flex: 1; display: flex; flex-direction: column; gap: .35rem; }

.field label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}

.field select,
.field input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .55rem .75rem;
    color: var(--text);
    font-size: .875rem;
    outline: none;
    transition: border-color .2s;
}

.field select:focus,
.field input:focus { border-color: var(--accent); }

/* ── Button ────────────────────────────────────────────── */
.btn {
    width: 100%;
    padding: .75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
}

.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:not(:disabled):hover { opacity: .85; }

/* ── Progress ──────────────────────────────────────────── */
.progress-wrap {
    display: none;
    margin-bottom: 1rem;
}

.progress-wrap.show { display: block; }

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: .35rem;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 3px;
    transition: width .3s;
}

.progress-text {
    font-size: .75rem;
    color: var(--muted);
    text-align: right;
}

/* ── Result ────────────────────────────────────────────── */
.result {
    display: none;
    text-align: center;
}

.result.show { display: block; }

.result .check {
    font-size: 3rem;
    margin-bottom: .5rem;
}

.result h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.link-box {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .5rem .75rem;
    margin-bottom: 1rem;
    gap: .5rem;
}

.link-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: .85rem;
    outline: none;
}

.link-box button {
    background: var(--accent);
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: .4rem .75rem;
    font-size: .8rem;
    cursor: pointer;
    white-space: nowrap;
}

.link-box button:hover { opacity: .85; }

.result .note {
    font-size: .8rem;
    color: var(--muted);
}

.btn-reset {
    margin-top: 1rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-reset:hover { border-color: var(--accent); }

/* ── Error ─────────────────────────────────────────────── */
.error-msg {
    display: none;
    background: rgba(239,68,68,.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .85rem;
    margin-bottom: 1rem;
    text-align: center;
}

.error-msg.show { display: block; }

/* ── Download page ─────────────────────────────────────── */
.dl-info { margin-bottom: 1.5rem; text-align: center; }
.dl-info .filename { font-size: 1.1rem; font-weight: 600; margin-bottom: .25rem; }
.dl-info .meta { color: var(--muted); font-size: .85rem; }

.msg { text-align: center; }
.msg.expired { color: var(--danger); }

/* ── Footer ────────────────────────────────────────────── */
.footer {
    margin-top: 1.5rem;
    font-size: .75rem;
    color: var(--muted);
}
