/* public/assets/css/auth-ponto.css
   Telas de acesso no mesmo padrão do app PontoAgil Multi:
   fundo azul em degradê, logo branca, relógio e folha branca com os campos. */

:root {
    --ap-azul: #0E7CC4;
    --ap-azul-claro: #1A9BE6;
    --ap-azul-escuro: #0A5F97;
    --ap-ciano: #2BC6EE;
    --ap-marinho: #0B2340;
    --ap-laranja: #F28C1E;
    --ap-texto: #0B2340;
    --ap-texto-2: #52637A;
    --ap-texto-3: #7B8BA1;
    --ap-campo-bg: #F4F7FB;
    --ap-borda: #D5DCE5;
    --ap-erro: #D93A3A;
}

html, body { height: 100%; }

.ap-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ap-texto);
    background: linear-gradient(160deg, var(--ap-azul-claro) 0%, var(--ap-azul) 45%, var(--ap-azul-escuro) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* ── Estrutura ─────────────────────────────────────────── */
.ap-wrap {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ap-bolha {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}
.ap-bolha-1 { width: 520px; height: 520px; top: -180px; right: -160px; }
.ap-bolha-2 { width: 380px; height: 380px; bottom: 120px; left: -160px; background: rgba(255, 255, 255, 0.05); }

/* Bloco que recolhe/expande com animação de altura */
.ap-recolhe {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows .45s cubic-bezier(.2, .8, .2, 1), opacity .3s ease;
}
.ap-recolhe > div { overflow: hidden; min-height: 0; }

/* ── Marca ─────────────────────────────────────────────── */
.ap-marca {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px 28px;
    color: #fff;
    text-align: center;
    transition: padding .45s cubic-bezier(.2, .8, .2, 1);
}
.ap-logo {
    width: 300px;
    max-width: 78%;
    height: auto;
    animation: ap-entra .6s ease-out both;
    transition: width .45s cubic-bezier(.2, .8, .2, 1);
}
.ap-hora {
    margin-top: 26px;
    font-size: 64px;
    line-height: 1;
    font-weight: 300;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
}
.ap-data {
    margin-top: 8px;
    font-size: 16px;
    color: rgba(255, 255, 255, .85);
}

/* ── Folha branca ──────────────────────────────────────── */
.ap-folha {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border-radius: 30px 30px 0 0;
    padding: 0 16px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 34px rgba(11, 35, 64, .2);
    animation: ap-sobe .55s .1s cubic-bezier(.2, .8, .2, 1) both;
}
.ap-folha > .ap-recolhe { width: 100%; }

/* Relógio-botão (estado fechado) */
.ap-fechado > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
}
.ap-relogio-botao {
    width: 148px;
    height: 148px;
    margin-top: -74px;          /* metade para fora da folha, como no app */
    border-radius: 50%;
    border: 0;
    padding: 7px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(14, 124, 196, .35);
    transition: transform .15s ease, box-shadow .15s ease;
    animation: ap-pulsa 2.6s 1s ease-in-out infinite;
}
.ap-relogio-botao:hover { transform: scale(1.04); box-shadow: 0 20px 40px rgba(14, 124, 196, .42); }
.ap-relogio-botao:active { transform: scale(.97); }
.ap-relogio-botao:focus-visible { outline: 3px solid var(--ap-laranja); outline-offset: 4px; }
.ap-fechado { overflow: visible; }
.ap-fechado > div { overflow: visible; }

.ap-relogio-face {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--ap-ciano), var(--ap-azul));
}
.ap-traco {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 50%;
    margin-left: -1px;
    transform-origin: 50% 100%;
}
.ap-traco::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 0;
    width: 2px;
    height: 8px;
    border-radius: 1px;
    background: rgba(255, 255, 255, .75);
}
.ap-ponteiro {
    position: absolute;
    left: 50%;
    bottom: 50%;
    background: #fff;
    border-radius: 3px;
    transform-origin: 50% 100%;
    transform: translateX(-50%);
}
.ap-ponteiro-hora { width: 5px; height: 24%; }
.ap-ponteiro-min  { width: 3px; height: 34%; }
.ap-centro {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: var(--ap-laranja);
    border: 2px solid #fff;
}
.ap-relogio-rotulo {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22%;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
}
.ap-dica {
    margin: 18px 0 6px;
    font-size: 15px;
    color: var(--ap-texto-2);
}

