/* Adapted from theme_wilde_kastanje/static/src/scss/{primary_variables,theme}.scss:
   WK screen palette, Poppins, 0.75rem radius, button shadow and blue focus ring.
   No Bootstrap/Odoo selectors or runtime dependency are carried into this service. */
@font-face { font-family: Poppins; src: url('/static/fonts/Poppins-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Poppins; src: url('/static/fonts/Poppins-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: Poppins; src: url('/static/fonts/Poppins-SemiBold.ttf') format('truetype'); font-weight: 600 800; font-display: swap; }

:root {
  --wk-coral: #f16760;
  --wk-black: #101011;
  --wk-blue: #518ecb;
  --wk-light-blue: #bfd6ff;
  --wk-light-red: #e7b7b7;
  --wk-light-gold: #f2d8a6;
  --wk-stone: #ededed;
  --wk-white: #fff;
  --wk-radius: .75rem;
  --muted: #626268;
  --line: #e2e2e4;
  --error: #9a2421;
  --error-bg: #fdf0ef;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--wk-black);
  background: var(--wk-white);
  font: 15px/1.6 Poppins, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: .2rem solid var(--wk-blue); outline-offset: .15rem; border-radius: .25rem; }
input:focus-visible, textarea:focus-visible { outline: 0; }

/* Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.25rem; border: 1px solid var(--line); border-radius: var(--wk-radius);
  background: var(--wk-white); font-weight: 600; letter-spacing: .01em; line-height: 1.5;
  text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #9a9aa0; }
.btn.primary {
  background: var(--wk-coral); border-color: var(--wk-coral); color: var(--wk-black);
  box-shadow: 0 .3rem 0 rgba(16, 16, 17, .16);
}
.btn.primary:hover:not(:disabled) { transform: translateY(.1rem); box-shadow: 0 .2rem 0 rgba(16, 16, 17, .2); }
.btn.small { padding: .35rem .8rem; font-size: 13px; }
.link-button { border: 0; padding: 0; background: none; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--wk-black); }
.remove {
  width: 2rem; height: 2rem; flex-shrink: 0; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 20px; line-height: 1;
}
.remove:hover { background: var(--wk-stone); color: var(--wk-black); }

label { display: block; font-size: 13px; font-weight: 500; margin-bottom: .3rem; }
input, textarea {
  width: 100%; padding: .6rem .8rem; border: 1px solid #cfcfd3; border-radius: .5rem; background: var(--wk-white);
}
input:focus, textarea:focus { border-color: var(--wk-blue); box-shadow: 0 0 0 .2rem rgba(81, 142, 203, .25); }
textarea { resize: vertical; min-height: 2.8rem; }
#f-trainers { field-sizing: content; resize: none; }
.hint { font-size: 13px; color: var(--muted); margin-top: .3rem; }
.error { color: var(--error); font-size: 14px; }
.muted { color: var(--muted); }

/* WK framing, after the colour language of the old certificate site:
   light-blue blob behind the logo, one coral sun and coral waves. Decorative only. */
.framed { position: relative; isolation: isolate; overflow-x: clip; }
.blob { position: absolute; z-index: -1; top: 0; left: 0; width: clamp(170px, 26vw, 400px); height: auto; fill: var(--wk-light-blue); pointer-events: none; }
.sun { position: absolute; z-index: -1; width: 76px; height: 76px; border-radius: 50%; background: var(--wk-coral); top: 150px; right: max(2rem, calc(50vw - 450px - 150px)); }
.wave { display: block; width: 100%; height: 90px; fill: var(--wk-coral); }
@media (max-width: 1199px) { #app .sun { display: none; } }
@media (max-width: 600px) { .login .sun { display: none; } }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1.5rem 9rem; background: var(--wk-white); }
.login .blob { width: clamp(220px, 40vw, 620px); }
.login .sun { top: 18vh; right: 9vw; width: 84px; height: 84px; }
.login .wave.bottom { position: absolute; z-index: -1; left: 0; bottom: 0; height: 150px; }
.summit { display: none; position: absolute; z-index: -1; right: 3vw; bottom: 105px; width: min(48vw, 680px); height: auto; pointer-events: none; }
@media (min-width: 960px) {
  .login { justify-items: start; padding-left: max(1.5rem, calc(50vw - 450px + 1.5rem)); }
  .summit { display: block; }
}
.login-card {
  width: 100%; max-width: 360px; background: var(--wk-white); border-radius: var(--wk-radius);
  padding: 2.5rem 2rem 2rem; box-shadow: 0 1.5rem 3rem rgba(16, 16, 17, .1);
}
.login-logo { height: 42px; display: block; margin-bottom: 1.75rem; }
.login h1 { font-size: 28px; margin-bottom: 1.5rem; }
.login .btn { width: 100%; margin-top: 1rem; }
.login .error { margin-top: .75rem; min-height: 1.5em; }

/* Page frame */
.header-inner, .wrap { max-width: 900px; margin: 0 auto; padding-inline: 1.5rem; }
.header-inner { display: flex; align-items: center; gap: 1rem; height: 80px; }
.brand { display: flex; align-items: center; gap: .9rem; font-weight: 600; font-size: 17px; margin-right: auto; }
.brand img { height: 30px; }
.brand span { padding-left: .9rem; border-left: 1px solid rgba(16, 16, 17, .2); line-height: 30px; }
.local-tag { font-size: 12px; color: var(--wk-black); background: var(--wk-light-gold); padding: .2rem .65rem; border-radius: 1rem; }
.user { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { padding-top: 2rem; }
.wrap > section + section { margin-top: 3rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { font-size: 20px; }
.section-head h2::after { content: ''; display: block; width: 2rem; height: 3px; margin-top: .4rem; border-radius: 2px; background: var(--wk-coral); }
.section-head p { font-size: 14px; color: var(--muted); }

/* New certificates */
.card { border: 1px solid var(--line); border-radius: var(--wk-radius); padding: 1.75rem; background: var(--wk-white); }
.step + .step { margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.step-title { display: flex; align-items: center; gap: .6rem; font-size: 15px; margin-bottom: 1rem; }
.step-title b {
  width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--wk-coral); color: var(--wk-black);
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 600;
}
.upload { display: flex; gap: .75rem; align-items: stretch; flex-wrap: wrap; }
.drop {
  flex: 1 1 280px; margin: 0; display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem;
  border: 1.5px dashed #c4c4c9; border-radius: var(--wk-radius); cursor: pointer; font-size: 14px; color: var(--muted);
}
.drop:hover, .drop.over { border-color: var(--wk-blue); background: #f2f7ff; color: var(--wk-black); }
.drop.done { border-style: solid; border-color: var(--line); color: var(--wk-black); }
.drop strong { font-weight: 600; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid .wide { grid-column: span 2; }
.grid .full { grid-column: 1 / -1; }
details { margin-top: 1rem; }
summary { cursor: pointer; font-size: 14px; font-weight: 500; width: max-content; }
details[open] summary { margin-bottom: 1rem; }
details .grid { gap: .75rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.75rem; }
.actions .spacer { flex: 1; }

/* Draft review */
.summary-line { display: flex; align-items: flex-start; gap: 1rem; justify-content: space-between; }
.summary-line h3 { font-size: 18px; }
.summary-line p { font-size: 14px; color: var(--muted); margin-top: .15rem; }
.summary-line .links { display: flex; gap: 1rem; flex-shrink: 0; padding-top: .2rem; }
.counts { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: 14px; margin-top: 1.25rem; }
.counts span { white-space: nowrap; }
.counts span::before { content: ''; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .45rem; background: var(--wk-blue); }
.counts .attention::before { background: var(--wk-coral); }
.issues { margin-top: 1rem; display: grid; gap: .5rem; }
.issue { background: var(--error-bg); border-radius: .6rem; padding: .75rem .9rem; }
.issue p { font-size: 13px; color: var(--error); margin-bottom: .5rem; }
.issue form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.issue input { flex: 1 1 180px; padding: .4rem .65rem; }
.people { margin-top: 1.25rem; border: 1px solid var(--line); border-radius: .6rem; overflow: hidden; }
.people-list { max-height: 340px; overflow-y: auto; }
.person { display: flex; align-items: center; gap: .75rem; padding: .3rem .4rem .3rem .9rem; border-bottom: 1px solid var(--line); font-size: 14px; min-height: 2.75rem; }
.person:last-child { border-bottom: 0; }
.person .name { flex: 1 1 40%; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.person .email { flex: 1 1 50%; min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.person.has-issue .name::after { content: ' · controleren'; color: var(--error); font-weight: 400; }
.add-person { display: flex; gap: .5rem; padding: .75rem; background: #fafafa; border-top: 1px solid var(--line); flex-wrap: wrap; }
.add-person input { flex: 1 1 180px; padding: .45rem .7rem; }
.people-empty { padding: 1rem .9rem; font-size: 14px; color: var(--muted); }
.trial-status { font-size: 13px; color: var(--muted); }
.trial-status.bad { color: var(--error); }

/* Guide: what goes where on the certificate */
.guide { margin: 3.5rem 0; }
.guide .wave { height: 70px; margin-bottom: -1px; }
.guide .wave.bottom { transform: scaleY(-1); margin: -1px 0 0; }
.guide-band { background: var(--wk-coral); color: var(--wk-black); padding-block: .5rem 1rem; }
.guide-inner { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 3rem; align-items: start; }
.guide-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.guide-head h2 { font-size: 20px; }
.guide .link-button { color: var(--wk-black); }
.guide-list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .8rem; font-size: 14px; }
.guide-list li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .75rem; }
.guide-list strong { display: block; font-weight: 600; font-size: 15px; }
.pin { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--wk-black); color: var(--wk-white); display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; font-style: normal; }
.guide-note { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid rgba(16, 16, 17, .25); font-size: 14px; }
.guide-cert { position: relative; margin: .25rem 0 0; border: 6px solid var(--wk-white); border-radius: .35rem; box-shadow: 0 1rem 2rem rgba(16, 16, 17, .2); background: var(--wk-white); }
.guide-cert img { display: block; width: 100%; height: auto; }
.guide-cert .pin { position: absolute; width: 1.15rem; height: 1.15rem; font-size: 10px; transform: translate(-15%, -50%); }
.guide.collapsed .guide-band { padding-block: 0 .25rem; }
.guide.collapsed .guide-inner { grid-template-columns: 1fr; }

/* Footer */
.footer { margin-top: 5rem; }
.footer .wave { height: 110px; margin-bottom: -1px; }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; background: var(--wk-coral);
  padding: .5rem max(1.5rem, calc(50vw - 450px + 1.5rem)) 2.25rem; font-size: 14px; font-weight: 500;
}

/* Busy, failed and sent */
.empty { padding: 1.25rem 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.job { padding: 1rem 0; border-top: 1px solid var(--line); }
.job-line { display: flex; justify-content: space-between; gap: 1rem; font-size: 14px; }
.job-line strong { font-size: 15px; }
.bar { height: 6px; border-radius: 3px; background: var(--wk-stone); margin-top: .6rem; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--wk-coral); border-radius: 3px; transition: width .4s ease; }
.notice { background: var(--error-bg); color: var(--error); padding: .75rem 1rem; border-radius: .6rem; font-size: 14px; margin-bottom: 1rem; }
.fail-group { border-top: 1px solid var(--line); padding: 1rem 0; }
.fail-group-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.fail-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.6fr); gap: 1rem; font-size: 14px; padding: .35rem 0; }
.fail-row > *, .recipient > *, .who > * { min-width: 0; overflow-wrap: anywhere; }
.fail-row .why { color: var(--error); }
.fail-row .resolve { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .35rem; }
.sent-toggle.static { cursor: default; }
.sent-toggle.static:hover { background: none; }
.sent-list { border-bottom: 1px solid var(--line); }
.sent-row { border-top: 1px solid var(--line); }
.sent-toggle {
  width: 100%; display: flex; align-items: center; gap: 1rem; padding: 1rem .25rem; border: 0; background: none; text-align: left;
}
.sent-toggle:hover { background: #fafafa; }
.sent-toggle .title { flex: 1; min-width: 0; }
.sent-toggle strong { display: block; font-weight: 600; }
.sent-toggle small { font-size: 13px; color: var(--muted); }
.sent-toggle .tally { font-size: 14px; white-space: nowrap; }
.sent-toggle .tally.partial { color: var(--error); }
.sent-toggle .chevron { width: .55rem; height: .55rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 .4rem .2rem; transition: transform .15s; }
.sent-toggle[aria-expanded="true"] .chevron { transform: rotate(-135deg); margin-bottom: -.2rem; }
.recipients { padding: 0 .25rem 1rem; }
.recipient { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 9.5rem 2.5rem; gap: 1rem; align-items: baseline; font-size: 14px; padding: .4rem 0; border-top: 1px solid var(--wk-stone); }
.recipient .who { display: contents; }
.recipient .email { color: var(--muted); }
.recipient small { display: block; color: var(--muted); font-size: 12px; }
.status::before { content: ''; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .45rem; background: var(--wk-blue); }
.status.bad { color: var(--error); }
.status.bad::before { background: var(--wk-coral); }
.status.skip { color: var(--muted); }
.status.skip::before { background: #c4c4c9; }
.status.wait::before { background: var(--wk-light-gold); }

/* Dialog and toast */
dialog { border: 0; border-radius: var(--wk-radius); padding: 0; width: min(560px, calc(100vw - 2rem)); box-shadow: 0 2rem 4rem rgba(16, 16, 17, .25); }
dialog.wide { width: min(720px, calc(100vw - 2rem)); }
dialog::backdrop { background: rgba(16, 16, 17, .45); }
.dialog-body { padding: 1.75rem; }
.dialog-body h2 { font-size: 20px; margin-bottom: 1rem; }
.dialog-body ul { margin: 0 0 1rem; padding-left: 1.1rem; }
.dialog-body li + li { margin-top: .35rem; }
.dialog-body .actions { justify-content: flex-end; margin-top: 1.5rem; }
.mail-meta { font-size: 13px; color: var(--muted); margin-bottom: .75rem; }
.mail-meta strong { color: var(--wk-black); font-weight: 500; }
.mail-frame { width: 100%; height: 380px; border: 1px solid var(--line); border-radius: .6rem; }
#toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); max-width: calc(100vw - 2rem);
  background: var(--wk-black); color: var(--wk-white); padding: .7rem 1.1rem; border-radius: .6rem; font-size: 14px; z-index: 20;
}
#toast.bad { background: var(--error); }

@media (max-width: 680px) {
  .header-inner { height: 64px; }
  .local-tag { display: none; }
  .guide { margin: 2.5rem 0; }
  .guide .wave { height: 40px; }
  .guide-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .guide-cert { width: min(220px, 70%); justify-self: center; }
  .footer .wave { height: 60px; }
  .user { display: none; }
  main { padding-top: 1.75rem; }
  .card { padding: 1.25rem; }
  .grid { grid-template-columns: 1fr 1fr; }
  .grid .wide { grid-column: 1 / -1; }
  .section-head { flex-direction: column; gap: .15rem; }
  .summary-line { flex-direction: column; gap: .5rem; }
  .person { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .5rem; padding-block: .45rem; }
  .person .name, .person .email { grid-column: 1; }
  .person .remove { grid-column: 2; grid-row: 1 / span 2; }
  .actions .spacer { display: none; }
  .actions .btn.primary { width: 100%; }
  .fail-row { grid-template-columns: 1fr; gap: 0; padding: .5rem 0; }
  .recipient { grid-template-columns: minmax(0, 1fr) auto; gap: 0 1rem; align-items: start; }
  .recipient .who { display: block; grid-row: 1 / span 2; }
  .recipient .who > * { display: block; }
  .recipient .status { max-width: 10rem; }
  .recipient .pdf { grid-column: 2; justify-self: end; }
  .recipient .pdf:empty { display: none; }
}
