:root {
    color-scheme: light;
    --navy: #0f172a;
    --navy-soft: #1e293b;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --cyan: #0ea5e9;
    --green: #15803d;
    --red: #dc2626;
    --surface: #ffffff;
    --background: #f1f5f9;
    --border: #cbd5e1;
    --text: #1e293b;
    --muted: #64748b;
    --shadow: 0 18px 50px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 90% 0%, rgba(14, 165, 233, .12), transparent 28rem),
        var(--background);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .4rem; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.04em; }
h2 { margin-bottom: .5rem; font-size: 1.35rem; }
h3 { margin-bottom: .25rem; }
p { color: var(--muted); line-height: 1.55; }

.eyebrow {
    margin-bottom: .5rem;
    color: var(--blue);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.auth-card {
    width: min(100%, 460px);
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border: 1px solid rgba(203, 213, 225, .8);
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow);
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 1.5rem;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    font-size: 1.05rem;
    font-weight: 900;
}

.lead { margin-bottom: 1.6rem; }
.stack-form { display: grid; gap: 1rem; }

label {
    display: grid;
    gap: .45rem;
    color: var(--navy-soft);
    font-size: .9rem;
    font-weight: 700;
}

input[type="password"], input[type="text"] {
    width: 100%;
    min-height: 46px;
    padding: .7rem .85rem;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text);
    background: #fff;
    font: inherit;
    outline: none;
}

input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem max(1.25rem, calc((100vw - 1120px) / 2));
    color: #fff;
    background: var(--navy);
}

.topbar h1 { margin: 0; }
.topbar .eyebrow { color: #7dd3fc; }

.dashboard {
    width: min(100% - 2rem, 1120px);
    margin: 2rem auto 4rem;
    display: grid;
    gap: 1.25rem;
}

.panel {
    padding: clamp(1.2rem, 3vw, 1.8rem);
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 8px 28px rgba(15, 23, 42, .06);
}

.upload-panel { display: grid; grid-template-columns: 1fr 1.1fr; gap: 2rem; align-items: center; }
.upload-form { display: grid; grid-template-columns: 1fr auto; gap: .75rem; }

.file-picker {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: .7rem .9rem;
    overflow: hidden;
    border: 1px dashed #94a3b8;
    border-radius: 11px;
    background: #f8fafc;
    cursor: pointer;
}

.file-picker input { width: 100%; color: var(--muted); }
.hint { grid-column: 1 / -1; margin: .75rem 0 0; font-size: .82rem; }

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .65rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: .9rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--blue); }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { color: #fff; border-color: #475569; background: #334155; }
.button.danger { color: #fff; background: var(--red); }
.button.danger-outline { color: var(--red); border-color: #fecaca; background: #fff; }
.button.small { min-height: 36px; padding: .5rem .8rem; font-size: .82rem; }

.section-heading, .file-card, .file-actions {
    display: flex;
    align-items: center;
}

.section-heading { justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.file-list { display: grid; gap: .75rem; }

.file-card {
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.file-icon, .empty-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--blue);
    background: #dbeafe;
    font-weight: 900;
}

.file-icon { width: 52px; height: 52px; font-size: .72rem; }
.file-information { min-width: 0; flex: 1; }
.file-information h3 { overflow-wrap: anywhere; }
.file-information p { margin-bottom: .4rem; font-size: .86rem; }
.file-information code { display: block; overflow: hidden; color: #475569; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.file-actions { gap: .5rem; }

.empty-state { padding: 2.5rem 1rem; text-align: center; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 1rem; }

.alert {
    padding: .9rem 1rem;
    border-radius: 12px;
    font-weight: 700;
}
.alert.success { color: #166534; border: 1px solid #bbf7d0; background: #f0fdf4; }
.alert.error { color: #991b1b; border: 1px solid #fecaca; background: #fef2f2; }

.security-note {
    padding: 1rem 1.2rem;
    border-left: 4px solid var(--cyan);
    border-radius: 10px;
    color: #0c4a6e;
    background: #e0f2fe;
    line-height: 1.5;
}

@media (max-width: 760px) {
    .topbar { align-items: flex-start; }
    .upload-panel { grid-template-columns: 1fr; gap: 1rem; }
    .upload-form { grid-template-columns: 1fr; }
    .file-card { align-items: flex-start; flex-wrap: wrap; }
    .file-actions { width: 100%; padding-left: 68px; }
}

@media (max-width: 480px) {
    .topbar { flex-direction: column; }
    .topbar form, .topbar .button { width: 100%; }
    .file-actions { padding-left: 0; }
    .file-actions .button { flex: 1; }
    .section-heading { align-items: flex-start; flex-direction: column; }
}