/* Alça (fecha a folha) */
.ap-alca {
    display: block;
    width: 64px;
    height: 24px;
    margin: 0 auto 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
}
.ap-alca::before {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: 12px;
    height: 5px;
    border-radius: 3px;
    background: var(--ap-borda);
}
.ap-alca:hover::before { background: #B9C3CF; }

.ap-aberto > div { padding-top: 10px; }
.ap-folha-conteudo {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 6px 2px 4px;
}
.ap-rodape {
    margin: 0;
    padding-top: 14px;
    font-size: 12px;
    color: #A9B4C2;
}

/* ── Estados ───────────────────────────────────────────── */
/* Fechado (só nas telas recolhíveis): esconde o formulário */
.ap-wrap.recolhivel:not(.aberto) .ap-aberto { grid-template-rows: 0fr; opacity: 0; }
.ap-wrap.recolhivel:not(.aberto) .ap-folha { padding-top: 0; }
.ap-wrap.recolhivel:not(.aberto) .ap-marca { padding-bottom: 110px; }

/* Aberto: logo sobe e diminui, hora some, relógio-botão some */
.ap-wrap.aberto .ap-marca { flex: 0 0 auto; padding: 28px 16px 26px; }
.ap-wrap.aberto .ap-logo { width: 190px; }
.ap-wrap.aberto .ap-marca .ap-recolhe,
.ap-wrap.aberto .ap-fechado { grid-template-rows: 0fr; opacity: 0; }
.ap-wrap.aberto .ap-fechado > div { overflow: hidden; }
.ap-wrap.aberto .ap-folha { flex: 1; padding-top: 12px; }
.ap-wrap:not(.recolhivel) .ap-folha { padding-top: 30px; }

@media (min-width: 992px) {
    .ap-wrap.aberto .ap-logo { width: 230px; }
    .ap-wrap.aberto .ap-folha { flex: 0 0 auto; border-radius: 30px; margin-bottom: 6vh; }
    .ap-wrap.aberto { justify-content: center; }
    .ap-wrap.aberto .ap-folha { padding-bottom: 18px; }
}

@media (max-height: 700px) {
    .ap-logo { width: 230px; }
    .ap-hora { font-size: 48px; margin-top: 16px; }
    .ap-relogio-botao { width: 124px; height: 124px; margin-top: -62px; }
    .ap-wrap.recolhivel:not(.aberto) .ap-marca { padding-bottom: 90px; }
}

/* ── Textos ────────────────────────────────────────────── */
.ap-titulo {
    font-size: 24px;
    font-weight: 700;
    color: var(--ap-texto);
    margin: 0 0 4px;
}
.ap-sub {
    font-size: 15px;
    color: var(--ap-texto-2);
    margin: 0 0 22px;
}

/* ── Campos (cartão com ícone, igual ao app) ───────────── */
.ap-campo {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 66px;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: var(--ap-campo-bg);
    border: 1.5px solid transparent;
    border-radius: 16px;
    cursor: text;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.ap-campo:focus-within {
    background: #fff;
    border-color: var(--ap-azul-claro);
    box-shadow: 0 0 0 4px rgba(26, 155, 230, .12);
}
.ap-campo-icone {
    flex: 0 0 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}
.ap-azul    { background: linear-gradient(135deg, var(--ap-azul-claro), var(--ap-azul-escuro)); }
.ap-laranja { background: linear-gradient(135deg, #F7A541, #E8780F); }

.ap-campo-corpo {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.ap-campo-rotulo {
    font-size: 11px;
    font-weight: 600;
    color: var(--ap-texto-3);
    letter-spacing: .2px;
}
.ap-campo-input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 2px 0 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--ap-texto);
}
.ap-campo-input::placeholder { color: #A9B4C2; font-weight: 400; }
.ap-campo-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 40px var(--ap-campo-bg) inset;
    -webkit-text-fill-color: var(--ap-texto);
}
.ap-campo:focus-within .ap-campo-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 40px #fff inset;
}
.ap-olho {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #A9B4C2;
    font-size: 20px;
    padding: 6px;
    line-height: 1;
    cursor: pointer;
}
.ap-olho:hover { color: var(--ap-azul); }

/* ── Lembrar / Esqueci ─────────────────────────────────── */
.ap-linha-extra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 2px 20px;
    font-size: 14px;
}
.ap-lembrar {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ap-texto-2);
    cursor: pointer;
    margin: 0;
}
.ap-lembrar input {
    width: 17px;
    height: 17px;
    accent-color: var(--ap-azul);
}
.ap-esqueci {
    color: var(--ap-azul);
    font-weight: 600;
    text-decoration: none;
}
.ap-esqueci:hover { text-decoration: underline; }

