/* Oryon Portal: o mesmo aspeto do Oryon Mobile (m/app.css) e das apps: azul-aço só no botão principal, nas ligações e no
   que está em curso; o resto neutro. Claro e escuro pelo sistema; contraste alto e movimento reduzido respeitados. */
:root {
  --brand: #0369a1; --brand-press: #035c8e; --on-brand: #fff;
  --page: #f2f2f4; --surface: #fff; --fill: #ececef; --ink: #1d1d1f; --ink-2: #5b5b62; --line: #e3e3e8;
  --ok: #137a3b; --warn: #9a5b06; --err: #c42626; --none: #6b6b73; --err-bg: #fdeeee;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --serif: "Instrument Serif", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --r: 16px; color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #38a3d9; --brand-press: #5bb6e3; --on-brand: #0b1a24;
    --page: #0f0f10; --surface: #1c1c1e; --fill: #2a2a2d; --ink: #f5f5f7; --ink-2: #a1a1a8; --line: #2e2e31;
    --ok: #4ade80; --warn: #fbbf24; --err: #f87171; --none: #a1a1a8; --err-bg: #2c1717;
  }
}
@media (prefers-contrast: more) { :root { --ink-2: #3a3a40; --line: #b8b8c0; } }
@media (prefers-contrast: more) and (prefers-color-scheme: dark) { :root { --ink-2: #d0d0d6; --line: #5a5a60; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 1rem/1.5 var(--font); -webkit-font-smoothing: antialiased; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
b, dd, .num { font-variant-numeric: tabular-nums; }

/* ---- barra de cima: a figura, «ORYON» e a fábrica (como no telemóvel) */
header { background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { max-width: 1040px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 10px; align-items: center; }
.brand img { display: block; }
.word { font-weight: 600; font-size: .75rem; letter-spacing: .24em; text-transform: uppercase; }
.factory { color: var(--ink-2); font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 56px; }
h1 { font: 400 2rem/1.15 var(--serif); margin: 0 0 6px; letter-spacing: -.005em; overflow-wrap: anywhere; }
h2 { font-size: 1.25rem; font-weight: 650; line-height: 1.25; margin: 32px 4px 12px; display: flex; gap: 8px; align-items: baseline; }
h2 .muted { font-size: .9375rem; font-weight: 400; }
h3 { font-size: 1.0625rem; font-weight: 650; margin: 0; overflow-wrap: anywhere; }
h4 { font-size: .9375rem; font-weight: 600; margin: 16px 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.center { text-align: center; }
a { color: var(--brand); text-underline-offset: 2px; }

/* ---- caixas de entrar e de aviso */
.box { max-width: 420px; margin: 32px auto; background: var(--surface); border-radius: var(--r); padding: 28px 24px 24px; }
.box > p:last-child { margin-bottom: 0; }
form.box label { display: block; margin: 16px 0 0; font-size: .9375rem; font-weight: 500; }
input { display: block; width: 100%; min-height: 50px; margin-top: 6px; padding: 12px 14px; border: 1px solid transparent; border-radius: 12px;
  background: var(--fill); color: var(--ink); font: inherit; }
input:focus { border-color: var(--brand); background: var(--surface); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input:focus-visible { outline-offset: 0; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; min-height: 50px; padding: 12px 20px;
  border: 0; border-radius: 12px; background: var(--brand); color: var(--on-brand); font: inherit; font-weight: 600; cursor: pointer;
  transition: background-color .15s, transform .12s; }
button:hover { background: var(--brand-press); }
button:active { transform: scale(.98); }
button.ghost { margin: 0; min-height: 44px; padding: 8px 16px; background: var(--fill); color: var(--ink); font-weight: 500; }
button.ghost:hover { background: color-mix(in srgb, var(--fill) 85%, var(--ink)); }
form.box button { width: 100%; }
form.box button + p { margin-top: 16px; }
.err { display: flex; gap: 10px; align-items: flex-start; background: var(--err-bg); color: var(--err); font-weight: 600;
  border-radius: 12px; padding: 12px 14px; margin: 16px 0 0; }
.err .ic { margin-top: 3px; }

/* ---- as obras */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.top p { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.job { background: var(--surface); border-radius: var(--r); padding: 18px 18px 16px; display: flex; flex-direction: column; }
.job > p { margin: 4px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 600; white-space: nowrap; color: var(--none); }
.tag .ic { width: 16px; height: 16px; }
.s-em_curso { color: var(--brand); } .s-em_pausa { color: var(--warn); } .s-concluida { color: var(--ok); }
.s-concluida .ic { fill: currentColor; stroke: var(--surface); }
dl { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 16px 0 0; }
dt { font-size: .8125rem; color: var(--ink-2); }
dd { margin: 0; font-weight: 600; }
progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 6px; margin-top: 14px; border: 0; border-radius: 3px;
  overflow: hidden; background: var(--fill); color: var(--brand); }
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 3px; }
.done progress::-webkit-progress-value { background: var(--ok); } .done progress::-moz-progress-bar { background: var(--ok); }

/* documentos: uma linha por ficheiro, com o fio a separar (como as listas do telemóvel) */
.docs { list-style: none; margin: 0 -18px -16px; padding: 0; border-top: 1px solid var(--line); margin-top: 16px; }
.docs li { position: relative; }
.docs li + li::before { content: ''; position: absolute; top: 0; left: 48px; right: 0; border-top: 1px solid var(--line); }
.docs a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 18px; color: var(--ink); text-decoration: none; }
.docs a:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.docs li:last-child a { border-radius: 0 0 var(--r) var(--r); }
.docs .ic { color: var(--brand); }
.docs .name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.docs .kind { color: var(--ink-2); font-size: .875rem; white-space: nowrap; }
.wait { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .875rem; }

/* ---- o selo verificado (<fábrica>/selo): três números grandes, a explicação por baixo */
.seal { max-width: 760px; margin: 8px auto 0; }
.eyebrow { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--ok); font-size: .875rem; font-weight: 600; }
.eyebrow .ic { fill: currentColor; stroke: var(--surface); }
.stats { list-style: none; margin: 24px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.stats li { background: var(--surface); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 2px; }
.stats b { font: 400 2.75rem/1.05 var(--serif); letter-spacing: -.01em; }
.stats span { font-weight: 600; }
.stats small { color: var(--ink-2); font-size: .875rem; }
.seal .err { margin: 0 0 16px; }

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

/* ---- a identidade Oryon (05/11), a mesma das apps da fábrica ----
   - no claro, o papel ligeiramente quente do Oryon Quote, cartões com um fio fino e sombra macia em camadas;
   - por trás do título, a grelha milimétrica do papel técnico a desvanecer; por baixo do título, uma cota com o ponto
     da cor Oryon, que se desenha ao abrir;
   - os números do selo numa só faixa de linhas finas, com marcas de canto de desenho.
   Movimento (só CSS: esta página não corre programas): ao abrir, o conteúdo entra em cascata, as obras uma a uma, e as
   barras de progresso crescem até onde a obra vai. Com «reduzir movimento», nada se mexe. */
:root { --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 8px 24px -12px rgba(28, 25, 23, .10); --edge: #8a867e;
  --bp-minor: color-mix(in srgb, var(--ink) 3.5%, transparent); --bp-major: color-mix(in srgb, var(--ink) 7%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1); --spring: cubic-bezier(.34, 1.3, .64, 1); --ease-out: cubic-bezier(.23, 1, .32, 1); }
@media (prefers-color-scheme: light) { :root { --page: #f5f4f1; --fill: #edece8; --line: #e7e5e0; } }
@media (prefers-color-scheme: dark) { :root { --shadow: none; --edge: #75757d; } }
header { position: relative; z-index: 1; }
main { position: relative; isolation: isolate; }
main::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 260px; z-index: -1; pointer-events: none;
  background:
    linear-gradient(var(--bp-major) 1px, transparent 1px) 0 0 / 50px 50px,
    linear-gradient(90deg, var(--bp-major) 1px, transparent 1px) 0 0 / 50px 50px,
    linear-gradient(var(--bp-minor) 1px, transparent 1px) 0 0 / 10px 10px,
    linear-gradient(90deg, var(--bp-minor) 1px, transparent 1px) 0 0 / 10px 10px;
  -webkit-mask-image: radial-gradient(ellipse 55% 100% at 16% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 55% 100% at 16% 0%, #000 0%, transparent 75%); }
h1 { width: fit-content; max-width: 100%; }
h1::after { content: ""; display: block; height: 7px; margin-top: .45rem; opacity: .6; min-width: 3rem;
  background:
    linear-gradient(var(--edge), var(--edge)) 0 50% / 100% 1px no-repeat,
    linear-gradient(var(--edge), var(--edge)) 0 0 / 1px 100% no-repeat,
    linear-gradient(var(--edge), var(--edge)) 100% 0 / 1px 100% no-repeat,
    linear-gradient(var(--brand), var(--brand)) 50% 50% / 5px 5px no-repeat; }
.box, .job { border: 1px solid var(--line); box-shadow: var(--shadow); }
.stats { gap: 0; position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.stats li { border-radius: 0; background: transparent; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); padding: 24px; }
.stats::after { content: ""; position: absolute; inset: 6px; pointer-events: none; opacity: .55; --m: var(--edge);
  background:
    linear-gradient(var(--m), var(--m)) 0 0 / 9px 1px no-repeat, linear-gradient(var(--m), var(--m)) 0 0 / 1px 9px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 0 / 9px 1px no-repeat, linear-gradient(var(--m), var(--m)) 100% 0 / 1px 9px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 100% / 9px 1px no-repeat, linear-gradient(var(--m), var(--m)) 0 100% / 1px 9px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 9px 1px no-repeat, linear-gradient(var(--m), var(--m)) 100% 100% / 1px 9px no-repeat; }
.docs a { transition: background-color .15s ease-out; }
@media (prefers-reduced-motion: no-preference) {
  /* cada clique no Portal é uma página nova: o que entra é curto (tudo assente em ~0,6 s) e a figura do cabeçalho não roda a cada página */
  h1::after { transform-origin: 50% 50%; animation: o-dim .45s var(--ease) .06s both; }
  main > :nth-child(-n+4), .seal > :nth-child(-n+4) { animation: o-rise .3s var(--ease) both; }
  main > :nth-child(2), .seal > :nth-child(2) { animation-delay: 40ms; } main > :nth-child(3), .seal > :nth-child(3) { animation-delay: 80ms; }
  main > :nth-child(4), .seal > :nth-child(4) { animation-delay: 120ms; }
  :is(.grid > .job, .stats > li):nth-child(-n+8) { animation: o-fade .26s var(--ease) both; animation-delay: 60ms; }
  :is(.grid > .job, .stats > li):nth-child(2) { animation-delay: 85ms; } :is(.grid > .job, .stats > li):nth-child(3) { animation-delay: 110ms; }
  :is(.grid > .job, .stats > li):nth-child(4) { animation-delay: 135ms; } :is(.grid > .job, .stats > li):nth-child(n+5) { animation-delay: 160ms; }
  .job progress { transform-origin: 0 50%; animation: o-grow-x .5s var(--ease) .15s both; }
}
@keyframes o-rise { from { transform: translateY(6px); } }
@keyframes o-fade { from { opacity: .001; transform: translateY(6px); } }
@keyframes o-grow-x { from { transform: scaleX(0); } }
@keyframes o-dim { from { transform: scaleX(0); } }

/* ---- verificar um documento (oryon.pt/verificar, /v/<código>): o veredicto grande e a zona para largar o PDF */
.verify { max-width: 640px; margin: 8px auto 0; }
.lead { font-size: 1.0625rem; }
.verdict { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; padding: 16px 18px; border-radius: 12px; font-size: 1.0625rem; font-weight: 600; }
.verdict .ic { width: 22px; height: 22px; margin-top: 1px; }
.verdict.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.verdict.ok .ic { fill: currentColor; stroke: var(--surface); }
.verdict.no { color: var(--err); background: var(--err-bg); }
.verify dl { margin: 0 0 8px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 16px 0 12px; padding: 32px 20px;
  text-align: center; cursor: pointer; background: var(--surface); border: 1.5px dashed var(--edge, var(--line)); border-radius: var(--r);
  transition: border-color .15s ease-out, background-color .15s ease-out; }
.drop .ic { width: 28px; height: 28px; color: var(--brand); margin-bottom: 4px; }
.drop span { color: var(--ink-2); font-size: .9375rem; }
.drop:hover, .drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.drop:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
form.code { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 24px; }
form.code label { flex: 1 1 220px; font-size: .9375rem; font-weight: 500; }
form.code input { text-transform: uppercase; letter-spacing: .08em; }
form.code button { min-height: 50px; }
.verify h2 { margin-inline: 0; }

/* ---- oryon.pt/entrar: as outras entradas por baixo da caixa, e o rodapé de todas as páginas */
.ways { list-style: none; max-width: 420px; margin: 16px auto 0; padding: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.ways li + li { border-top: 1px solid var(--line); }
.ways a { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 18px; color: var(--ink); text-decoration: none;
  transition: background-color .15s ease-out; }
.ways a:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.ways a:focus-visible { outline-offset: -2px; }
.ways .ic:first-child { color: var(--brand); width: 22px; height: 22px; }
.ways .ic:last-child { color: var(--ink-2); }
.ways .name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ways small { color: var(--ink-2); font-size: .875rem; }
.box + .ways { margin-top: -16px; }
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; max-width: 1040px; margin: 0 auto; padding: 0 16px 32px; font-size: .875rem; }
.foot a { color: var(--ink-2); padding: 8px 0; }

.verify dl { margin-bottom: 20px; }

/* ---------- movimento v3 (14/11) ----------
   - de uma página do Portal para a outra (mesmo endereço): a página antiga desvanece em 120 ms e a nova assenta em 220 ms,
     com o cabeçalho parado no lugar. A cascada de entrada fica só para a 1.ª página (entrar pelo convite, pelo e-mail ou
     pela palavra-passe): ir e voltar entre obras já não repete a mesma animação. Navegadores sem isto ficam como estavam;
   - carregar num botão encolhe-o logo e ao largar volta devagar. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  body > header:first-of-type { view-transition-name: o-top; }
  ::view-transition-group(o-top) { animation-duration: 0s; }
  ::view-transition-old(root) { animation: o-vt-out .12s var(--ease-out) both; }
  ::view-transition-new(root) { animation: o-vt-in .22s var(--ease-out) both; }
  html:active-view-transition :is(main > *, .seal > *, .grid > .job, .stats > li, .job progress) { animation: none; }
  html:active-view-transition h1::after { animation: none; }
  button { transition: background-color .15s var(--ease-out), color .15s var(--ease-out), opacity .15s var(--ease-out), transform .2s var(--ease-out); }
  button:not(:disabled):active { transform: scale(.97); transition-duration: .06s; }
}
@keyframes o-vt-out { to { opacity: 0; } }
@keyframes o-vt-in { from { opacity: 0; transform: translateY(6px); } }
