:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-muted: #f0f4f8;
    --text: #172033;
    --muted: #667085;
    --line: #d8e0ea;
    --primary: #0f6b5f;
    --primary-dark: #0a4f46;
    --danger: #b42318;
    --success: #087443;
    --warning: #a15c07;
    --shadow: 0 18px 50px rgba(16, 24, 40, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button,
input,
textarea {
    font: inherit;
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.upload-shell {
    width: min(920px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: clamp(22px, 4vw, 40px);
}

.admin-shell {
    width: min(1120px, 100%);
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.admin-header {
    align-items: flex-start;
}

.brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #102a43;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.35rem;
}

.brand-name {
    margin: 0 0 2px;
    color: var(--primary);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 0;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    line-height: 1.12;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 4px;
    font-size: 1.05rem;
    letter-spacing: 0;
}

.upload-form,
.login-form {
    display: grid;
    gap: 20px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field-wide {
    grid-column: 1 / -1;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    color: #344054;
    font-size: 0.92rem;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    padding: 13px 14px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
    resize: vertical;
    min-height: 128px;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 107, 95, 0.14);
}

.drop-zone {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 168px;
    padding: 28px;
    border: 1.5px dashed #9fb3c8;
    border-radius: 8px;
    background: var(--surface-muted);
    text-align: center;
    cursor: pointer;
}

.drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.drop-title {
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 800;
}

.drop-meta,
.form-footer p,
.deposit-main p,
.deposit-meta span,
.zip-unavailable {
    color: var(--muted);
}

.file-list,
.admin-file-list {
    display: grid;
    gap: 8px;
}

.file-row,
.admin-file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.file-row span,
.admin-file-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.file-row strong,
.admin-file-row strong {
    white-space: nowrap;
    color: #344054;
    font-size: 0.9rem;
}

.file-total {
    color: var(--primary-dark);
    font-weight: 800;
    text-align: right;
}

.progress-wrap {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e4eaf2;
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 160ms ease;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.form-footer p {
    margin: 0;
    font-size: 0.92rem;
}

button,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 11px 18px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

button:hover,
.button-secondary:hover {
    background: var(--primary-dark);
}

button:active,
.button-secondary:active {
    transform: translateY(1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.button-secondary {
    background: #ffffff;
    color: var(--text);
    border-color: var(--line);
}

.button-secondary:hover {
    background: #f7f9fc;
}

.alert {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px 14px;
    background: #f8fafc;
    color: var(--text);
    overflow-wrap: anywhere;
}

.alert-error {
    border-color: #f4b3ad;
    background: #fff4f2;
    color: var(--danger);
}

.alert-success {
    border-color: #99d6b9;
    background: #f0fff7;
    color: var(--success);
}

.alert-warning {
    border-color: #f8d18b;
    background: #fff8eb;
    color: var(--warning);
}

.is-hidden {
    display: none;
}

.admin-page {
    align-items: flex-start;
}

.logout-form {
    margin-left: auto;
}

.login-form {
    max-width: 440px;
}

.admin-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.admin-summary div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #f8fafc;
}

.admin-summary span {
    display: block;
    margin-bottom: 4px;
    font-size: 1.4rem;
    font-weight: 850;
}

.admin-summary p {
    margin-bottom: 0;
    color: var(--muted);
}

.deposit-list {
    display: grid;
    gap: 14px;
}

.deposit-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: #ffffff;
}

.deposit-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
}

.deposit-main p {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.deposit-meta {
    display: grid;
    gap: 4px;
    text-align: right;
}

.deposit-message {
    margin: 14px 0;
    padding: 12px;
    border-left: 3px solid var(--primary);
    background: #f8fafc;
    overflow-wrap: anywhere;
}

.admin-file-row {
    color: var(--text);
    text-decoration: none;
}

.admin-file-row:hover {
    border-color: var(--primary);
}

.deposit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 14px;
}

.empty-state {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 720px) {
    .page {
        align-items: stretch;
        padding: 0;
    }

    .upload-shell {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .brand-header,
    .admin-header,
    .form-footer,
    .deposit-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .logout-form {
        margin-left: 0;
    }

    .field-grid,
    .admin-summary,
    .deposit-main {
        grid-template-columns: 1fr;
    }

    .deposit-meta {
        text-align: left;
    }

    button,
    .button-secondary {
        width: 100%;
    }
}
