:root {
    --bg: #FFFFFF;
    --surface: #F5F5F5;
    --border: #E0E0E0;
    --text: #1F1D1E;
    --muted: #6B6B6B;
    --accent: #FD243C;
    --accent-hover: #D41E33;
    --error: #FD243C;
    --success: #2E9E5B;
    --success-hover: #26834A;
}

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

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

.login-container {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(31, 29, 30, 0.08);
    overflow: hidden;
}

/* Красная полоска сверху */
.login-container::before {
    content: "";
    display: block;
    height: 4px;
    background: var(--accent);
}

.login-inner {
    padding: 36px 40px 40px;
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.subtitle {
    color: var(--muted);
    text-align: center;
    font-size: 14px;
    margin-bottom: 28px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

label.remember {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    color: var(--muted);
    cursor: pointer;
}

input[type="text"],
input[type="password"] {
    padding: 11px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(253, 36, 60, 0.10);
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

button[type="submit"] {
    margin-top: 4px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

button[type="submit"]:hover {
    background: var(--accent-hover);
}

button[type="submit"]:active {
    transform: scale(0.98);
}

#status {
    margin-top: 18px;
    font-size: 13px;
    text-align: center;
    color: var(--muted);
    min-height: 18px;
}

#status.error { color: var(--error); }

.btn {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }


body.dashboard {
    display: block;
}

.topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent);
}


.topbar-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    font-size: 13px;
    color: var(--muted);
}

/* Кнопка в шапке: цвета от .btn, ширина своя */
.btn--sm {
    display: inline-block;
    width: auto;
    margin-top: 0;
    padding: 8px 16px;
    font-size: 13px;
}

.dashboard-main {
    max-width: 880px;
    margin: 0 auto;
    padding: 40px 32px 64px;
}

.page-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.page-hint {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 28px;
}

.uploads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 180px;
    padding: 28px 20px;
    text-align: center;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

/* Иначе dragleave срабатывает при наведении на вложенные span */
.dropzone > * {
    pointer-events: none;
}

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

.dropzone.dragover {
    border-color: var(--accent);
    background: rgba(253, 36, 60, 0.04);
}

.dropzone.filled {
    border-style: solid;
    border-color: var(--accent);
}

.dropzone-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.dropzone-hint {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
}

.dropzone-file {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    word-break: break-all;
}

.dropzone-check {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--success);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.18s, transform 0.18s;
}

.dropzone.uploaded .dropzone-check {
    opacity: 1;
    transform: scale(1);
}

.dropzone.uploaded {
    border-style: solid;
    border-color: var(--success);
}

.dropzone.uploaded:hover {
    border-color: var(--success);
}

.dropzone-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background: var(--accent);
    border-radius: 0 0 10px 10px;
    transition: width 0.15s linear;
}

.dropzone.uploaded .dropzone-progress {
    background: var(--success);
}

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

.actions .btn {
    width: auto;
    margin-top: 0;
    padding: 12px 28px;
}

.btn[hidden] {
    display: none;
}

.btn--link {
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    background: var(--success);
}

.btn--link:hover {
    background: var(--success-hover);
}

#result-link {
    margin-left: auto;
}

#compare-btn {
    margin-left: auto;
    background: var(--success);
}

#compare-btn:hover {
    background: var(--success-hover);
}

@media (max-width: 720px) {
    .topbar { padding: 0 20px; }
    .dashboard-main { padding: 28px 20px 48px; }
    .uploads { grid-template-columns: 1fr; }
}

