/* The recipient's page for Secure send. Plain CSS, no framework, no web
   fonts: the page's Content-Security-Policy allows nothing from elsewhere.
   Colours follow the console (mbox-frontend/src/theme/theme.js). Contrast,
   light: text #1A2027 on #FDFDFD 16.1:1, muted #4A5565 on #FDFDFD 7.5:1,
   accent #0F68B3 5.65:1, white on #0F68B3 5.75:1. Dark: text #F9FAFB on
   #161D27 16.0:1, muted #A6B0BF 7.6:1, accent #3A9DEE 5.84:1, ink #0A1929
   on #3A9DEE 6.11:1. */
:root {
  --page: #f0f0f0; --card: #fdfdfd; --text: #1a2027; --muted: #4a5565;
  --line: rgba(26, 32, 39, 0.16); --line-soft: rgba(26, 32, 39, 0.09);
  --accent: #0f68b3; --accent-hover: #0a4576; --on-accent: #ffffff;
  --hover: rgba(26, 32, 39, 0.05); --error: #c70011; --edge: rgba(26, 32, 39, 0.5);
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #03060f; --card: #161d27; --text: #f9fafb; --muted: #a6b0bf;
    --line: rgba(249, 250, 251, 0.16); --line-soft: rgba(249, 250, 251, 0.09);
    --accent: #3a9dee; --accent-hover: #1d8eec; --on-accent: #0a1929;
    --hover: rgba(249, 250, 251, 0.06); --error: #ff505f; --edge: rgba(249, 250, 251, 0.4);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--page); color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 592px; margin: 0 auto; padding: 32px 16px 24px; }
@media (min-width: 700px) { .wrap { padding-top: 64px; } }

.brand { margin-bottom: 28px; min-height: 30px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand img { display: block; }
.brand-logo { max-height: 48px; max-width: 240px; width: auto; height: auto; }
.brand-name { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.1px; overflow-wrap: anywhere; }
.brand-name.beside-logo { font-size: 15px; font-weight: 500; letter-spacing: 0; min-width: 0; }

.eyebrow { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
h1 { margin: 4px 0 0; font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -0.2px; overflow-wrap: anywhere; }
h1:focus { outline: none; }
.muted { color: var(--muted); }

.panel { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.pad { padding: 24px; }
.state p { margin: 0; }
.lead { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.lead label { font: inherit; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.state .muted { font-size: 13px; overflow-wrap: anywhere; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; }
button { font: inherit; cursor: pointer; border-radius: 8px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button[disabled] { cursor: default; opacity: 0.55; }
.primary { min-height: 40px; padding: 0 16px; border: 0; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; transition: background-color 120ms ease-out; }
.primary:hover:not([disabled]) { background: var(--accent-hover); }
.link { min-height: 40px; padding: 0 8px; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 600; }
.link:hover:not([disabled]) { background: var(--hover); }

.code {
  display: block; width: 184px; max-width: 100%; margin-top: 16px; padding: 9px 12px;
  border: 1px solid var(--edge); border-radius: 8px; background: transparent; color: var(--text);
  font: inherit; font-size: 18px; letter-spacing: 0.3em; font-variant-numeric: tabular-nums;
}
.code::placeholder { color: var(--muted); opacity: 0.55; }
.field-label { display: block; margin-top: 16px; font-size: 13px; font-weight: 600; }
.address {
  display: block; width: 320px; max-width: 100%; margin-top: 6px; padding: 9px 12px;
  border: 1px solid var(--edge); border-radius: 8px; background: transparent; color: var(--text);
  font: inherit; font-size: 15px;
}

.message { white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 16px; padding: 10px 24px; border-top: 1px solid var(--line-soft); }
.files li:first-child { border-top: 0; }
.message:not([hidden]) ~ .files li:first-child { border-top: 1px solid var(--line-soft); }
.files-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 16px 6px 24px; font-size: 12px; }
.files-head:not([hidden]) + .files li:first-child { border-top: 1px solid var(--line-soft); }
.message:not([hidden]) + .files-head { border-top: 1px solid var(--line-soft); }
.file-name { flex: 1; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.file-size { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.file-lock { position: relative; flex: none; display: inline-flex; border-radius: 4px; color: var(--muted); }
.file-lock .icon { width: 16px; height: 16px; }
.file-lock:hover, .file-lock:focus-visible { color: var(--text); }
.file-lock:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-lock::after { content: attr(data-tip); position: absolute; top: 50%; right: calc(100% + 8px); transform: translateY(-50%); width: max-content; max-width: min(240px, 60vw); padding: 6px 10px; border-radius: 6px; background: var(--text); color: var(--page); font-size: 12px; line-height: 1.35; opacity: 0; visibility: hidden; transition: opacity 120ms ease-out, visibility 120ms; pointer-events: none; z-index: 2; }
.file-lock:hover::after, .file-lock:focus-visible::after { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .file-lock::after { transition: none; } }
.files .link { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.files .icon { width: 16px; height: 16px; stroke: currentColor; }
.foot { padding: 12px 24px; border-top: 1px solid var(--line-soft); font-size: 12px !important; }
@media (max-width: 420px) {
  .files li { flex-wrap: wrap; gap: 4px 12px; }
  .file-name { flex-basis: 100%; }
  .files .link { margin-left: auto; }
  .file-lock::after { right: auto; left: calc(100% + 8px); }
}

.notice { margin: 0; padding: 12px 24px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.notice.error { color: var(--error); }

.help { margin: 16px 0 0; font-size: 12px; }
.help + .help { margin-top: 6px; }
.link.inline { min-height: 0; padding: 0; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.link.inline:hover:not([disabled]) { background: none; }
.powered { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line-soft); text-align: center; }
.powered p { margin: 0; font-size: 12px; }
.powered .links { display: flex; justify-content: center; gap: 8px; color: var(--muted); }
.powered a { font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.powered a:hover { text-decoration: underline; }

/* The delivery notice under the title. */
.facts { margin: 16px 0 0; display: grid; gap: 4px; font-size: 13px; }
.facts > div { display: flex; gap: 12px; }
.facts dt { flex: none; width: 104px; color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts .sub { color: var(--muted); }
@media (max-width: 420px) { .facts > div { flex-direction: column; gap: 0; } .facts > div + div { margin-top: 6px; } .facts dt { width: auto; font-size: 12px; } }

.secure { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0 0; font-size: 12px; line-height: 1.5; }
.secure .icon { width: 16px; height: 16px; margin-top: 1px; }

.steps { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.steps li + li { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
