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

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface2: #22263a;
    --accent: #4f7fff;
    --accent-hover: #3a67f0;
    --text: #e8eaf6;
    --text-muted: #8b90ab;
    --border: #2e3250;
    --danger: #e05252;
    --success: #4caf7d;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 10;
}
.nav-logo { font-size: 1.25rem; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1rem; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.25rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c94444; }

.hero {
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    max-width: 720px;
    margin: 0 auto;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    max-width: 1000px;
    margin: 0 auto 5rem;
    padding: 0 1.5rem;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
}
.card-icon { font-size: 2rem; margin-bottom: .75rem; }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.card p { font-size: .9rem; color: var(--text-muted); }

.auth-wrap {
    min-height: calc(100vh - 65px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow);
}
.auth-box h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .4rem; }
.auth-box p { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.75rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--text-muted); }
.field input {
    width: 100%;
    padding: .65rem .9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: .95rem;
    outline: none;
    transition: border-color .2s;
}
.field input:focus { border-color: var(--accent); }
.form-error {
    background: rgba(224,82,82,.12);
    border: 1px solid var(--danger);
    border-radius: 7px;
    color: var(--danger);
    font-size: .85rem;
    padding: .6rem .9rem;
    margin-bottom: 1rem;
    display: none;
}
.form-error.visible { display: block; }

.dash-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.dash-header .logo { font-size: 1.2rem; font-weight: 700; }
.dash-header .logo span { color: var(--accent); }
.dash-main { flex: 1; padding: 2rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.dash-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.dash-toolbar h2 { font-size: 1.2rem; font-weight: 700; }
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.file-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    text-align: center;
    transition: border-color .2s, background .2s;
}
.file-card:hover { border-color: var(--accent); background: var(--surface2); }
.file-icon { font-size: 2.5rem; }
.file-name { font-size: .85rem; font-weight: 600; word-break: break-all; }
.file-size { font-size: .78rem; color: var(--text-muted); }
.file-card a { font-size: .82rem; }

.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .8rem 1.2rem;
    font-size: .9rem;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    z-index: 100;
}
.toast.show { opacity: 1; transform: translateY(0); }

footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: .85rem;
    border-top: 1px solid var(--border);
}
