/* Visual inspirado em refs/MUDA.html (muda.co): branco, preto, azul elétrico, texto grande,
   serifa itálica para ênfase, muito respiro e a bolinha azul (bolinha.js).
   As fontes Etter do MUDA são pagas; aqui vão substitutas grátis do Google Fonts. */
:root {
  --fundo: #fff;
  --texto: #000;
  --g: #8a8a8a; /* cinza do MUDA (#999) um pouco mais escuro para texto grande ficar legível */
  --g-pequeno: #666; /* cinza para texto pequeno (contraste AA) */
  --linha: #e6e6e6;
  --azul: #2a04d1; /* a bolinha e os dias com vaga */
  --botao: #2f00ff;
  --botao-hover: #5404a0;
  --link: #00f;
  --falha: #d0340f;
  --progresso-fundo: #e9e5ff;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --respiro: 144px;
  --respiro-m: 48px;
  --respiro-p: 20px;
  --lado: 24px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.menu-aberto { overflow: hidden; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 400 20px/1.35 var(--sans);
  letter-spacing: -0.005em;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; transition: color 0.4s; }
a:hover { color: var(--texto); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
/* Campos mostram o foco no próprio sublinhado (o contorno ficava um retângulo em volta). */
select:focus-visible, input:focus-visible { outline: none; border-bottom-color: var(--link); box-shadow: 0 2px 0 var(--link); }
.menu input:focus-visible { border-bottom-color: #fff; box-shadow: 0 2px 0 #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pular { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--texto); color: var(--fundo); padding: 8px 12px; }
.pular:focus { top: 16px; }

/* Tipografia (txl / txm / txs do MUDA) */
.txl { font-size: 40px; line-height: 1.22; letter-spacing: -0.012em; margin: 0; font-weight: 400; }
.txm { font-size: 25px; line-height: 1.25; margin: 0; }
.txs { font-size: 16px; line-height: 1.4; margin: 0; }
.nb { white-space: nowrap; }
/* Campo-isca contra robôs: fora da tela, sem ser display:none (alguns robôs ignoram esse). */
.isca { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.i { font-family: var(--serif); font-style: italic; font-size: 1.06em; letter-spacing: 0.005em; }
.g { color: var(--g); }
.txs.g, .dica, .rotulo { color: var(--g-pequeno); }

/* Logo em pixel, centralizado, como o do MUDA */
.logo { display: flex; justify-content: center; padding: 18px var(--lado) 0; position: relative; z-index: 1; }
.logo a {
  font: 400 clamp(30px, 7.4vw, 66px)/1 var(--pixel); color: var(--texto);
  letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap;
}
.logo a:hover { color: var(--azul); }

main, .rodape-texto { max-width: 900px; margin: 0 auto; padding: 0 var(--lado); }
.abertura { padding-top: calc(var(--respiro) * 0.6); max-width: 760px; }
.abertura .txl { text-wrap: pretty; }

/* ---- Formulário ------------------------------------------------------------------------ */
.busca { display: grid; gap: 28px; padding-top: var(--respiro-m); }
.campo { display: grid; gap: 2px; min-width: 0; border: 0; padding: 0; margin: 0; }
.rotulo { font-size: 15px; padding: 0; }
select, input[type="number"], input[type="date"], input[type="email"] {
  width: 100%; min-height: 52px; padding: 6px 0; border: 0; border-bottom: 2px solid var(--texto);
  border-radius: 0; background: transparent; font-size: 25px;
}
select {
  appearance: none; padding-right: 32px; text-overflow: ellipsis;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10'%3E%3Cpath d='M1 1l7 7 7-7' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") right 4px center / 16px 10px no-repeat;
}
select:disabled { color: var(--g); }
input::placeholder { color: #bdbdbd; }
.trecho { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: end; }
.inverter {
  width: 52px; height: 52px; border: 2px solid var(--texto); border-radius: 50%;
  background: var(--fundo); cursor: pointer; font-size: 22px; transition: 0.4s;
}
.inverter:hover { background: var(--texto); color: var(--fundo); }
.linha { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: end; }
.passo { display: flex; align-items: center; gap: 6px; }
.passo button {
  width: 48px; height: 48px; border: 2px solid var(--texto); border-radius: 50%;
  background: var(--fundo); cursor: pointer; font-size: 24px; line-height: 1; transition: 0.4s;
}
.passo button:hover { background: var(--texto); color: var(--fundo); }
.passo input { width: 64px; text-align: center; border-bottom: 0; -moz-appearance: textfield; }
.passo input::-webkit-inner-spin-button, .passo input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Classe: opções como texto grande; a escolhida fica azul em itálico */
.classes { display: flex; flex-wrap: wrap; gap: 0 22px; }
.classes legend { width: 100%; margin-bottom: 4px; }
.classes label { position: relative; font-size: 25px; min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; color: var(--g); transition: color 0.3s; }
.classes label:hover { color: var(--texto); }
.classes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.classes label:has(input:checked) { color: var(--azul); font-family: var(--serif); font-style: italic; font-size: 27px; }
.classes label:has(input:focus-visible) { outline: 3px solid var(--link); outline-offset: 2px; }

/* Botões (como os do MUDA) */
.botao {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  padding: 17px 25px 20px; border: 0; border-radius: 4px; background: var(--botao);
  color: #fff; font-size: 24px; letter-spacing: 0.02em; text-decoration: none;
  cursor: pointer; transition: background 0.5s ease, color 0.5s ease;
}
.botao:hover { background: var(--botao-hover); color: #fff; }
.botao:disabled { opacity: 0.5; cursor: progress; }
.busca .botao { justify-self: start; min-width: 240px; }
.erro { margin: 0; color: var(--falha); }
.link { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font-size: inherit; transition: color 0.4s; }
.link:hover { color: var(--texto); }

/* Durante a busca o botão vira a barra de progresso; tocar de novo para a busca. */
.ver { position: relative; overflow: hidden; isolation: isolate; }
.ver.buscando { background: var(--progresso-fundo); color: var(--azul); }
.ver.buscando::before {
  content: ""; position: absolute; inset: 0; z-index: -1; width: var(--progresso, 0%);
  background: var(--azul); opacity: 0.2; transition: width 0.4s ease;
}

/* ---- Resultado ------------------------------------------------------------------------- */
.resultado { padding-top: var(--respiro); }
.resumo { display: grid; gap: 8px; }
.legenda { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; padding: 0; margin: var(--respiro-m) 0 6px; font-size: 15px; color: var(--g-pequeno); }
.legenda li { display: inline-flex; align-items: center; gap: 8px; }
.ponto { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.ponto.vaga { background: var(--azul); }
.ponto.sem { border: 1.5px solid var(--g); position: relative; overflow: hidden; }
.ponto.sem::after { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; border-top: 1.5px solid var(--g); transform: rotate(-45deg); }
.ponto.pendente { border: 1.5px dotted var(--g); }
.ponto.parado { background: #f0f0f0; }
.ponto.falha { background: repeating-linear-gradient(45deg, var(--falha) 0 2px, transparent 2px 4px); }
.dica { font-size: 15px; margin: 0; }

.calendario { display: grid; gap: var(--respiro-m) 48px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 28px; }
.mes h3 { margin: 0 0 10px; font: italic 400 30px/1.1 var(--serif); }
.semana, .grade { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.semana span { text-align: center; font-size: 13px; color: var(--g-pequeno); padding-bottom: 4px; }
.dia {
  aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 50%; background: transparent;
  cursor: pointer; font-size: 18px; font-variant-numeric: tabular-nums;
  transition: background 0.4s, color 0.4s, transform 0.2s;
}
.dia:hover { transform: scale(1.08); }
.dia[data-estado="vaga"] { background: var(--azul); color: #fff; }
.dia[data-estado="sem"] { color: var(--g); text-decoration: line-through; }
.dia[data-estado="pendente"] { color: var(--g); box-shadow: inset 0 0 0 1.5px #d8d8d8; animation: pulso 1.4s ease-in-out infinite; }
.dia[data-estado="parado"] { color: #c4c4c4; }
.dia[data-estado="falha"] { color: var(--falha); background: repeating-linear-gradient(45deg, #fde3da 0 3px, transparent 3px 6px); }
.dia[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--fundo), 0 0 0 4px var(--texto); }
@keyframes pulso { 50% { opacity: 0.4; } }

.aviso { margin: 24px 0 0; color: var(--falha); }

.detalhe { margin-top: var(--respiro-m); padding-top: 24px; border-top: 2px solid var(--texto); display: grid; gap: 12px; max-width: 560px; }
.detalhe:focus { outline: none; }
.detalhe h3 { margin: 0; font: italic 400 34px/1.1 var(--serif); }
.detalhe h3::first-letter { text-transform: uppercase; }
.detalhe p { margin: 0; font-size: 20px; }
.detalhe .botao { justify-self: start; }
.trens { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.trens li { display: grid; grid-template-columns: 1fr auto; gap: 0 16px; font-size: 25px; }
.trens .horario { color: var(--g); grid-column: 1; }
.trens .preco { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.quando { color: var(--g-pequeno); font-size: 15px !important; }

.avisar { display: grid; gap: 22px; margin-top: var(--respiro); max-width: 640px; }
.avisar .linha .campo { flex: 1 1 200px; }
.avisar .datas { align-items: end; gap: 16px 28px; }
.so-ida { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; font-size: 20px; cursor: pointer; white-space: nowrap; }
.so-ida input { width: 22px; height: 22px; margin: 0; accent-color: var(--azul); cursor: pointer; }
.riscado .rotulo, .riscado input { text-decoration: line-through; color: var(--g); }
.riscado input {
  border-bottom-color: #cfcfcf; cursor: not-allowed;
  /* Campo de data ignora text-decoration em alguns celulares: o risco vai desenhado por cima. */
  background: linear-gradient(transparent calc(50% - 3px), var(--g) calc(50% - 3px), var(--g) calc(50% - 1px), transparent calc(50% - 1px));
}
.avisar .botao { justify-self: start; }
.mensagem { margin: 0; font-size: 20px; }
.mensagem.erro { color: var(--falha); }

/* ---- Rodapé (faixa escura com letreiro, como o do MUDA) ---------------------------------- */
.rodape { margin-top: var(--respiro); background: #111; color: #fff; padding-bottom: calc(var(--respiro) + env(safe-area-inset-bottom)); }
.ticker { overflow: hidden; white-space: nowrap; border-bottom: 1px solid #2a2a2a; padding: 26px 0; font: 18px ui-monospace, SFMono-Regular, Menlo, monospace; }
.ticker-faixa { display: inline-block; animation: letreiro 40s linear infinite; }
.ticker-faixa span { padding-right: 0; }
@keyframes letreiro { to { transform: translateX(-50%); } }
.rodape-texto { padding-top: var(--respiro-m); display: grid; gap: 14px; font-size: 18px; max-width: 900px; }
.rodape-texto p { margin: 0; max-width: 560px; }
.rodape-texto .g { color: #9a9a9a; }
.rodape a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.rodape a:hover { color: var(--link); }

/* ---- A bolinha e o menu que ela abre ----------------------------------------------------- */
.bolinha { position: fixed; inset: 0; width: 100vw; height: 100vh; overflow: visible; pointer-events: none; z-index: 50; opacity: 0; transition: opacity 0.6s; }
.bolinha.pronta { opacity: 1; }
.bolinha path { fill: var(--azul); }
.bolinha-botao {
  position: fixed; left: 0; top: 0; z-index: 51; border: 0; padding: 0; border-radius: 50%;
  background: transparent; cursor: grab; -webkit-tap-highlight-color: transparent;
  touch-action: none; user-select: none; -webkit-user-select: none; will-change: transform;
}
.bolinha-botao.segurando { cursor: grabbing; }
.bolinha-botao:focus-visible { outline: 3px solid var(--texto); outline-offset: 4px; }

.menu { position: fixed; inset: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain; color: #fff; animation: aparecer 0.45s ease both; }
.menu.solido { background: var(--azul); animation: none; }
.menu.saindo { animation: sumir 0.2s ease both; }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px); } }
@keyframes sumir { to { opacity: 0; } }
.menu-conteudo { max-width: 640px; margin: 0 auto; padding: 40px 32px calc(96px + env(safe-area-inset-bottom)); display: grid; gap: 24px; }
.menu-topo { display: flex; justify-content: flex-end; }
.menu-fechar { background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; padding: 8px 0; text-decoration: underline; text-underline-offset: 4px; }
.menu-fechar:focus-visible, .menu :focus-visible { outline-color: #fff; }
.menu-secao { display: grid; gap: 14px; }
.menu .suave { color: rgb(255 255 255 / 0.7); }
.menu .rotulo { color: rgb(255 255 255 / 0.75); }
.menu input[type="email"] { border-bottom-color: #fff; color: #fff; }
.menu input::placeholder { color: rgb(255 255 255 / 0.5); }
.menu-form { display: grid; gap: 18px; margin-top: 8px; }
.menu-form .botao, .menu .botao.claro { justify-self: start; }
.botao.claro { background: #fff; color: var(--azul); }
.botao.claro:hover { background: #000; color: #fff; }
.menu .link { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.menu .link:hover { color: #000; }
.menu-subtitulo { margin-top: 24px; }
.perfil { display: flex; flex-wrap: wrap; gap: 12px 28px; padding-top: 28px; margin-top: 12px; border-top: 1px solid rgb(255 255 255 / 0.35); font-size: 18px; }
.menu .perigo { color: #ffd5c9; }
.menu-giro { padding-top: 28px; border-top: 1px solid rgb(255 255 255 / 0.35); }
.giro-linha { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.chave {
  flex: none; min-width: 112px; padding: 10px 16px; border: 2px solid #fff; border-radius: 999px;
  background: transparent; color: #fff; font-size: 17px; cursor: pointer; transition: 0.3s;
}
.chave[aria-pressed="true"] { background: #fff; color: var(--azul); }
.menu-dica { margin-top: 8px; }

.lista-alertas { list-style: none; padding: 0; margin: 0; display: grid; }
.alerta { padding: 18px 0; border-top: 1px solid rgb(255 255 255 / 0.35); display: grid; gap: 4px; }
.alerta p { margin: 0; }
.alerta .rota { font-size: 25px; font-weight: 400; }
.alerta-topo { display: grid; gap: 4px; }
.selo { font-size: 14px; justify-self: start; padding: 2px 10px; border: 1px solid rgb(255 255 255 / 0.7); border-radius: 999px; }
.alerta.aguardando_confirmacao .selo { background: #fff; color: var(--azul); border-color: #fff; }
.alerta-info { font-size: 18px; color: rgb(255 255 255 / 0.85); }
.alerta-vagas { font: italic 400 22px/1.2 var(--serif); }
.alerta-quando { font-size: 15px; color: rgb(255 255 255 / 0.7); }
.alerta.expirado, .alerta.cancelado { opacity: 0.55; }
.acoes { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 17px; }

.aviso-rapido {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70;
  max-width: calc(100vw - 32px); padding: 14px 20px; border-radius: 4px;
  background: var(--texto); color: var(--fundo); font-size: 17px;
}

/* Páginas curtas (link expirado, alerta parado...) */
.simples { padding-top: calc(var(--respiro) * 0.6); padding-bottom: var(--respiro); display: grid; gap: 16px; max-width: 640px; }
.simples h1 { margin: 0; font: italic 400 48px/1.05 var(--serif); }
.simples p { margin: 0; font-size: 22px; }
.simples form { margin: 8px 0; }

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

@media (max-width: 750px) {
  :root { --respiro: 96px; --respiro-m: 32px; --respiro-p: 12px; --lado: 16px; }
  body { font-size: 18px; }
  .txl { font-size: 26px; line-height: 1.23; }
  .txm { font-size: 20px; }
  .txs { font-size: 15px; }
  select, input[type="number"], input[type="date"], input[type="email"] { font-size: 20px; min-height: 48px; }
  .trecho { grid-template-columns: 1fr auto; gap: 16px 12px; }
  .trecho .campo:last-child { grid-column: 1; }
  .inverter { grid-column: 2; grid-row: 1 / span 2; align-self: center; transform: rotate(90deg); width: 48px; height: 48px; }
  .classes label { font-size: 20px; }
  .classes label:has(input:checked) { font-size: 22px; }
  .botao { font-size: 20px; padding: 13px 20px 15px; }
  .busca .botao, .avisar .botao, .detalhe .botao { width: 100%; }
  .calendario { grid-template-columns: 1fr; }
  .mes h3 { font-size: 26px; }
  .dia { font-size: 17px; }
  .trens li { font-size: 20px; grid-template-columns: 1fr; }
  .trens .preco { grid-row: auto; grid-column: 1; }
  .detalhe h3 { font-size: 28px; }
  .menu-conteudo { padding: 24px 24px calc(96px + env(safe-area-inset-bottom)); }
  .alerta .rota { font-size: 20px; }
  .simples h1 { font-size: 36px; }
  .ticker { font-size: 15px; padding: 20px 0; }
}
