:root {
    color-scheme: light;
    --page-bg: #f3f5f7;
    --card-bg: rgba(255, 255, 255, 0.96);
    --text: #18202a;
    --muted: #687484;
    --line: #dfe5eb;
    --line-strong: #c8d0d9;
    --accent: #9b1c31;
    --accent-dark: #7d1426;
    --accent-soft: #fbecf0;
    --success: #177447;
    --success-bg: #eaf8f1;
    --error: #a12828;
    --error-bg: #fff0f0;
    --shadow: 0 24px 70px rgba(29, 42, 55, 0.12);
    --radius-large: 26px;
    --radius-medium: 16px;
    --radius-small: 11px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page-bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(155, 28, 49, 0.11), transparent 30rem),
        radial-gradient(circle at bottom right, rgba(24, 32, 42, 0.07), transparent 28rem),
        var(--page-bg);
}

button,
input {
    font: inherit;
}

button,
a,
.drop-zone {
    -webkit-tap-highlight-color: transparent;
}

.page-shell {
    width: min(100% - 32px, 760px);
    margin: 0 auto;
    padding: clamp(28px, 7vw, 72px) 0 30px;
}

.upload-card {
    padding: clamp(24px, 5vw, 46px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-large);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.card-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: start;
    margin-bottom: 30px;
}

.brand-mark,
.upload-icon {
    display: grid;
    place-items: center;
    color: var(--accent);
    background: var(--accent-soft);
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 16px;
}

.brand-mark svg,
.upload-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-mark svg {
    width: 28px;
    height: 28px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 9px;
    font-size: clamp(1.75rem, 5vw, 2.45rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

h2 {
    margin-bottom: 8px;
    font-size: clamp(1.15rem, 3.4vw, 1.4rem);
    letter-spacing: -0.018em;
}

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

.subtitle {
    max-width: 560px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.55;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -8px 0 20px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--success);
    font-size: 0.9rem;
    font-weight: 700;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 5px rgba(23, 116, 71, 0.12);
}

.login-panel {
    padding: clamp(20px, 5vw, 30px);
    border: 1px solid var(--line);
    border-radius: var(--radius-medium);
    background: #fbfcfd;
}

.field-group label {
    display: block;
    margin-bottom: 9px;
    font-size: 0.91rem;
    font-weight: 750;
}

.password-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

input[type="password"] {
    width: 100%;
    min-height: 50px;
    padding: 0 15px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-small);
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(155, 28, 49, 0.12);
}

.drop-zone {
    min-height: 270px;
    padding: 34px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius-medium);
    background: linear-gradient(180deg, #ffffff, #fafbfc);
    cursor: pointer;
    outline: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(155, 28, 49, 0.06), 0 14px 34px rgba(155, 28, 49, 0.1);
    transform: translateY(-2px);
}

.drop-zone p {
    margin-bottom: 15px;
    color: var(--muted);
    line-height: 1.5;
}

.upload-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 19px;
    border-radius: 22px;
}

.upload-icon svg {
    width: 34px;
    height: 34px;
}

.file-rule {
    display: inline-flex;
    padding: 7px 11px;
    border-radius: 999px;
    color: var(--muted);
    background: #eef1f4;
    font-size: 0.8rem;
    font-weight: 700;
}

.selected-file,
.current-file {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: #fff;
}

.file-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    color: #fff;
    background: var(--accent);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.file-details,
.current-file > div {
    min-width: 0;
    display: grid;
    gap: 4px;
    flex: 1;
}

.file-details strong,
.current-file strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-details span,
.current-file span {
    color: var(--muted);
    font-size: 0.86rem;
}

.icon-button,
.text-button {
    border: 0;
    cursor: pointer;
}

.icon-button {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 10px;
    color: var(--muted);
    background: #eef1f4;
    font-size: 1.45rem;
    line-height: 1;
}

.icon-button:hover {
    color: var(--text);
    background: #e3e8ed;
}

.text-button {
    padding: 8px 2px;
    color: var(--muted);
    background: transparent;
    font-weight: 700;
}

.text-button:hover {
    color: var(--accent);
}

.primary-button,
.secondary-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-small);
    font-weight: 800;
    text-decoration: none;
    transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.primary-button {
    padding: 0 20px;
    border: 0;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 10px 22px rgba(155, 28, 49, 0.2);
    cursor: pointer;
}

.primary-button:hover:not(:disabled) {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.primary-button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    box-shadow: none;
}

.upload-button {
    width: 100%;
    margin-top: 16px;
}

.secondary-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    color: var(--text);
    background: #fff;
    font-size: 0.88rem;
}

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

.progress-wrap {
    margin-top: 18px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.progress-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9edf1;
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 120ms linear;
}

.message {
    margin-top: 16px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    font-size: 0.91rem;
    font-weight: 650;
    line-height: 1.45;
}

.message-success {
    color: var(--success);
    border-color: #bde4ce;
    background: var(--success-bg);
}

.message-error {
    color: var(--error);
    border-color: #f0c3c3;
    background: var(--error-bg);
}

.login-panel .message {
    margin-bottom: 0;
}

.current-file {
    margin-top: 26px;
    background: #fafbfc;
}

.current-file .eyebrow {
    margin-bottom: 0;
    font-size: 0.67rem;
}

.footer-note {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 0.78rem;
}

[hidden] {
    display: none !important;
}

@media (max-width: 600px) {
    .page-shell {
        width: min(100% - 20px, 760px);
        padding-top: 18px;
    }

    .upload-card {
        padding: 22px 17px;
        border-radius: 20px;
    }

    .card-header {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 24px;
    }

    .brand-mark {
        width: 48px;
        height: 48px;
    }

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

    .password-row .primary-button {
        width: 100%;
    }

    .drop-zone {
        min-height: 245px;
        padding: 28px 16px;
    }

    .current-file {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .current-file .secondary-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
