/* Versátil Tec — Sistema de Atendimentos
   Mobile first: tudo é pensado para 360–430 px e expande a partir de 768 px.
   Cores do site versatiltecelevadores.com.br: grafite #383838, limão #EBFF51, noite #001721. */

:root {
    --grafite: #383838;
    --grafite-escuro: #262626;
    --limao: #EBFF51;
    --limao-escuro: #d4e83a;
    --noite: #001721;

    --fundo: #F2F2F2;
    --superficie: #FFFFFF;
    --borda: #DCDCDE;
    --texto: #1c1f23;
    --texto-suave: #5F5F5F;

    --sucesso: #2E7D32;
    --sucesso-fundo: #E8F5E9;
    --erro: #C62828;
    --erro-fundo: #FDECEA;
    --aviso: #B26A00;
    --aviso-fundo: #FFF4E0;
    --info: #1565C0;
    --info-fundo: #E3F2FD;

    --raio: 14px;
    --raio-pequeno: 10px;
    --toque: 48px;                 /* alvo mínimo de toque */
    --altura-abas: 64px;
    --altura-topo: 56px;
    --sombra: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .06);

    --seguro-baixo: env(safe-area-inset-bottom, 0px);
    --seguro-topo: env(safe-area-inset-top, 0px);

    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    color: var(--texto);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--fundo); min-height: 100dvh; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.so-computador { display: none; }
@media (min-width: 768px) { .so-computador { display: inline; } }

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------
   Componentes
   --------------------------------------------------------------- */
.cartao {
    background: var(--superficie);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 20px;
}

.botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--toque);
    padding: 0 20px;
    border: 0;
    border-radius: var(--raio-pequeno);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform .08s, background-color .15s;
}
.botao:active { transform: scale(.98); }
.botao:disabled { opacity: .6; cursor: progress; }
.botao--bloco { width: 100%; }
.botao--primario { background: var(--limao); color: var(--noite); }
.botao--primario:hover { background: var(--limao-escuro); }
.botao--escuro { background: var(--grafite); color: #fff; }
.botao--perigo { background: var(--erro-fundo); color: var(--erro); }

.campo { display: block; margin-bottom: 16px; }
.campo__rotulo { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.campo__entrada {
    width: 100%;
    min-height: var(--toque);
    padding: 10px 14px;
    border: 1.5px solid var(--borda);
    border-radius: var(--raio-pequeno);
    background: #fff;
    font-size: 1rem;            /* 16px evita o zoom automático do iPhone */
}
.campo__entrada:focus { outline: none; border-color: var(--grafite); box-shadow: 0 0 0 3px rgba(235, 255, 81, .6); }
.campo__senha { position: relative; display: block; }
.campo__senha .campo__entrada { padding-right: 92px; }
.campo__olho {
    position: absolute; right: 4px; top: 4px; bottom: 4px;
    padding: 0 12px; border: 0; border-radius: 8px;
    background: var(--fundo); font-size: .85rem; font-weight: 600; cursor: pointer;
}

.caixa { display: flex; align-items: center; gap: 12px; min-height: var(--toque); margin-bottom: 16px; cursor: pointer; }
.caixa input { width: 22px; height: 22px; accent-color: var(--grafite); }

.alerta { padding: 12px 14px; border-radius: var(--raio-pequeno); margin-bottom: 16px; font-weight: 500; }
.alerta--erro { background: var(--erro-fundo); color: var(--erro); }
.alerta--sucesso { background: var(--sucesso-fundo); color: var(--sucesso); }

/* Etiquetas de status (usadas nas próximas telas) */
.etiqueta { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.etiqueta--agendado { background: var(--info-fundo); color: var(--info); }
.etiqueta--concluido { background: var(--sucesso-fundo); color: var(--sucesso); }
.etiqueta--pendente { background: var(--aviso-fundo); color: var(--aviso); }
.etiqueta--cancelado { background: #ECEFF1; color: #546E7A; }

/* ---------------------------------------------------------------
   Tela de login
   --------------------------------------------------------------- */
.tela-auth { background: var(--grafite); }
.auth {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(24px + var(--seguro-topo)) 16px calc(24px + var(--seguro-baixo));
}
.auth__logo { width: 180px; height: auto; margin-bottom: 28px; }
.auth__cartao { width: 100%; max-width: 400px; padding: 24px 20px; }
.auth__titulo { margin: 0 0 20px; font-size: 1.5rem; }
.auth__ajuda { margin: 16px 0 0; text-align: center; font-size: .9rem; color: var(--texto-suave); }

/* ---------------------------------------------------------------
   Estrutura do app
   --------------------------------------------------------------- */
.topo {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    height: calc(var(--altura-topo) + var(--seguro-topo));
    padding: var(--seguro-topo) 8px 0 16px;
    background: var(--grafite); color: #fff;
}
.topo__marca img { height: 30px; width: auto; }
.topo__titulo { flex: 1; margin: 0; font-size: 1.05rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo__sino {
    position: relative; display: grid; place-items: center;
    width: var(--toque); height: var(--toque); border-radius: 50%;
}
.topo__sino svg { width: 24px; height: 24px; }
.topo__sino.ativo { color: var(--limao); }
.topo__contador {
    position: absolute; top: 6px; right: 4px;
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
    background: var(--limao); color: var(--noite);
    font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center;
}

.aviso-conexao { background: var(--aviso-fundo); color: var(--aviso); padding: 8px 16px; font-size: .88rem; font-weight: 500; text-align: center; }

.conteudo {
    padding: 16px 16px calc(var(--altura-abas) + 96px + var(--seguro-baixo));
    max-width: 960px;
    margin: 0 auto;
}

.abas {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--altura-abas) + var(--seguro-baixo));
    padding-bottom: var(--seguro-baixo);
    background: var(--superficie);
    border-top: 1px solid var(--borda);
}
.abas__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    text-decoration: none; color: var(--texto-suave);
    font-size: .7rem; font-weight: 600;
}
.abas__item svg { width: 24px; height: 24px; }
.abas__item.ativo { color: var(--noite); }
.abas__item.ativo svg { background: var(--limao); border-radius: 12px; padding: 3px 14px; box-sizing: content-box; }

.fab {
    position: fixed; z-index: 25;
    right: 16px; bottom: calc(var(--altura-abas) + 16px + var(--seguro-baixo));
    display: inline-flex; align-items: center; gap: 8px;
    height: 56px; padding: 0 20px 0 16px; border-radius: 28px;
    background: var(--limao); color: var(--noite);
    font-weight: 700; text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.fab svg { width: 24px; height: 24px; stroke-width: 2.5; }

/* Estado vazio / em construção */
.vazio { text-align: center; padding: 48px 16px; }
.vazio__icone { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--superficie); box-shadow: var(--sombra); margin-bottom: 16px; }
.vazio__icone svg { width: 32px; height: 32px; color: var(--grafite); }
.vazio__titulo { margin: 0 0 6px; font-size: 1.2rem; }
.vazio__texto { margin: 0 0 20px; color: var(--texto-suave); }

/* Menu */
.perfil { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.perfil__avatar { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--grafite); color: var(--limao); font-size: 1.4rem; font-weight: 700; }
.perfil__nome { display: block; font-size: 1.05rem; }
.perfil__dados { color: var(--texto-suave); font-size: .9rem; word-break: break-all; }
.secao-titulo { margin: 0 0 8px 4px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-suave); }
.lista-menu { list-style: none; margin: 0 0 24px; padding: 4px 0; }
.lista-menu li + li { border-top: 1px solid var(--borda); }
.lista-menu__item { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 20px; text-decoration: none; font-weight: 500; }
.lista-menu__item--breve { color: var(--texto-suave); }
.lista-menu__item small { font-size: .75rem; }
.rodape-versao { text-align: center; color: var(--texto-suave); font-size: .8rem; margin-top: 24px; }

/* ---------------------------------------------------------------
   Formulários
   --------------------------------------------------------------- */
.campo__opcional { font-weight: 400; color: var(--texto-suave); }
.campo__dica { display: block; margin-top: 4px; font-size: .82rem; color: var(--texto-suave); }
.campo__erro { display: block; margin-top: 4px; font-size: .85rem; font-weight: 600; color: var(--erro); }
.campo__entrada--erro { border-color: var(--erro); }
textarea.campo__entrada { min-height: 96px; resize: vertical; line-height: 1.4; }
select.campo__entrada { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23383838' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 20px; padding-right: 40px; }
.form-secao { margin: 0 0 12px; font-size: 1rem; }
.form-secao + .campo, .cartao + .cartao { margin-top: 0; }
.formulario .cartao { margin-bottom: 16px; }
.botoes { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.botao--secundario { background: var(--superficie); color: var(--texto); border: 1.5px solid var(--borda); }
.botao--pequeno { min-height: 40px; padding: 0 14px; font-size: .9rem; }

/* ---------------------------------------------------------------
   Topo com "voltar"
   --------------------------------------------------------------- */
.topo__voltar { display: grid; place-items: center; width: var(--toque); height: var(--toque); margin-left: -12px; color: #fff; border-radius: 50%; }
.topo__voltar svg { width: 26px; height: 26px; }

/* ---------------------------------------------------------------
   Listas
   --------------------------------------------------------------- */
.barra-lista { display: flex; gap: 10px; margin-bottom: 12px; }
.busca { position: relative; flex: 1; }
.busca svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--texto-suave); pointer-events: none; }
.busca .campo__entrada { padding-left: 44px; }
.filtros { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 2px; scrollbar-width: none; }
.filtros::-webkit-scrollbar { display: none; }
.filtro { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1.5px solid var(--borda); background: var(--superficie); font-size: .88rem; font-weight: 600; text-decoration: none; color: var(--texto-suave); }
.filtro.ativo { background: var(--grafite); border-color: var(--grafite); color: #fff; }
.contagem { margin: 0 4px 8px; font-size: .85rem; color: var(--texto-suave); }

.lista { list-style: none; margin: 0 0 16px; padding: 0; background: var(--superficie); border-radius: var(--raio); box-shadow: var(--sombra); overflow: hidden; }
.lista > li + li { border-top: 1px solid var(--borda); }
.item { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; text-decoration: none; color: inherit; }
a.item:active { background: var(--fundo); }
.item__corpo { flex: 1; min-width: 0; }
.item__titulo { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__sub { display: block; font-size: .85rem; color: var(--texto-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__seta { flex: none; width: 20px; height: 20px; color: var(--texto-suave); }
.item__icone { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--fundo); color: var(--grafite); }
.item__icone svg { width: 22px; height: 22px; }
.item--inativo { opacity: .55; }

.etiqueta--admin { background: var(--grafite); color: var(--limao); }
.etiqueta--tecnico { background: var(--fundo); color: var(--texto-suave); }
.etiqueta--inativo { background: #ECEFF1; color: #546E7A; }
.etiqueta--contrato { background: var(--limao); color: var(--noite); }

/* ---------------------------------------------------------------
   Detalhe (cliente, equipamento)
   --------------------------------------------------------------- */
.detalhe-cabecalho { margin-bottom: 16px; }
.detalhe-cabecalho h2 { margin: 0 0 6px; font-size: 1.35rem; line-height: 1.25; }
.detalhe-cabecalho .etiquetas { display: flex; flex-wrap: wrap; gap: 6px; }
.dados { margin: 0; display: grid; gap: 12px; }
.dados div { display: grid; gap: 2px; }
.dados dt { font-size: .8rem; font-weight: 600; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .03em; }
.dados dd { margin: 0; word-break: break-word; }
.acoes-contato { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.secao { margin: 24px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.secao h3 { margin: 0; font-size: 1.05rem; }
.vazio-curto { padding: 20px 16px; text-align: center; color: var(--texto-suave); background: var(--superficie); border-radius: var(--raio); box-shadow: var(--sombra); margin-bottom: 16px; }

/* Senha recém-gerada (mostrada uma única vez) */
.senha-gerada { background: var(--noite); color: #fff; border-radius: var(--raio); padding: 16px; margin-bottom: 16px; }
.senha-gerada p { margin: 0 0 8px; }
.senha-gerada code { display: block; font-size: 1.5rem; letter-spacing: .08em; color: var(--limao); font-family: ui-monospace, Consolas, monospace; user-select: all; margin-bottom: 10px; }

/* ---------------------------------------------------------------
   Agenda
   --------------------------------------------------------------- */
.semana { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.semana__nav { flex: none; display: grid; place-items: center; width: var(--toque); height: var(--toque); border-radius: 50%; background: var(--superficie); box-shadow: var(--sombra); color: var(--grafite); }
.semana__nav svg { width: 22px; height: 22px; }
.semana__titulo { flex: 1; text-align: center; display: grid; gap: 2px; }
.semana__titulo strong { font-size: 1.05rem; }
.semana__titulo span, .semana__titulo a { font-size: .82rem; color: var(--texto-suave); }
.dia { margin-bottom: 14px; }
.dia__titulo { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 6px; font-size: .95rem; }
.dia__titulo span { font-weight: 500; color: var(--texto-suave); font-size: .85rem; }
.dia--hoje .dia__titulo { color: var(--noite); }
.dia--hoje .dia__titulo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--limao); box-shadow: 0 0 0 2px var(--grafite); align-self: center; }
.dia--passado { opacity: .7; }
.dia__vazio { margin: 0 4px; font-size: .85rem; color: var(--texto-suave); }
.item__hora { flex: none; min-width: 48px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--grafite); }
.marcador { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

/* ---------------------------------------------------------------
   Formulário de atendimento
   --------------------------------------------------------------- */
.campo--grupo { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.opcoes { display: grid; gap: 8px; }
.caixa--opcao { margin: 0; padding: 10px 14px; border: 1.5px solid var(--borda); border-radius: var(--raio-pequeno); background: #fff; }
.caixa--opcao:has(input:checked) { border-color: var(--grafite); background: #fafbe8; }
.caixa--opcao span { display: grid; }
.caixa--opcao small { color: var(--texto-suave); font-size: .8rem; }
.link-acao { border: 0; background: none; padding: 8px 0; color: var(--noite); font-weight: 600; text-decoration: underline; cursor: pointer; justify-self: start; }
.linha-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.alerta--info { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--info-fundo); color: var(--info); }
.botao--grande { min-height: 56px; font-size: 1.05rem; }

.segmentado { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmentado__opcao { position: relative; }
.segmentado__opcao input { position: absolute; opacity: 0; }
.segmentado__opcao span { display: grid; place-items: center; min-height: 52px; border: 2px solid var(--borda); border-radius: var(--raio-pequeno); font-weight: 700; cursor: pointer; }
.segmentado__opcao input:focus-visible + span { outline: 3px solid rgba(235, 255, 81, .8); }
.segmentado__opcao--concluido input:checked + span { border-color: var(--sucesso); background: var(--sucesso-fundo); color: var(--sucesso); }
.segmentado__opcao--pendente input:checked + span { border-color: var(--aviso); background: var(--aviso-fundo); color: var(--aviso); }

.pendencia { margin-top: 12px; padding: 12px; border: 1.5px dashed var(--borda); border-radius: var(--raio-pequeno); }
.pendencia--ativa { border-style: solid; border-color: var(--aviso); background: #fffbf3; }
.pendencia .caixa { margin-bottom: 8px; }
.pendencia__titulo { margin: 0 0 10px; font-weight: 700; }
.pecas { display: grid; gap: 8px; margin-bottom: 16px; }
.peca { display: grid; grid-template-columns: 1fr 72px auto; gap: 8px; align-items: center; }
.peca__remover { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--erro-fundo); color: var(--erro); font-size: 1.3rem; cursor: pointer; }

.fotos-botoes { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-bottom: 12px; }
.fotos-botoes .botao { cursor: pointer; }
.fotos-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.foto { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--fundo); }
.foto img { width: 100%; height: 100%; object-fit: cover; }
.foto__remover { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.foto--apagada { display: grid; place-items: center; padding: 8px; text-align: center; font-size: .75rem; color: var(--texto-suave); }

.enviar-fixo { position: sticky; bottom: calc(var(--altura-abas) + var(--seguro-baixo)); z-index: 15; margin: 0 -16px; padding: 12px 16px; background: linear-gradient(transparent, var(--fundo) 30%); }
.enviar-fixo__status { margin: 0 0 6px; text-align: center; font-weight: 600; color: var(--grafite); }

.paginacao { display: flex; justify-content: space-between; gap: 8px; }
.dados__largo { grid-column: 1 / -1; }

/* Avisos (sino) */
.aviso__ponto { flex: none; width: 10px; height: 10px; border-radius: 50%; background: transparent; }
.aviso--novo .aviso__ponto { background: var(--limao); box-shadow: 0 0 0 2px var(--grafite); }
.aviso__texto { white-space: normal; }
.aviso:not(.aviso--novo) .aviso__texto { font-weight: 500; color: var(--texto-suave); }

/* ---------------------------------------------------------------
   Computador
   --------------------------------------------------------------- */
@media (min-width: 768px) {
    .conteudo { padding: 24px 24px calc(var(--altura-abas) + 112px); }
    .abas { left: 50%; right: auto; transform: translateX(-50%); width: min(560px, 100%); bottom: 16px; height: var(--altura-abas); padding: 0; border: 1px solid var(--borda); border-radius: 20px; box-shadow: var(--sombra); }
    .fab { right: 24px; bottom: 24px; }
    .formulario { max-width: 640px; }
    .botoes { flex-direction: row-reverse; justify-content: flex-start; }
    .botoes .botao--bloco { width: auto; min-width: 160px; }
    .dados { grid-template-columns: 1fr 1fr; }
    .fotos-grade { grid-template-columns: repeat(5, 1fr); }
    .enviar-fixo { bottom: calc(var(--altura-abas) + 16px); }
}
