/* Tudo o que vinha com a cara do navegador (listas, caixas, bolinhas, réguas, ficheiros, avisos de campo), na família Consegui.
   Onde o navegador não deixa abrir a lista com o nosso desenho (iPhone, Firefox), o campo fechado é nosso e a lista é a do aparelho. */

/* ---------- lista de escolha ---------- */
select:is(.campo, :not(.campo)) { appearance: none; -webkit-appearance: none; font: 600 16px Inter, sans-serif; color: var(--tinta); cursor: pointer; padding-right: 58px; background: var(--superficie); border-radius: 10px; }
select:is(.campo, :not(.campo)) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M40 0H0a40 40 0 0 0 40 40z' fill='%23F4B400'/%3E%3Cpath d='M17 11l6 6 6-6' fill='none' stroke='%2313241C' stroke-width='3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0 top 0; background-size: 44px 44px; }
@supports (appearance: base-select) {
  select:is(.campo, :not(.campo)), ::picker(select) { appearance: base-select; }
  select:is(.campo, :not(.campo)) { background-image: none; position: relative; overflow: hidden; display: flex; align-items: center; min-height: 52px; text-align: left; }
  select::picker-icon { content: ""; position: absolute; top: 0; right: 0; width: 44px; height: 44px; border-radius: 0 0 0 100%; background: #F4B400 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M17 11l6 6 6-6' fill='none' stroke='%2313241C' stroke-width='3'/%3E%3C/svg%3E") 0 0 / 100%; transition: width .25s cubic-bezier(.65, 0, .2, 1), height .25s cubic-bezier(.65, 0, .2, 1), background-color .2s; }
  select:is(:hover, :focus-visible)::picker-icon { width: 50px; height: 50px; } select:open::picker-icon { width: 50px; height: 50px; background-color: #FF5A36; }
  select:open { border-color: #0E6B47; }
  select selectedcontent, select { white-space: nowrap; text-overflow: ellipsis; }
  ::picker(select) {
    margin: 6px 0; padding: 6px; border: 2px solid #0E6B47; border-radius: 8px 8px 28px 8px; background: var(--superficie); color: var(--tinta); box-shadow: 0 24px 44px -20px rgba(3, 30, 19, .55);
    max-height: min(380px, 60vh); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #0E6B47 transparent;
    opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .25s cubic-bezier(.2, .7, .2, 1), overlay .25s allow-discrete, display .25s allow-discrete;
  }
  ::picker(select):popover-open { opacity: 1; transform: none; }
  @starting-style { ::picker(select):popover-open { opacity: 0; transform: translateY(-8px); } }
  select option { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: 6px; font: 500 16px/1.3 Inter, sans-serif; color: var(--tinta); cursor: pointer; white-space: normal; outline: none;
    background: linear-gradient(#0E6B47, #0E6B47) 0 0 / 0 100% no-repeat; transition: background-size .25s cubic-bezier(.65, 0, .2, 1), color .15s; }
  select option::checkmark { content: ""; display: block; visibility: visible; order: 2; margin-left: auto; width: 18px; height: 18px; border-radius: 100% 0 0 0; background: #F4B400; opacity: 0; }
  select option:checked { font-weight: 700; background-color: var(--marca-clara); } select option:checked::checkmark { opacity: 1; }
  select option:is(:hover, :focus, :focus-visible) { background-size: 100% 100%; color: #fff; }
  select option[value=""] { color: var(--tinta-2); } select option[value=""]:is(:hover, :focus) { color: #fff; } select option[value=""]::checkmark { display: none; }
  select option:disabled { opacity: .45; }
}

/* ---------- sugestões enquanto se escreve (campos.js) ---------- */
.az-sug-em { position: relative; display: block; }
.az-sug { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; border: 2px solid #0E6B47; border-radius: 8px 8px 28px 8px; background: var(--superficie); box-shadow: 0 24px 44px -20px rgba(3, 30, 19, .55); max-height: 280px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #0E6B47 transparent; animation: az-abre .22s cubic-bezier(.2, .7, .2, 1); }
.az-sug li { padding: 10px 12px; border-radius: 6px; cursor: pointer; font-weight: 500; background: linear-gradient(#0E6B47, #0E6B47) 0 0 / 0 100% no-repeat; transition: background-size .25s cubic-bezier(.65, 0, .2, 1), color .15s; }
.az-sug li:is(:hover, .on) { background-size: 100% 100%; color: #fff; }
@keyframes az-abre { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- caixas e bolinhas ---------- */
input:is([type="checkbox"], [type="radio"]) { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 2px solid var(--tinta-2); background: var(--superficie); display: inline-grid; place-items: center; vertical-align: -6px; cursor: pointer; transition: background .2s, border-color .2s, border-radius .25s; }
input[type="checkbox"] { border-radius: 5px; } input[type="radio"] { border-radius: 50%; }
input:is([type="checkbox"], [type="radio"])::before { content: ""; transform: scale(0); transition: transform .25s cubic-bezier(.65, 0, .2, 1); }
input[type="checkbox"]::before { width: 12px; height: 6px; margin-top: -4px; border: solid #fff; border-width: 0 0 3px 3px; rotate: -45deg; }
input[type="radio"]::before { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
input:is([type="checkbox"], [type="radio"]):checked { background: #0E6B47; border-color: #0E6B47; } input[type="checkbox"]:checked { border-radius: 5px 5px 12px 5px; }
input:is([type="checkbox"], [type="radio"]):checked::before { transform: scale(1); }
@media (hover: hover) { input:is([type="checkbox"], [type="radio"]):hover { border-color: #0E6B47; } }
@media (prefers-color-scheme: dark) { input:is([type="checkbox"], [type="radio"]):checked { background: #1F9366; border-color: #1F9366; } }
/* ligar e desligar (Sons) */
.sons-linha input { width: 52px !important; height: 30px !important; border-radius: 6px !important; justify-items: start; padding: 0 3px; }
.sons-linha input::before { width: 20px; height: 20px; margin: 0; border: 0; rotate: none; border-radius: 100% 4px 4px 4px; background: var(--tinta-2); transform: none; transition: transform .25s cubic-bezier(.65, 0, .2, 1), background .2s, border-radius .25s; }
.sons-linha input:checked::before { transform: translateX(20px); background: #F4B400; border-radius: 4px 4px 100% 4px; }
/* a bolinha dentro de uma escolha: a escolha inteira é o botão */
label.chip { position: relative; } label.chip input { position: absolute; opacity: 0; } label.chip:has(input:checked) { background: linear-gradient(#0E6B47, #0E6B47) 0 0 / 100% 100% no-repeat var(--superficie); border-color: #0E6B47; color: #fff; } label.chip:has(input:focus-visible) { outline: 3px solid #F4B400; outline-offset: 2px; }

/* ---------- régua do tempo ---------- */
input[type="range"] { appearance: none; -webkit-appearance: none; background: none; height: 32px; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 10px; border-radius: 3px; background: linear-gradient(#F4B400, #F4B400) 0 0 / var(--p, 50%) 100% no-repeat var(--linha); }
input[type="range"]::-moz-range-track { height: 10px; border-radius: 3px; background: var(--linha); } input[type="range"]::-moz-range-progress { height: 10px; border-radius: 3px; background: #F4B400; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 6px 6px 18px 6px; background: #0E6B47; border: 3px solid var(--superficie); box-shadow: 0 0 0 2px #0E6B47; }
input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 6px 6px 18px 6px; background: #0E6B47; border: 3px solid var(--superficie); }

/* ---------- números, procura e ficheiros ---------- */
input[type="number"] { appearance: textfield; -moz-appearance: textfield; } input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 4px; cursor: pointer; background: #0E6B47 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5.500 5.500l7 7m0-7l-7 7' stroke='%23fff' stroke-width='2.200'/%3E%3C/svg%3E"); }
input[type="file"].campo { padding: 8px; color: var(--tinta-2); border-style: dashed; cursor: pointer; }
input[type="file"]::file-selector-button { font: 700 15px Inter, sans-serif; padding: 11px 18px; margin-right: 14px; border: 0; border-radius: 6px 6px 18px 6px; background: #0E6B47; color: #fff; cursor: pointer; }
@media (hover: hover) { input[type="file"]:hover::file-selector-button { background: #F4B400; color: #13241C; } }
textarea.campo { resize: vertical; min-height: 96px; } ::placeholder { color: var(--tinta-2); opacity: .75; }
::selection { background: #F4B400; color: #13241C; }

/* ---------- o que falta num campo (no lugar do balão do navegador) ---------- */
.az-falta { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font: 600 14px/1.35 Inter, sans-serif; color: var(--erro); animation: az-abre .2s; } .az-falta::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 0 0 0 100%; background: #FF5A36; }
.az-mau, .campo.az-mau { border-color: #FF5A36 !important; }

/* ---------- abrir e fechar ---------- */
details summary { list-style: none; } details summary::-webkit-details-marker { display: none; }
details:not(.q-apoio):not(.convite-det) > summary::after { content: "+"; flex: none; align-self: center; margin-left: auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px 6px 16px 6px; background: #0E6B47; color: #fff; font: 700 20px/1 Inter, sans-serif; transition: background .2s, color .2s; }
details:not(.q-apoio):not(.convite-det)[open] > summary::after { content: "–"; background: #F4B400; color: #13241C; }
.seo-faq summary, .resumo-texto summary { display: flex; gap: 12px; justify-content: space-between; }

/* ---------- barra de deslocar ---------- */
html { scrollbar-color: #0E6B47 var(--bg); }
@media (prefers-color-scheme: dark) { html { scrollbar-color: #2E6B50 var(--bg); } }

@media (prefers-reduced-motion: reduce) { select option, ::picker(select), .az-sug, .az-falta, input::before, details summary::after { transition: none !important; animation: none !important; } }
.cartao-entrar .campo + .az-falta { margin: -8px 0 14px; }

/* ---------- as escolhas com vida (vivo.js): a tinta nasce no dedo, o amarelo desliza ---------- */
.chip, .sim-onb-chip, .chip-sel span, .est-chip { position: relative; isolation: isolate; overflow: hidden; background: var(--superficie); transition: color .2s, border-color .2s, transform .2s; }
.chip.on, label.chip:has(input:checked), .chip[aria-pressed="true"], .sim-onb-chip[aria-pressed="true"], .chip-sel input:checked + span, .est-chip.on { background: var(--superficie); border-color: #0E6B47; color: #fff; }
:is(.chip.on, label.chip:has(input:checked), .chip[aria-pressed="true"], .sim-onb-chip[aria-pressed="true"], .chip-sel input:checked + span, .est-chip.on)::before { content: ""; position: absolute; inset: -2px; z-index: -1; background: #0E6B47; }
:is(.chip, .sim-onb-chip, .est-chip):active, .chip-sel:active span { transform: scale(.985); }
/* os mesmos movimentos da página do Consegui: a tinta que pinta e o azulejo que vira, com a mesma curva e sem saltos */
.az-novo::before, .az-novo span::before { animation: az-tinta .45s cubic-bezier(.5, 0, .2, 1) both; }
@keyframes az-tinta { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
:is(.chip.on, label.chip:has(input:checked), .chip[aria-pressed="true"], .sim-onb-chip[aria-pressed="true"], .chip-sel input:checked + span, .est-chip.on)::after { content: ""; position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; border-radius: 0 0 0 100%; background: #F4B400; }
.az-novo::after, .az-novo span::after { animation: az-vira .7s cubic-bezier(.7, 0, .2, 1) both; }
@keyframes az-vira { from { transform: rotate(-90deg); opacity: 0; } 35% { opacity: 1; } to { transform: none; } }
/* a lista que o toque trouxe: só a célula do ícone se pinta */
.az-icones > * > :is(img, svg, i.sig, .chip-ico, .ano-ico):first-child { animation: az-tinta .42s cubic-bezier(.4, 0, .2, 1) both; animation-delay: calc(var(--n, 0) * .018s); }
/* o amarelo do separador é uma peça à parte, para poder deslizar */
:is(.abas, .sim-tabs, .vid-abas, .h-abas, .est-abas) > * { position: relative; isolation: isolate; }
:is(.abas, .sim-tabs, .vid-abas, .h-abas, .est-abas) > :is(.on, [aria-selected="true"]) { z-index: 1; background: var(--superficie) !important; }
:is(.abas, .sim-tabs, .vid-abas, .h-abas, .est-abas) > :is(.on, [aria-selected="true"])::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #F4B400; border-radius: 6px 6px 22px 6px; transform-origin: 0 0; }
:is(.abas, .sim-tabs, .vid-abas, .h-abas, .est-abas) > *:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .chip, .chip *, .chip::before, .az-novo > * { animation: none !important; transition: none !important; } }
.chip.on, .sim-onb-chip[aria-pressed="true"], .est-chip.on { transition: color .2s .12s, border-color .2s, transform .18s; }

/* ---------- a folha de escolha (escolha.js): de baixo no telemóvel, ao meio no computador ---------- */
.ec { position: fixed; inset: 0; z-index: 9990; display: flex; align-items: flex-end; justify-content: center; background: rgba(8, 22, 16, .62); animation: ec-fundo .2s both; }
@keyframes ec-fundo { from { opacity: 0; } }
.ec-caixa { width: 100%; max-height: 82vh; display: flex; flex-direction: column; background: var(--superficie); color: var(--tinta); border-radius: 10px 44px 0 0; overflow: hidden; animation: ec-sobe .34s cubic-bezier(.2, .9, .2, 1) both; padding-bottom: env(safe-area-inset-bottom); }
@keyframes ec-sobe { from { transform: translateY(100%); } }
.ec-cab { position: relative; display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; } .ec-cab::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, #0E6B47 0 25%, #F4B400 25% 50%, #FF5A36 50% 75%, #1D5FA8 75%); }
.ec-cab b { flex: 1; font: 800 22px/1.15 var(--titulos); letter-spacing: -.03em; }
.ec-x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 6px 6px 16px 6px; background: var(--marca-clara, var(--marcaC)); color: var(--tinta); font: 400 26px/1 Inter, sans-serif; cursor: pointer; } .ec-x:active { background: #F4B400; color: #13241C; }
.ec-procura { width: auto; margin: 0 16px 10px; }
.ec-lista { overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 16px; display: grid; gap: 6px; scrollbar-width: thin; scrollbar-color: #0E6B47 transparent; }
.ec-op { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 56px 0 16px; border: 2px solid var(--linha); border-radius: 8px; background: var(--superficie); color: var(--tinta); font: 600 16px/1.25 Inter, sans-serif; text-align: left; cursor: pointer; }
.ec-op[hidden] { display: none !important; } .ec-op:active { transform: scale(.98); }
@media (hover: hover) { .ec-op:hover { border-color: #0E6B47; } }
.ec-op img { flex: none; align-self: stretch; width: 52px; height: 52px; margin: -1px 0 -1px -16px; padding: 7px; object-fit: contain; background: #fff; border-radius: 0 0 18px 0; filter: none; }
.ec-op span { min-width: 0; padding: 8px 0; }
/* o azulejo do canto diz qual é a escolhida */
.ec-op::after { content: ""; position: absolute; right: 0; top: 0; width: 0; height: 0; border-radius: 0 0 0 100%; background: #F4B400; transition: width .3s cubic-bezier(.65, 0, .2, 1), height .3s cubic-bezier(.65, 0, .2, 1); }
.ec-op.on { border-color: #0E6B47; color: #fff; } .ec-op.on::before { content: ""; position: absolute; inset: -2px; z-index: -1; background: #0E6B47; } .ec-op.on::after { width: 38px; height: 38px; }
.ec-nova::before { animation: az-tinta .34s cubic-bezier(.65, 0, .25, 1) both; }
.ec.sai { opacity: 0; transition: opacity .22s; } .ec.sai .ec-caixa { transform: translateY(40%); transition: transform .22s ease-in; }
@media (min-width: 761px) { .ec { align-items: center; padding: 24px; } .ec-caixa { width: 440px; border-radius: 10px 10px 44px 10px; } }
@media (prefers-reduced-motion: reduce) { .ec, .ec * { animation: none !important; transition: none !important; } }
/* ficheiros */
.az-fich { position: relative; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 14px 8px 8px; margin: 6px 0 0; border: 2px dashed var(--linha); border-radius: 10px; background: var(--superficie); } .az-fich.tem { border-style: solid; border-color: #0E6B47; }
.az-fich > b { flex: none; padding: 11px 18px; border-radius: 6px 6px 18px 6px; background: #0E6B47; color: #fff; font: 700 15px Inter, sans-serif; } .az-fich > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinta-2, var(--tinta2)); font-size: 15px; font-weight: 400; } .az-fich.tem > span { color: var(--tinta); font-weight: 600; }
.az-fich input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; padding: 0; } .az-fich:focus-within { outline: 3px solid #F4B400; outline-offset: 2px; }
.parati-c, .hoje-atalhos a.at-c, .hero-honra { animation: none !important; } /* nada entra a mexer-se */

/* As barras de progresso pintam-se da esquerda para a direita ao aparecer, com a mesma tinta do separador amarelo (igual à app).
   Só nas que mostram um valor (domínio, nota prevista, resultados, resumos); as que andam em directo (prova, quiz) ficam quietas. */
:is(.est-barra, .dom-barra, .meta-barra, .trilha-barra, .rc-barra, .barra-linha .barra) > i { animation: az-tinta .7s cubic-bezier(.5, 0, .2, 1) .08s both; }
@media (prefers-reduced-motion: reduce) { :is(.est-barra, .dom-barra, .meta-barra, .trilha-barra, .rc-barra, .barra-linha .barra) > i { animation: none !important; } }
