:root {
    --bg: #080b12;
    --card: rgba(17, 22, 34, 0.92);
    --card-solid: #111622;
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #f6f7fb;
    --muted: #aeb6c7;
    --accent: #f0b84f;
    --accent-dark: #c98c1d;
    --danger: #ff6b6b;
    --success: #63d297;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(240, 184, 79, 0.18), transparent 32rem),
        radial-gradient(circle at bottom right, rgba(76, 111, 255, 0.13), transparent 28rem),
        var(--bg);
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card,
.upload-card,
.files-card,
.topbar {
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    border-radius: 28px;
}

.login-card {
    width: min(440px, 100%);
    padding: 34px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    color: #121212;
    font-weight: 800;
    letter-spacing: -0.04em;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffe2a5, var(--accent));
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    text-transform: uppercase;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

h1,
h2 {
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 4.4rem);
}

.login-card h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.45rem;
}

.muted {
    color: var(--muted);
    margin: 10px 0 0;
}

.login-form {
    display: grid;
    gap: 12px;
    margin-top: 26px;
}

.login-form label {
    color: var(--muted);
    font-weight: 700;
}

.login-form input {
    width: 100%;
    padding: 15px 16px;
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    outline: none;
    background: rgba(255, 255, 255, 0.06);
}

.login-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(240, 184, 79, 0.12);
}

.login-form button,
.primary-button,
.download-button,
.delete-button,
.logout {
    border: 0;
    cursor: pointer;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 800;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.login-form button,
.primary-button {
    padding: 15px 18px;
    color: #171717;
    background: linear-gradient(135deg, #ffe0a1, var(--accent));
}

.login-form button:hover,
.primary-button:hover,
.download-button:hover,
.delete-button:hover,
.logout:hover {
    transform: translateY(-1px);
}

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 44px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 30px;
    margin-bottom: 20px;
}

.logout {
    flex: 0 0 auto;
    padding: 12px 16px;
    color: var(--text);
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.06);
}

.message {
    margin: 14px 0;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.06);
}

.message.success {
    color: #ddffeb;
    border-color: rgba(99, 210, 151, 0.34);
    background: rgba(99, 210, 151, 0.12);
}

.message.error {
    color: #ffe5e5;
    border-color: rgba(255, 107, 107, 0.34);
    background: rgba(255, 107, 107, 0.12);
}

.upload-card,
.files-card {
    padding: 24px;
    margin-top: 20px;
}

.dropzone {
    min-height: 230px;
    display: grid;
    place-items: center;
    gap: 10px;
    text-align: center;
    padding: 28px;
    border: 1.5px dashed rgba(240, 184, 79, 0.55);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(240, 184, 79, 0.10), rgba(255, 255, 255, 0.035));
    cursor: pointer;
}

.dropzone.is-dragover {
    border-color: var(--accent);
    background: rgba(240, 184, 79, 0.16);
}

.dropzone input {
    display: none;
}

.dropzone strong {
    font-size: clamp(1.35rem, 3vw, 2.1rem);
    letter-spacing: -0.04em;
}

.dropzone span:not(.upload-icon),
.dropzone small {
    color: var(--muted);
}

.upload-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    color: #171717;
    font-size: 2rem;
    font-weight: 900;
    background: var(--accent);
}

.selected-files {
    margin: 14px 0;
    color: var(--muted);
    word-break: break-word;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.empty-state {
    padding: 42px;
    color: var(--muted);
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
}

.file-list {
    display: grid;
    gap: 12px;
}

.file-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.045);
}

.file-badge {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    color: #171717;
    font-size: 0.78rem;
    font-weight: 900;
    border-radius: 18px;
    background: #f1f3f8;
}

.file-main {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.file-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-main span {
    color: var(--muted);
    font-size: 0.94rem;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-actions form {
    margin: 0;
}

.download-button,
.delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
}

.download-button {
    color: #171717;
    background: var(--accent);
}

.delete-button {
    color: #ffe5e5;
    border: 1px solid rgba(255, 107, 107, 0.30);
    background: rgba(255, 107, 107, 0.10);
}

@media (max-width: 760px) {
    .topbar,
    .file-row {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
    }

    .file-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .download-button,
    .delete-button,
    .file-actions form {
        width: 100%;
    }

    .delete-button {
        width: 100%;
    }
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.diagnostics {
    flex: 0 0 auto;
    padding: 12px 16px;
    color: #171717;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 800;
    background: var(--accent);
    transition: transform 0.18s ease, background 0.18s ease;
}

.diagnostics:hover {
    transform: translateY(-1px);
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.progress-wrap {
    margin: 16px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
    font-size: 0.94rem;
    margin-bottom: 10px;
}

.progress-info strong {
    color: var(--text);
}

.progress-track {
    height: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #ffe0a1, var(--accent));
    transition: width 0.2s ease;
}

.check-table {
    display: grid;
    gap: 10px;
}

.check-row {
    display: grid;
    grid-template-columns: minmax(170px, 0.45fr) 1fr;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
}

.check-row strong {
    color: var(--muted);
}

.check-row span {
    word-break: break-word;
}

.check-row.is-bad {
    border-color: rgba(255, 107, 107, 0.34);
    background: rgba(255, 107, 107, 0.10);
}

.hint-box {
    margin: 16px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
}

.hint-box p {
    margin: 7px 0;
}

code {
    color: #ffe0a1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 760px) {
    .top-actions {
        width: 100%;
    }

    .diagnostics,
    .logout {
        width: 100%;
        text-align: center;
    }

    .check-row {
        grid-template-columns: 1fr;
    }
}
