/* Secure File Transfer — same visual language as the Client Portal:
   grey page, serif masthead with a double accent rule, silver form cards. */
:root { --accent: #1d3a5f; --ink: #21262d; --muted: #6a7280; --line: #d9dde3; --bg: #808080; --card: #ffffff; --err: #b3261e; }
* { box-sizing: border-box; margin: 0; }
body { font: 15px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 0 16px 48px; }
a { color: var(--accent); }

.masthead { width: 100%; max-width: 680px; text-align: center; padding: 40px 0 22px; border-bottom: 3px double var(--accent); margin-bottom: 24px; }
.masthead img { max-height: 72px; max-width: 100%; margin-bottom: 10px; }
.masthead h1 { font: normal 1.7rem system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: .04em; }
.masthead p { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .22em; color: #ffffff; margin-top: 8px; }

main { width: 100%; max-width: 680px; }
body.wide main, body.wide .topnav { max-width: 1080px; }

.topnav { width: 100%; display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 16px; margin-bottom: 20px; font-size: .9rem; }
.topnav a { color: var(--accent); text-decoration: none; font-weight: 600; padding: 2px 0; border-bottom: 2px solid transparent; }
.topnav a.on { border-bottom-color: var(--accent); }
.topnav .who { margin-left: auto; color: var(--muted); }
form.inline { display: inline; }
.linkbtn { background: none; border: 0; padding: 0; margin-left: 10px; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 24px; box-shadow: 0 1px 3px rgba(20,25,35,.07); margin-bottom: 20px; }
.card.silver { background: #C0C0C0; padding: 34px 34px 28px; }
.card h2 { font: normal 1.25rem system-ui, -apple-system, 'Segoe UI', sans-serif; margin-bottom: 14px; }
.card h3 { font-size: 1rem; margin: 0 0 10px; }
h1.page { font: normal 1.4rem system-ui, -apple-system, 'Segoe UI', sans-serif; color: #fff; margin-bottom: 14px; }
.sub { color: var(--muted); font-size: .85rem; }
.center { text-align: center; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.field { margin-bottom: 18px; }
label { display: block; font-size: .82rem; font-weight: 600; letter-spacing: .02em; margin-bottom: 6px; }
label .req { color: var(--err); }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
label.check input { margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px; background: #fdfdfd;
}
input[type=color] { width: 64px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[readonly] { background: #eef0f3; }
textarea { resize: vertical; min-height: 90px; }
.hint { color: var(--muted); font-size: .82rem; margin-top: 5px; }
.card.silver .hint { color: #3c434d; }
.mono { font-family: Consolas, Menlo, monospace; letter-spacing: .04em; }
.pwrow { display: flex; gap: 8px; }
.pwrow input { flex: 1; }

.btn, button.primary { display: inline-block; padding: 11px 22px; font: 600 .95rem system-ui, sans-serif; color: #fff; background: var(--accent); border: 0; border-radius: 4px; cursor: pointer; letter-spacing: .02em; text-decoration: none; }
.btn.block, button.primary.block { width: 100%; padding: 13px; font-size: 1rem; }
.btn:disabled, button:disabled { opacity: .55; cursor: default; }
button.subtle, a.subtle { display: inline-block; background: #fff; color: var(--accent); border: 1px solid var(--accent); padding: 5px 12px; font: 600 .8rem system-ui, sans-serif; border-radius: 4px; cursor: pointer; text-decoration: none; }
button.danger { background: #fff; color: var(--err); border: 1px solid var(--err); padding: 5px 12px; font: 600 .8rem system-ui, sans-serif; border-radius: 4px; cursor: pointer; }
button.danger:hover { background: var(--err); color: #fff; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.msg { margin-bottom: 16px; padding: 10px 14px; border-radius: 4px; font-size: .9rem; }
.msg.ok { background: #e2f2e5; color: #1d6b2c; border: 1px solid #bfe0c6; }
.msg.err { background: #fdeceb; color: var(--err); border: 1px solid #f0c9c6; }
.msg.info { background: #fdf8e3; color: #5c5310; border: 1px solid #e8dfa8; }

.tablewrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); font-size: .87rem; }
table.list th, table.list td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #e7eaee; vertical-align: top; }
table.list th { background: #eef0f3; font-weight: 600; white-space: nowrap; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; }
table.list td.chk, table.list th.chk { width: 34px; }
table.list .path { overflow-wrap: anywhere; }
table.list tr.folder td { background: #f6f7f9; font-weight: 600; }
.formrow td { background: #fafbfc; }
.hidden { display: none !important; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: .75rem; font-weight: 600; }
.pill.ok { background: #e2f2e5; color: #1d6b2c; } .pill.warn { background: #fdf3d7; color: #8a6d0b; }
.pill.err { background: #fdeceb; color: var(--err); } .pill.mute { background: #eceef1; color: #5a626e; }

dl.meta { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: .92rem; }
dl.meta dt { font-weight: 600; color: #3c434d; }
dl.meta dd { overflow-wrap: anywhere; }
@media (max-width: 560px) { dl.meta { grid-template-columns: 1fr; } }

/* uploader */
.filebox { border: 3px dashed var(--line); border-radius: 4px; padding: 20px; text-align: center; cursor: pointer; transition: border-color .15s; background: #ffffff; }
.filebox:hover, .filebox.drag { border-color: var(--accent); }
.filebox input { display: none; }
.filebox .folderlink { font-size: .85rem; margin-top: 6px; }
#filelist { list-style: none; padding: 0; margin-top: 10px; font-size: .88rem; max-height: 320px; overflow-y: auto; }
#filelist li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; margin-top: 6px; background: #fafbfc; }
#filelist .nm { overflow-wrap: anywhere; }
#filelist .sz { color: var(--muted); white-space: nowrap; }
#filelist .rm { border: 0; background: none; color: var(--err); cursor: pointer; font-weight: 700; padding: 0 2px; }
#filelist li.u-done { border-color: #9fd3a8; background: #f0f9f1; }
#filelist li.u-fail { border-color: #e5a5a0; background: #fdf1f0; }
#filelist li.u-now  { border-color: var(--accent); }
.totals { font-size: .85rem; margin-top: 8px; color: #3c434d; }
.progress { display: none; height: 8px; background: var(--line); border-radius: 4px; margin-top: 14px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progtext { display: none; font-size: .85rem; margin-top: 6px; text-align: center; color: #21262d; }
.error { display: none; color: var(--err); font-size: .9rem; margin-top: 12px; padding: 10px 12px; background: #fdf1f0; border: 1px solid #f0c9c6; border-radius: 4px; }

/* modal */
.overlay { display: none; position: fixed; inset: 0; background: rgba(15,20,30,.55); align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.overlay.show { display: flex; }
.modal { background: #fff; max-width: 480px; width: 100%; border-radius: 8px; padding: 32px 30px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal .check { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1.7rem; line-height: 54px; margin: 0 auto 16px; }
.modal h2 { font: normal 1.25rem system-ui, -apple-system, 'Segoe UI', sans-serif; margin-bottom: 12px; }
.modal p { font-size: .93rem; color: #3c434d; }
.modal .who { margin: 14px 0; padding: 12px; background: #f2f3f5; border-radius: 4px; font-size: 1rem; color: var(--ink); overflow-wrap: anywhere; }
.modal .btns { margin-top: 22px; display: flex; gap: 10px; justify-content: center; }

/* message / error / confirmation popups (built by ui.js) sit above the other modals */
.overlay.msgbox { z-index: 60; }
.modal .check.err { background: var(--err); font-weight: 700; }
.modal .check.info, .modal .check.confirm { background: #8a6d0b; font-weight: 700; }
.modal ul { text-align: left; font-size: .93rem; color: #3c434d; padding-left: 20px; }
.modal ul li { margin-top: 6px; }
.modal p { overflow-wrap: anywhere; }
/* standing guidance that is part of the page (not a message) stays inline */
.advice { margin-bottom: 16px; padding: 10px 14px; border-radius: 4px; font-size: .9rem; background: #fdf8e3; color: #5c5310; border: 1px solid #e8dfa8; }

.sitefoot { width: 100%; max-width: 680px; margin-top: 12px; text-align: center; font-size: .8rem; color: #f2f3f5; line-height: 1.6; }
.sitefoot a { color: #fff; }
.sitefoot .note { color: #dfe2e6; margin-top: 4px; }

@media (max-width: 480px) {
  body { padding: 0 10px 32px; }
  .masthead { padding: 26px 0 18px; margin-bottom: 18px; }
  .card.silver { padding: 22px 16px 20px; }
  .card { padding: 16px; }
}

.captcha { display: flex; justify-content: center; min-height: 65px; }
