/* Tela de entrada — estilo tela de bloqueio do macOS: fundo vivo, relógio grande, cartão de vidro */
:root {
    --l-marca: #0b7285;
    --l-marca-escura: #085a69;
    --l-fundo-1: #0a3f4a;
    --l-fundo-2: #0f6e7f;
    --l-fundo-3: #3e9aa6;
    --l-texto: #12212a;
    --l-suave: #4b5d68;
    --l-erro: #d93025;
    --l-mola: cubic-bezier(.34, 1.56, .64, 1);
    --l-suavizar: cubic-bezier(.22, 1, .36, 1);
    --l-fonte: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body.tela-login {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(28px, 7vh, 72px) 16px 24px;
    font-family: var(--l-fonte);
    color: var(--l-texto);
    background: linear-gradient(160deg, var(--l-fundo-1) 0%, var(--l-fundo-2) 48%, var(--l-fundo-3) 100%);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Fundo: manchas de cor que flutuam devagar ---------- */
.fundo-login {
    position: fixed;
    inset: -60px;
    z-index: 0;
    pointer-events: none;
    transition: transform 1.2s var(--l-suavizar);
}
.bolha {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .75;
    will-change: transform;
}
.b1 { width: 46vmax; height: 46vmax; left: -10vmax; top: -12vmax; background: #2fb3a6; animation: flutuar1 22s ease-in-out infinite alternate; }
.b2 { width: 38vmax; height: 38vmax; right: -12vmax; top: 6vh; background: #9b8ae6; opacity: .6; animation: flutuar2 26s ease-in-out infinite alternate; }
.b3 { width: 40vmax; height: 40vmax; left: 18vw; bottom: -18vmax; background: #f2a98b; opacity: .55; animation: flutuar3 30s ease-in-out infinite alternate; }
.b4 { width: 24vmax; height: 24vmax; right: 14vw; bottom: 8vh; background: #f1d27a; opacity: .45; animation: flutuar1 24s ease-in-out infinite alternate-reverse; }

@keyframes flutuar1 { to { transform: translate(8vmax, 6vmax) scale(1.12); } }
@keyframes flutuar2 { to { transform: translate(-10vmax, 8vmax) scale(.9); } }
@keyframes flutuar3 { to { transform: translate(-6vmax, -8vmax) scale(1.15); } }

/* ---------- Relógio ---------- */
.relogio {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 30, 40, .25);
    animation: descer .9s var(--l-suavizar) both;
}
.relogio p { margin: 0; }
.relogio-data {
    font-size: clamp(17px, 2.2vw, 21px);
    font-weight: 600;
    letter-spacing: .01em;
    opacity: .92;
}
.relogio-hora {
    font-size: clamp(72px, 13vw, 128px);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
    margin-top: 2px !important;
}

/* ---------- Cartão de vidro ---------- */
.entrada {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: clamp(22px, 5vh, 48px) auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cartao-login {
    width: 100%;
    padding: 34px 32px 26px;
    border-radius: 30px;
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(30px) saturate(1.7);
    backdrop-filter: blur(30px) saturate(1.7);
    border: 1px solid rgba(255, 255, 255, .7);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 30px 80px -20px rgba(0, 35, 45, .55),
        0 10px 30px -10px rgba(0, 35, 45, .3);
    text-align: center;
    animation: surgir .95s var(--l-mola) .15s both;
}

.logo-login {
    margin: -6px auto 12px;
    animation: pular .9s var(--l-mola) .35s both;
}
.logo-login img { display: block; width: min(250px, 80%); height: auto; margin: 0 auto; filter: drop-shadow(0 4px 10px rgba(120, 90, 30, .18)); }

.cartao-login h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.02em;
    animation: subir .7s var(--l-suavizar) .42s both;
}
.subtitulo {
    margin: 6px 0 22px;
    font-size: 17px;
    color: var(--l-suave);
    animation: subir .7s var(--l-suavizar) .5s both;
}

/* ---------- Campos (rótulo que sobe, igual ao iOS) ---------- */
.campos-login {
    display: grid;
    gap: 12px;
    animation: subir .7s var(--l-suavizar) .58s both;
}
.campo-login {
    position: relative;
    display: block;
    text-align: left;
    cursor: text;
}
.campo-login input {
    width: 100%;
    height: 62px;
    padding: 24px 18px 8px 54px;
    font: inherit;
    font-size: 18px;
    color: var(--l-texto);
    background: rgba(255, 255, 255, .92);
    border: 1.5px solid rgba(18, 33, 42, .12);
    border-radius: 16px;
    outline: none;
    transition: border-color .25s, box-shadow .35s var(--l-suavizar), background .25s, transform .35s var(--l-mola);
    -webkit-appearance: none;
    appearance: none;
}
.campo-senha input { padding-right: 58px; }
.campo-login input:hover { border-color: rgba(11, 114, 133, .35); }
.campo-login input:focus {
    background: #fff;
    border-color: var(--l-marca);
    box-shadow: 0 0 0 5px rgba(11, 114, 133, .16), 0 8px 22px -10px rgba(11, 114, 133, .45);
    transform: translateY(-1px);
}
.campo-rotulo {
    position: absolute;
    left: 54px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #6c7c86;
    z-index: 2;
    pointer-events: none;
    transform-origin: left center;
    transition: transform .35s var(--l-mola), color .25s, top .35s var(--l-mola);
}
.campo-login input:focus + .campo-rotulo,
.campo-login input:not(:placeholder-shown) + .campo-rotulo {
    top: 17px;
    transform: translateY(-50%) scale(.74);
    color: var(--l-marca);
    font-weight: 600;
}
.campo-icone {
    position: absolute;
    left: 17px;
    top: 50%;
    width: 24px;
    height: 24px;
    transform: translateY(-50%);
    z-index: 2;
    color: #7d8c95;
    transition: color .25s, transform .45s var(--l-mola);
}
.campo-icone svg { width: 100%; height: 100%; display: block; }
.campo-login:focus-within .campo-icone { color: var(--l-marca); transform: translateY(-50%) scale(1.12); }

/* olho: mostrar senha */
.olho {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 46px;
    height: 46px;
    transform: translateY(-50%);
    z-index: 2;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #6c7c86;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .2s, color .2s, transform .3s var(--l-mola);
}
.olho:hover { background: rgba(11, 114, 133, .08); color: var(--l-marca); }
.olho:active { transform: translateY(-50%) scale(.88); }
.olho svg { width: 24px; height: 24px; grid-area: 1 / 1; transition: opacity .2s, transform .35s var(--l-mola); }
.olho .olho-fechado { opacity: 0; transform: scale(.6) rotate(-20deg); }
.olho.mostrando .olho-aberto { opacity: 0; transform: scale(.6) rotate(20deg); }
.olho.mostrando .olho-fechado { opacity: 1; transform: none; }
.olho:focus-visible { outline: 3px solid rgba(11, 114, 133, .45); outline-offset: 1px; }

/* ---------- Erro ---------- */
.erro-login {
    margin: 14px 0 0;
    padding: 11px 14px;
    border-radius: 12px;
    background: #fde8e6;
    border: 1px solid rgba(217, 48, 37, .22);
    color: #b3261e;
    font-size: 16px;
    font-weight: 600;
    animation: subir .45s var(--l-mola) both;
}
.erro-login[hidden] { display: none; }
.balancar { animation: balancar .6s cubic-bezier(.36, .07, .19, .97) both !important; }
.balancar .campo-login input { border-color: rgba(217, 48, 37, .55); }
@keyframes balancar {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(5px); }
    30%, 50%, 70% { transform: translateX(-12px); }
    40%, 60% { transform: translateX(12px); }
}

/* ---------- Botão Entrar ---------- */
.botao-entrar {
    position: relative;
    width: 100%;
    height: 60px;
    margin-top: 18px;
    border: 0;
    border-radius: 16px;
    font: inherit;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: .01em;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(180deg, #13899d, var(--l-marca) 55%, var(--l-marca-escura));
    box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 12px 26px -10px rgba(11, 114, 133, .8);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform .4s var(--l-mola), box-shadow .3s, filter .25s, opacity .25s;
    animation: subir .7s var(--l-suavizar) .66s both;
}
.botao-entrar::after {
    /* brilho que atravessa o botão quando os campos estão preenchidos */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
    transform: translateX(-120%);
}
.pronto .botao-entrar::after { animation: brilho 2.6s ease-in-out .3s infinite; }
.botao-entrar:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 18px 32px -12px rgba(11, 114, 133, .9); filter: brightness(1.06); }
.botao-entrar:active { transform: scale(.97); }
.botao-entrar:focus-visible { outline: 4px solid rgba(11, 114, 133, .4); outline-offset: 3px; }
.botao-seta { width: 22px; height: 22px; transition: transform .45s var(--l-mola); }
.botao-entrar:hover .botao-seta { transform: translateX(5px); }

.botao-girando {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .2s, transform .35s var(--l-mola);
}
.entrando .botao-entrar { pointer-events: none; }
.entrando .botao-texto, .entrando .botao-seta { opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s; }
.entrando .botao-girando { opacity: 1; transform: none; animation: girar .7s linear infinite; }

@keyframes brilho { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(120%); } }
@keyframes girar { to { transform: rotate(360deg); } }

.ajuda-login {
    margin: 18px 0 0;
    font-size: 15px;
    color: var(--l-suave);
    animation: subir .7s var(--l-suavizar) .74s both;
}

.rodape-login {
    margin: 22px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, .92);
    background: rgba(255, 255, 255, .14);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    animation: subir .8s var(--l-suavizar) .9s both;
}
.rodape-login svg { width: 18px; height: 18px; }

/* ---------- Entradas ---------- */
@keyframes descer { from { opacity: 0; transform: translateY(-24px) scale(.96); } }
@keyframes surgir { from { opacity: 0; transform: translateY(40px) scale(.92); } }
@keyframes subir { from { opacity: 0; transform: translateY(12px); } }
@keyframes pular { from { opacity: 0; transform: scale(.4) rotate(-12deg); } }

/* ---------- Celular: igual iPhone ---------- */
@media (max-width: 520px) {
    body.tela-login { padding-top: max(36px, env(safe-area-inset-top)); }
    .cartao-login { padding: 26px 20px 22px; border-radius: 26px; }
    .cartao-login h1 { font-size: 27px; }
}
@media (max-height: 760px) and (min-width: 521px) {
    body.tela-login { padding-top: 22px; }
    .relogio-hora { font-size: 72px; }
    .entrada { margin-top: 16px; }
    .cartao-login { padding-top: 26px; padding-bottom: 20px; }
    .subtitulo { margin-bottom: 16px; }
    .rodape-login { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Rodapé Kairos (igual aos outros sistemas Kairos) ---------- */
.rodape-kairos {
    position: relative;
    z-index: 1;
    align-self: stretch;
    margin: auto -16px -24px;
    padding: 12px 28px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    background: rgba(8, 20, 28, .62);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    border-top: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .7);
    animation: subir .8s var(--l-suavizar) 1s both;
}
.kairos-autor { display: flex; align-items: center; gap: 10px; justify-self: start; font-size: 12.5px; font-weight: 600; }
.kairos-autor img { height: 28px; width: auto; transition: transform .45s var(--l-mola), filter .3s; }
.kairos-autor:hover img { transform: scale(1.06); filter: drop-shadow(0 0 10px rgba(90, 140, 255, .55)); }
.kairos-modulos { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.kairos-modulos span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .07);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
}
.kairos-modulos .icon { width: 16px; height: 16px; color: #6fd3e0; }
.kairos-redes { display: flex; gap: 9px; justify-self: end; }
.rede {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    transition: transform .4s var(--l-mola), box-shadow .3s;
}
.rede .icon { width: 18px; height: 18px; }
a.rede:hover { transform: translateY(-3px) scale(1.1); box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .5); }
span.rede { opacity: .85; }
.rede-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.rede-facebook { background: #1877f2; }
.rede-whatsapp { background: #25d366; }
.rede-site { background: #475569; }

@media (max-width: 860px) {
    .rodape-kairos { grid-template-columns: 1fr; justify-items: center; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
    .kairos-autor, .kairos-redes { justify-self: center; }
    .kairos-modulos { display: none; }
}
@media (max-height: 760px) and (min-width: 861px) {
    .rodape-kairos { padding-top: 8px; padding-bottom: 8px; }
    .rodape-login { display: none; }
}

/* ---------- Logo da clínica fora do cartão (canto de cima) ---------- */
.marca-clinica {
    position: fixed;
    top: 18px;
    left: 22px;
    z-index: 2;
    padding: 10px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .8);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, .7);
    box-shadow: 0 14px 40px -14px rgba(0, 30, 40, .5);
    animation: descer .9s var(--l-mola) .1s both;
    transition: transform .45s var(--l-mola);
}
.marca-clinica:hover { transform: translateY(-2px) scale(1.03); }
.marca-clinica img { display: block; height: clamp(44px, 7vh, 64px); width: auto; }
.cartao-login { padding-top: clamp(22px, 3.6vh, 34px); }

/* ---------- Sem barra de rolagem: tudo se ajusta à altura da tela ---------- */
html, body { scrollbar-width: none; }
::-webkit-scrollbar { display: none; width: 0; height: 0; }
body.tela-login { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; padding-top: clamp(14px, 5vh, 72px); }
.relogio-hora { font-size: clamp(54px, min(13vw, 12.5vh), 128px); }
.relogio-data { font-size: clamp(15px, 2.4vh, 21px); }
.entrada { margin-top: clamp(10px, 3vh, 48px); }
.cartao-login h1 { font-size: clamp(24px, 3.6vh, 30px); }
.subtitulo { margin-bottom: clamp(12px, 2.2vh, 22px); }
.campo-login input { height: clamp(52px, 7.4vh, 62px); }
.botao-entrar { height: clamp(50px, 7vh, 60px); margin-top: clamp(12px, 2vh, 18px); }
.ajuda-login { margin-top: clamp(10px, 1.8vh, 18px); }
@media (max-height: 700px) {
    .ajuda-login, .subtitulo { display: none; }
    .cartao-login h1 { margin-bottom: 12px; }
}
/* Monitor largo e baixo: logo no canto não encosta no relógio */
@media (max-width: 1100px) and (min-width: 861px) {
    .marca-clinica img { height: 40px; }
}
/* Celular: logo pequena em cima, centralizada */
@media (max-width: 860px) {
    body.tela-login { overflow-y: auto; height: auto; min-height: 100dvh; }
    .marca-clinica { position: relative; top: auto; left: auto; margin: 0 auto 14px; padding: 8px 14px; }
    .marca-clinica img { height: 42px; }
}
.marca-clinica-texto { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--l-texto); max-width: 260px; }
.marca-clinica-texto span { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 20px; background: linear-gradient(180deg, #13899d, var(--l-marca)); }

/* Caixa da demonstração */
.demo-acesso { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .7); border: 1px dashed rgba(11, 114, 133, .45); display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--l-suave); }
.demo-acesso strong { color: var(--l-marca); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.demo-acesso b { color: var(--l-texto); }
.demo-botao { margin-top: 6px; height: 42px; border: 0; border-radius: 12px; font: inherit; font-weight: 700; font-size: 15px; color: var(--l-marca); background: rgba(11, 114, 133, .12); cursor: pointer; transition: transform .35s var(--l-mola), background .2s; }
.demo-botao:hover { background: rgba(11, 114, 133, .2); transform: translateY(-1px); }