/* ── Botão principal ───────────────────────────────────── */
.ap-botao {
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: 16px;
    background: var(--ap-azul);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 22px rgba(14, 124, 196, .32);
    transition: background .15s, transform .1s, box-shadow .15s;
}
.ap-botao:hover { background: #0C6FB0; }
.ap-botao:active { transform: translateY(1px); box-shadow: 0 6px 14px rgba(14, 124, 196, .28); }
.ap-botao:disabled { opacity: .75; cursor: wait; }
.ap-botao i { font-size: 20px; }

/* ── Alerta de erro ────────────────────────────────────── */
.ap-alerta {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #FDECEC;
    border: 1px solid #F6C6C6;
    color: #A42828;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}
.ap-alerta.d-none { display: none !important; }
.ap-alerta i { margin-top: 2px; }
.ap-alerta ul { list-style: none; padding-left: 0 !important; }

.ap-termos {
    margin: 20px 0 0;
    font-size: 12px;
    color: var(--ap-texto-3);
    text-align: center;
    line-height: 1.6;
}
.ap-termos a { color: var(--ap-texto-2); font-weight: 600; }

@keyframes ap-entra {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}
@keyframes ap-sobe {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
@keyframes ap-pulsa {
    0%, 100% { box-shadow: 0 16px 34px rgba(14, 124, 196, .35), 0 0 0 0 rgba(26, 155, 230, .35); }
    50%      { box-shadow: 0 16px 34px rgba(14, 124, 196, .35), 0 0 0 14px rgba(26, 155, 230, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .ap-logo, .ap-folha, .ap-relogio-botao { animation: none; }
    .ap-recolhe, .ap-marca, .ap-logo { transition: none; }
}

/* ── Escolha de empresa (janela do login e página) ─────── */
.ae-modal .modal-dialog { max-width: 560px; padding: 0 12px; }
.ae-conteudo {
    border: 0;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(5, 30, 60, .35);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ap-texto);
}
.ae-topo {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px 20px;
    color: #fff;
    background: linear-gradient(135deg, var(--ap-azul-claro) 0%, var(--ap-azul) 55%, var(--ap-azul-escuro) 100%);
}
.ae-topo-icone {
    flex: 0 0 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.ae-titulo { font-size: 20px; font-weight: 700; margin: 0; color: #fff; }
.ae-sub { font-size: 14px; margin: 2px 0 0; opacity: .9; }
.ae-corpo { padding: 18px 20px 6px; }
.ae-busca { min-height: 58px; margin-bottom: 12px; }

.ae-lista { display: flex; flex-direction: column; gap: 8px; }
.ae-lista-pagina { margin-bottom: 4px; }
.ae-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-align: left;
    background: #fff;
    border: 1px solid #E3E8EF;
    border-radius: 14px;
    color: var(--ap-texto);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.ae-item:hover, .ae-item:focus-visible {
    border-color: var(--ap-azul-claro);
    background: #F5FAFE;
    box-shadow: 0 6px 16px rgba(14, 124, 196, .12);
    outline: 0;
}
.ae-item-letra {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ap-azul-claro), var(--ap-azul-escuro));
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ae-item-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ae-item-texto strong {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ae-item-texto small { font-size: 12px; color: var(--ap-texto-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ae-item-seta { color: #A9B4C2; font-size: 16px; transition: transform .15s, color .15s; }
.ae-item:hover .ae-item-seta { color: var(--ap-azul); transform: translateX(2px); }
.ae-item.carregando { opacity: .6; pointer-events: none; }
.ae-item.carregando .ae-item-seta::before { content: "\F130"; animation: ae-gira .8s linear infinite; display: inline-block; }
@keyframes ae-gira { to { transform: rotate(360deg); } }

.ae-vazio {
    padding: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--ap-texto-3);
    background: var(--ap-campo-bg);
    border-radius: 14px;
}
.ae-mais {
    width: 100%;
    margin-top: 10px;
    height: 42px;
    border: 1px dashed #C6D2DF;
    border-radius: 12px;
    background: transparent;
    color: var(--ap-azul);
    font-size: 14px;
    font-weight: 600;
}
.ae-mais:hover { background: #F5FAFE; border-color: var(--ap-azul-claro); }
.ae-mais.d-none { display: none !important; }
.ae-rodape { padding: 12px 20px 18px; display: flex; }
.ae-sair {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ap-texto-2);
    font-size: 14px;
    font-weight: 600;
}
.ae-sair:hover { background: var(--ap-campo-bg); color: var(--ap-texto); }

@media (max-width: 575.98px) {
    .ae-modal .modal-dialog { padding: 0 8px; margin: 8px auto; }
    .ae-topo { padding: 18px 18px 16px; }
    .ae-corpo { padding: 14px 14px 4px; }
}

/* ── Definir senha ─────────────────────────────────────── */
.ap-alerta-ok { background: #E8F7EE; border-color: #BFE6CD; color: #1D7A43; }
.ap-dica-senha {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: -2px 2px 18px;
    font-size: 13px;
    color: var(--ap-texto-3);
}
.ap-dica-senha span { display: inline-flex; align-items: center; gap: 6px; }
.ap-dica-senha span.ok { color: #1D7A43; }
