:root {
    --brand: #1a3a5c;
    --brand-light: #2c5a8c;
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --border: #dde3e8;
    --text: #23303d;
    --muted: #6b7a89;
    --danger: #c0392b;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

.card {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: 0 2px 10px rgba(20, 30, 40, 0.06);
}

.brand-logo-index {
    height: 40px;
    width: auto;
    display: block;
    margin-bottom: 14px;
}

label {
    display: block;
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 16px;
}

input[type="text"],
input[type="password"],
input[type="file"],
input[type="number"],
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
    color: var(--text);
    background: #fff;
}

button {
    width: 100%;
    padding: 14px 16px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

button:hover { background: var(--brand-light); }
button:disabled { background: #e2e6ea; color: #9aa7b3; cursor: not-allowed; }

.error { color: var(--danger); font-size: 14px; }
.filename { font-weight: 600; word-break: break-all; }
.meta { color: var(--muted); font-size: 14px; }
.memo { background: var(--bg); border-radius: 6px; padding: 12px 14px; font-size: 14px; white-space: pre-wrap; }
.instruction { font-size: 15px; color: var(--muted); margin: 6px 0 18px; }

.dropzone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 26px 18px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover,
.dropzone.dragover {
    border-color: var(--brand);
    background: var(--bg);
}
.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    opacity: 0;
    cursor: pointer;
}
.dropzone-text {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    pointer-events: none;
}
.dropzone-hint {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    pointer-events: none;
}

.secure-card { max-width: 640px; }

.page-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 640px;
}
.brand-logo-standalone {
    height: 48px;
    width: auto;
    margin-bottom: 14px;
}
.brand-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 28px;
    text-align: center;
}
.brand-inline-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
}

.field-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 6px;
}
#dl-form input[type="password"] { margin-top: 0; }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
    margin-top: 10px;
    cursor: pointer;
}
.checkbox-row input { width: auto; margin: 0; }

.card-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    margin: 26px -36px -40px;
    padding: 18px 36px;
}
.card-footer button {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 22px;
}

.expiry-footnote {
    color: var(--muted);
    font-size: 13px;
    margin: 16px 0 0;
    text-align: center;
}

.result-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    margin-top: 16px;
    font-size: 14px;
}
.result-box .row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.result-box .row-top { align-items: flex-start; }
.result-box input { flex: 1; margin: 0; font-family: monospace; }
.result-box textarea { flex: 1; margin: 0; font-family: monospace; resize: vertical; }
.result-box button { width: auto; padding: 8px 12px; }

.secondary-btn {
    margin-top: 12px;
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--brand);
}
.secondary-btn:hover { background: var(--bg); }

.file-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    font-size: 13.5px;
    color: var(--muted);
    max-height: 140px;
    overflow-y: auto;
}
.file-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}
.file-list li span:first-child { word-break: break-all; }
.file-list li span:last-child { white-space: nowrap; }
.file-list .file-list-total { font-weight: 600; color: var(--text); border-bottom: none; }

.progress-outer {
    background: var(--border);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
    margin-top: 10px;
}
.progress-inner {
    background: var(--brand);
    height: 100%;
    width: 0%;
    transition: width .15s ease;
}

.page-wrap {
    width: 100%;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.top-bar a { color: var(--muted); font-size: 14px; text-decoration: none; }
