/* AI usage assessment portal. One stylesheet, no framework.

   The look is the mock-up's (mockup/index.html, report/*.html). The
   brand colours are approximations of the Hapag-Lloyd ones and still
   to be confirmed against the brand guide; they are only defined here,
   so swapping them is a change to these two lines. */

:root {
  --brand-orange: #EC6608;   /* confirm */
  --brand-navy: #0A1E3C;     /* confirm */
  --page: #F5F6F7;
  --surface: #FFFFFF;
  --ink: #1A1A1A;
  --muted: #6B7280;
  --hairline: #E3E6EA;
  --good: #0A6B45;
  --bad: #b42318;
  --warn: #8a5a00;
  --font: system-ui, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--page);
}

main { max-width: 66rem; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }
main.wide { max-width: 84rem; }

h1 { font-size: 1.4rem; margin: 0.25rem 0; color: var(--brand-navy); }
h2 { font-size: 1rem; margin: 0 0 0.75rem; color: var(--brand-navy); }
a { color: #1d5fa8; }
code { font-size: 0.9em; }

.sub { color: var(--muted); margin: 0 0 1rem; font-size: 0.9rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.row.spread { justify-content: space-between; align-items: flex-end; }
.row .grow { flex: 1 1 12rem; }

/* Header and the ribbon */
header.app {
  background: var(--brand-navy);
  color: #fff;
  border-bottom: 3px solid var(--brand-orange);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 0.75rem;
  font-weight: 700; letter-spacing: 0.3px;
  color: #fff; text-decoration: none;
}
.mark {
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--brand-orange);
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff;
}
header.app .who {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.85rem; color: #c7d0dc;
}
header.app form { margin: 0; }

nav.ribbon {
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  padding: 0 1.5rem;
  display: flex; gap: 0.25rem;
}
nav.ribbon a {
  padding: 0.9rem 1.1rem;
  font-weight: 600; color: var(--muted); text-decoration: none;
  border-bottom: 3px solid transparent;
}
nav.ribbon a.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-orange);
}

/* Cards, pills, tags */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
}
.pill {
  font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 12px;
  background: #EEF2F6; color: #374151;
}
.tag {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  background: #EEF2F6; color: #374151;
}
.tag.dept { background: #FDF0E6; color: var(--brand-navy); }
.tag.win { background: #E7F6EF; color: var(--good); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--brand-orange); color: #fff;
  border: 1px solid var(--brand-orange); border-radius: 8px;
  padding: 0.6rem 1.15rem;
  font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.btn.ghost {
  background: #fff; color: var(--brand-navy);
  border-color: var(--hairline);
}
.btn.wide { width: 100%; margin-top: 1.25rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
button.link {
  border: 0; background: none; padding: 0;
  font: inherit; color: #1d5fa8; cursor: pointer;
}
button.link.light { color: #c7d0dc; }
button.link.danger, form.danger button { color: var(--bad); }
form.danger { margin-top: 1.5rem; }

/* Forms */
.fld { display: block; margin-bottom: 1.1rem; }
label.fld { margin: 0.9rem 0 0.3rem; font-weight: 600; font-size: 0.85rem; }
.fld .question {
  display: block; font-weight: 600; font-size: 0.9rem; color: #374151;
}
.fld .help { display: block; font-size: 0.8rem; color: var(--muted); }
.fld.critical .question::after {
  content: " ★"; color: var(--brand-orange);
}
.fld .error { display: block; color: var(--bad); font-size: 0.85rem;
              margin-top: 0.25rem; }
.fld.invalid input, .fld.invalid textarea { border-color: var(--bad); }
.req { color: var(--brand-orange); }

input:not([type=radio]):not([type=checkbox]), select, textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cfd5dc;
  border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff;
}
input.short { max-width: 12rem; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand-orange); outline-offset: 1px;
}

/* Choices as pills, as in the mock-up. The input stays in the label,
   visually hidden but reachable by keyboard. */
.radios { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.45rem;
          align-items: center; }
.radios label {
  position: relative;
  font-size: 0.85rem; font-weight: 500; color: #374151;
  border: 1px solid var(--hairline); border-radius: 20px;
  padding: 0.35rem 0.85rem; cursor: pointer; background: #fff;
}
.radios input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
}
.radios label:has(input:checked) {
  border-color: var(--brand-orange); background: #FDF0E6;
  color: var(--brand-navy); font-weight: 600;
}
.radios label:has(input:focus-visible) {
  outline: 2px solid var(--brand-orange); outline-offset: 1px;
}
.radios label.skip { color: var(--muted); border-style: dashed; }
.radios label.skip:has(input:checked) {
  background: #fff; border-color: #cfd5dc; color: var(--muted);
  font-weight: 500;
}
.radios .end { font-size: 0.8rem; color: var(--muted); }

/* The questionnaire with its section list beside it */
main.with-aside {
  max-width: 76rem;
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}
aside.sections { position: sticky; top: 1rem; font-size: 0.875rem; }
aside.sections ol { list-style: none; margin: 0; padding: 0; }
aside.sections li a {
  display: flex; justify-content: space-between; gap: 0.5rem;
  padding: 0.35rem 0.5rem; border-radius: 6px;
  color: var(--ink); text-decoration: none;
}
aside.sections li a:hover { background: #e9edf1; }
aside.sections .count { color: var(--muted); font-variant-numeric: tabular-nums; }
aside.sections .count.done { color: var(--good); font-weight: 600; }
.sticky-actions {
  position: sticky; bottom: 0;
  background: var(--page);
  padding: 0.75rem 0; border-top: 1px solid var(--hairline);
}
@media (max-width: 60rem) {
  main.with-aside { grid-template-columns: 1fr; }
  aside.sections { position: static; }
}

/* Tables */
table.list {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 10px;
}
table.list.plain { border: 0; }
table.list th, table.list td {
  text-align: left; padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--hairline); vertical-align: top;
}
table.list th { font-size: 0.8rem; color: var(--muted); }
table.list tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* Flashes and status */
.flashes { max-width: 66rem; margin: 0 auto; padding: 0 1.5rem; }
.flash {
  margin: 0.9rem 0 0; padding: 0.6rem 0.85rem;
  border-radius: 8px; border: 1px solid var(--hairline);
  background: var(--surface);
}
.flash.error { border-color: var(--bad); color: var(--bad); }
.flash.success { border-color: var(--good); color: var(--good); }
.status { font-weight: 600; }
.status.succeeded { color: var(--good); }
.status.failed { color: var(--bad); }
.status.running { color: var(--warn); }
.status.queued { color: var(--muted); }
pre#log {
  background: #11161c; color: #dfe6ee;
  padding: 0.9rem; border-radius: 8px;
  max-height: 30rem; overflow: auto;
  font-size: 0.83rem; white-space: pre-wrap; word-break: break-word;
}

