/* File Tools — styles, for the tools page and the sign-in page.
   System fonts only: nothing is loaded from outside. */

:root {
  --navy: #002b3d;
  --blue: #007eb5;
  --green: #a7d643;
  --magenta: #c520a5;
  --ink: #212121;
  --muted: #55626a;
  --line: #d0d5d2;
  --bg: #f4f4f4;
  --card: #ffffff;
  --ok: #4d7a0f;
  --error-bg: #fde7ea;
  --error-ink: #8a1020;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--navy); }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: .92em; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
header { background: var(--navy); color: #fff; padding: 32px 0 30px; border-bottom: 6px solid var(--green); }
header .top-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
header .brand { margin: 0 0 18px; color: var(--green); font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
header .top-row .brand { margin: 0; }
header .sign-out { color: #fff; font-size: .9rem; padding: 6px 14px; border: 1px solid rgba(255,255,255,.5); border-radius: 50px; text-decoration: none; }
header .sign-out:hover, header .sign-out:focus-visible { background: #fff; color: var(--navy); outline: none; }
header h1 { margin: 0 0 6px; font-size: 2.2rem; font-weight: 500; letter-spacing: -0.02em; }
header h1 a { color: #fff; text-decoration: none; }
header p { margin: 0; color: #c9d6dc; max-width: 60ch; }
header .promise { margin-top: 10px; color: #fff; font-weight: 600; }

main.wrap { padding-top: 24px; padding-bottom: 32px; }

/* ---------- Error box (fail loudly) ---------- */
.error {
  background: var(--error-bg);
  color: var(--error-ink);
  border: 1px solid #f3b7c0;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
}
.error h2 { margin: 0 0 6px; font-size: 1.05rem; }

/* ---------- The list of tools ---------- */
.hub-title { font-size: 1.3rem; font-weight: 600; color: var(--navy); margin: 30px 0 12px; }
.hub-title:first-child { margin-top: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tile {
  display: flex; gap: 16px; align-items: flex-start; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px; text-decoration: none; color: inherit;
}
.tile:hover, .tile:focus-visible { border-color: var(--blue); box-shadow: 0 6px 18px rgba(0,43,61,.12); outline: none; }
.tile .icon {
  flex: none; width: 48px; height: 48px; border-radius: 12px; color: #fff; font-size: .95rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.icon.blue { background: var(--blue); }
.icon.green { background: var(--ok); }
.icon.navy { background: var(--navy); }
.icon.magenta { background: var(--magenta); }
.tile h3 { margin: 0 0 4px; font-size: 1.1rem; color: var(--navy); }
.tile p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- A tool ---------- */
.back {
  display: inline-block; margin-bottom: 14px; padding: 8px 18px; border-radius: 50px;
  background: var(--navy); color: #fff; text-decoration: none; font-size: .92rem;
}
.back:hover { background: var(--blue); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2 { margin: 0 0 4px; color: var(--navy); font-weight: 500; font-size: 1.8rem; letter-spacing: -0.02em; }
.panel h2:focus { outline: none; }
.panel .summary { margin: 0 0 16px; color: var(--muted); }
.hint { margin: 10px 0 0; font-size: .92rem; color: var(--muted); }

/* The box you click or drop files on. The real file input sits inside the
   label, hidden from sight but still reachable by keyboard. */
.drop {
  display: block; padding: 28px 16px; text-align: center; color: var(--muted);
  background: var(--bg); border: 2px dashed #9aa4aa; border-radius: var(--radius); cursor: pointer;
}
.drop strong { color: var(--navy); text-decoration: underline; }
.drop:hover, .drop.over { border-color: var(--blue); background: #e3f1f8; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }

/* The files that have been chosen. */
.files { list-style: none; padding: 0; margin: 12px 0 0; }
/* Rows wrap, so on a narrow screen the buttons drop under a long file name. */
.files li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0; padding: 8px 10px;
  background: #e3f1f8; border: 1px solid #9ccbe2; border-left: 5px solid var(--blue); border-radius: 8px;
}
.files .num { font-weight: 600; color: var(--navy); min-width: 1.5em; }
.files .name { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.files .detail { flex: none; font-size: .88rem; color: var(--muted); }
.files .actions { flex: none; display: flex; gap: 6px; }
.files button {
  font: inherit; font-size: .9rem; padding: 4px 10px; border-radius: 6px; cursor: pointer;
  background: #fff; border: 1px solid var(--muted); color: var(--ink);
}
.files button:hover:not(:disabled) { border-color: var(--blue); }
.files button:disabled { opacity: .4; cursor: default; }

/* Choices under the file list. */
.options { display: flex; flex-wrap: wrap; gap: 14px 20px; margin-top: 18px; }
.options label { display: block; font-weight: 600; font-size: .95rem; color: var(--navy); }
.options label.wide { flex: 1 1 320px; }
.options select, .options input[type="text"] {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px; font: inherit; font-weight: 400;
  color: var(--ink); background: #fff; border: 1px solid var(--muted); border-radius: 8px;
}
.options select:focus, .options input:focus { outline: 3px solid var(--blue); outline-offset: 1px; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-size: .95rem; padding: 10px 22px; border-radius: 50px; cursor: pointer;
  border: 2px solid var(--navy); background: #fff; color: var(--navy); text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--navy); color: #fff; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--blue); border-color: var(--blue); }
.btn:disabled { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }
.status { font-size: .92rem; color: var(--muted); }

/* ---------- What comes out ---------- */
.results { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.results h3 { margin: 0 0 10px; font-size: 1.1rem; font-weight: 600; color: var(--ok); }
.results ul { list-style: none; padding: 0; margin: 0; }
.results li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0; padding: 10px 12px;
  background: #f1f9e3; border: 1px solid #c5dd96; border-left: 5px solid var(--ok); border-radius: 8px;
}
.results .name { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.results .detail { font-size: .88rem; color: var(--muted); }
.results li .btn { padding: 6px 16px; font-size: .9rem; }
.results .all { margin-top: 12px; }

/* ---------- The sign-in page (/sign-in) ---------- */
.sign-in-page { min-height: 420px; }
.sign-in-page #sign-in { display: flex; justify-content: center; margin-top: 8px; }

/* ---------- Footer ---------- */
footer.wrap { padding-bottom: 40px; font-size: .92rem; color: var(--muted); }
footer p { margin: 0 0 8px; max-width: 75ch; }
footer .credits { font-size: .85rem; }