/* Sign in */
.login-wrap { min-height: 70vh; display: grid; place-items: center; }
.card.login { width: min(24rem, 92vw); margin-top: 3rem; }
.login h1, .login .sub { text-align: center; }
.mark-lg {
  width: 54px; height: 54px; border-radius: 12px;
  background: var(--brand-orange); margin: 0 auto 0.9rem;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 22px;
}

/* Tracker */
.board {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem; align-items: start;
}
.col {
  background: #EEF1F4; border: 1px solid var(--hairline);
  border-radius: 10px; padding: 0.75rem;
  border-top: 3px solid #9aa5b1;
}
.col-open { border-top-color: #2a78d6; }
.col-in_progress { border-top-color: #eda100; }
.col-done { border-top-color: #1baf7a; }
.col h3 {
  font-size: 0.85rem; margin: 0 0 0.75rem; color: var(--brand-navy);
  display: flex; justify-content: space-between; align-items: center;
}
.col h3 .c {
  background: #fff; border-radius: 10px; padding: 1px 9px;
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.col .cards { min-height: 3rem; }
.col .add { font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.tcard {
  display: block; text-decoration: none;
  background: #fff; border: 1px solid var(--hairline); border-radius: 8px;
  padding: 0.7rem 0.75rem; margin-bottom: 0.6rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); cursor: grab;
}
.tcard:target { outline: 2px solid var(--brand-orange); }
.tcard.dragging { opacity: 0.45; }
.tcard .t { display: block; font-weight: 600; font-size: 0.85rem; color: var(--ink); }
.tcard .m { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.tcard .tags { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.45rem; }
@media (max-width: 60rem) { .board { grid-template-columns: 1fr 1fr; } }

/* Insights and the report */
.kpis {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem; margin: 1rem 0 1.25rem;
}
.kpi {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 0.9rem;
}
.kpi.accent { border-top: 3px solid var(--brand-orange); }
.kpi .n {
  font-size: 1.8rem; font-weight: 800; color: var(--brand-navy);
  font-variant-numeric: tabular-nums;
}
.kpi .l { font-size: 0.75rem; color: var(--muted); line-height: 1.3; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + section { margin-top: 1.25rem; }
figure.chartcard { margin: 0 0 1rem; }
.chartcard h3 { font-size: 0.9rem; color: var(--brand-navy); margin: 0 0 0.6rem; }
.cap { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }
.legend {
  display: flex; gap: 0.9rem; flex-wrap: wrap;
  font-size: 0.8rem; color: #374151; margin-top: 0.6rem;
}
.legend i {
  display: inline-block; width: 11px; height: 11px; border-radius: 3px;
  margin-right: 0.35rem; vertical-align: middle;
}
details.data { font-size: 0.8rem; margin-top: 0.4rem; }
details.data summary { cursor: pointer; color: var(--muted); }
details.data table { border-collapse: collapse; margin-top: 0.3rem; }
details.data td, details.data th { padding: 0.15rem 0.6rem 0.15rem 0; text-align: left; }
text { font-family: var(--font); }
@media (max-width: 60rem) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}

/* The report, a document of its own */
body.report { background: #EEF1F4; }
.doc { max-width: 900px; margin: 0 auto; padding-bottom: 3rem; }
.cover {
  background: var(--brand-navy); color: #fff;
  padding: 2.75rem 3rem; border-bottom: 5px solid var(--brand-orange);
}
.cover .mark { width: 46px; height: 46px; border-radius: 10px;
               font-size: 20px; margin-bottom: 1.4rem; }
.cover .kicker { font-size: 12px; letter-spacing: 2px;
                 text-transform: uppercase; color: #9fb0c6; }
.cover h1 { font-size: 30px; margin: 0.4rem 0 0.6rem; color: #fff; }
.cover .meta { font-size: 13px; color: #c7d0dc; }
.cover .conf {
  display: inline-block; margin-top: 1rem;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  border: 1px solid #33465f; border-radius: 4px; padding: 4px 10px;
  color: #c7d0dc;
}
.toolbar { display: flex; justify-content: space-between; align-items: center;
           padding: 0.75rem 0; }
.doc section {
  background: var(--surface); margin-top: 1.1rem;
  border: 1px solid var(--hairline); border-radius: 12px;
  padding: 1.6rem 1.9rem;
}
.doc section h2 {
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--brand-orange); margin: 0 0 0.25rem;
}
.doc .st { font-size: 20px; color: var(--brand-navy); font-weight: 700;
           margin: 0 0 1.1rem; }
.summary {
  background: #F8FAFC; border-left: 4px solid var(--brand-orange);
  border-radius: 6px; padding: 1rem 1.1rem; font-size: 14.5px;
}
.summary p { margin: 0 0 0.6rem; }
.summary p:last-child { margin: 0; }
ul.find { margin: 0; padding: 0; list-style: none; }
ul.find li { padding: 0.75rem 0; border-bottom: 1px solid var(--hairline);
             display: flex; gap: 0.75rem; }
ul.find li:last-child { border-bottom: 0; }
.tagn {
  flex: 0 0 auto; height: fit-content;
  font-size: 11px; font-weight: 800; color: #fff;
  background: var(--brand-navy); border-radius: 6px; padding: 3px 9px;
}
.tagn.warn { background: #eb6834; }
.tagn.good { background: var(--good); }
.doc table:not(details table) { width: 100%; border-collapse: collapse;
                                 font-size: 13px; margin-top: 0.5rem; }
.doc th, .doc td { text-align: left; padding: 0.45rem 0.6rem;
                   border-bottom: 1px solid var(--hairline); vertical-align: top; }
.doc th { color: var(--muted); font-size: 11px; text-transform: uppercase;
          letter-spacing: 0.5px; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.badge.m { background: #E7F6EF; color: var(--good); }
.badge.e { background: #FCF3DD; color: #8a6b00; }
.badge.a { background: #FDE7E7; color: #9b1c1c; }
.doc footer { color: var(--muted); font-size: 11.5px; text-align: center;
              padding: 1.6rem; }

@media print {
  body.report { background: #fff; }
  .toolbar, details.data { display: none; }
  .doc { max-width: none; }
  .doc section {
    break-inside: avoid; border: 0; border-top: 1px solid var(--hairline);
    border-radius: 0; margin: 0; padding: 1.4rem 0;
  }
  .cover { padding: 2rem; -webkit-print-color-adjust: exact;
           print-color-adjust: exact; }
  @page { margin: 14mm; }
}
