/* Login GHPRO — fundo estilo admin (só CSS, sem foto); parallax nas camadas; faixa junto a login/senha */

:root {
    --admin-bg-0: #070f18;
    --admin-bg-1: #0c1829;
    --admin-bg-2: #0f2238;
    --admin-accent-a: rgba(56, 189, 248, 0.45);
    --admin-accent-b: rgba(99, 102, 241, 0.4);
    --admin-accent-c: rgba(20, 184, 166, 0.35);
    --login-mesh-a: rgba(56, 189, 248, 0.42);
    --login-mesh-b: rgba(45, 212, 191, 0.34);
    --login-mesh-c: rgba(129, 140, 248, 0.28);
    --login-card: rgba(255, 255, 255, 0.94);
    --login-ink: #1a2332;
    --login-muted: #5c6573;
    --login-border: rgba(148, 163, 184, 0.45);
    --login-primary: #0d4f7c;
    --login-primary-hover: #0a3f63;
    --login-accent: #0a7c6e;
    --login-danger: #c62828;
    --login-font: "Source Sans Pro", system-ui, -apple-system, sans-serif;
    --login-shell-max: 420px;
    --strip-w: 5px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Base admin estática (camadas animadas ficam em .login-bg — elementos reais = animação contínua) */
html {
    min-height: 100%;
    margin: 0;
    background-color: var(--admin-bg-0);
    background-image:
        radial-gradient(ellipse 100% 70% at 90% -10%, var(--admin-accent-a), transparent 55%),
        radial-gradient(ellipse 80% 60% at -5% 105%, var(--admin-accent-b), transparent 52%),
        radial-gradient(ellipse 55% 45% at 50% 100%, var(--admin-accent-c), transparent 60%),
        linear-gradient(155deg, var(--admin-bg-1) 0%, var(--admin-bg-2) 48%, #0a1524 100%);
    background-size: cover;
}

/* Blobs coloridos no fundo — só opacity/transform (sem traços, sem filter em pseudo do body) */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-bg__blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.55;
    will-change: transform, opacity;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

.login-bg__blob--1 {
    width: min(85vw, 720px);
    height: min(85vw, 720px);
    left: -18%;
    top: -22%;
    background: radial-gradient(circle at 35% 35%, rgba(56, 189, 248, 0.65), rgba(56, 189, 248, 0.08) 62%, transparent 72%);
    animation-name: loginBlobA;
    animation-duration: 34s;
}

.login-bg__blob--2 {
    width: min(75vw, 620px);
    height: min(75vw, 620px);
    right: -20%;
    bottom: -18%;
    background: radial-gradient(circle at 60% 45%, rgba(99, 102, 241, 0.55), rgba(129, 140, 248, 0.1) 58%, transparent 70%);
    animation-name: loginBlobB;
    animation-duration: 41s;
}

.login-bg__blob--3 {
    width: min(65vw, 520px);
    height: min(65vw, 520px);
    left: 22%;
    bottom: -12%;
    background: radial-gradient(circle at 50% 50%, rgba(45, 212, 191, 0.45), rgba(20, 184, 166, 0.08) 55%, transparent 68%);
    animation-name: loginBlobC;
    animation-duration: 29s;
}

@keyframes loginBlobA {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.42;
    }
    100% {
        transform: translate3d(6vw, 10vh, 0) scale(1.12);
        opacity: 0.62;
    }
}

@keyframes loginBlobB {
    0% {
        transform: translate3d(0, 0, 0) scale(1.05);
        opacity: 0.38;
    }
    100% {
        transform: translate3d(-8vw, -7vh, 0) scale(1.18);
        opacity: 0.58;
    }
}

@keyframes loginBlobC {
    0% {
        transform: translate3d(-4vw, 2vh, 0) scale(1);
        opacity: 0.35;
    }
    100% {
        transform: translate3d(10vw, -5vh, 0) scale(1.14);
        opacity: 0.52;
    }
}

body.login-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--login-font);
    font-size: 16px;
    line-height: 1.45;
    color: var(--login-ink);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 2.5rem);
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
}

.login-shell {
    width: 100%;
    max-width: var(--login-shell-max);
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
}

@media (max-width: 900px) {
    .login-shell {
        max-width: min(100%, 440px);
    }
}

@media (max-width: 480px) {
    body.login-body {
        align-items: center;
    }

    .login-shell {
        max-width: 100%;
    }
}

/* Cartão centralizado — cantos uniformes */
.login-form {
    float: none;
    width: 100%;
    position: static;
    margin: 0;
    padding: clamp(1.35rem, 4vw, 2.15rem);
    background: var(--login-card);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 22px;
    box-shadow:
        0 4px 24px rgba(15, 23, 42, 0.06),
        0 28px 70px rgba(0, 10, 30, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.login-form .logo,
.login-form .logo2 {
    text-indent: -999px;
    overflow: hidden;
    margin: 0 auto;
    padding: 10px 0;
}

.login-form .logo {
    width: 235px;
    height: 56px;
    background: url("../../prosaude-logo.png") center center no-repeat;
    background-size: contain;
}

.login-form .logo2 {
    width: 215px;
    height: 56px;
    background: url("../../logo.png") center center no-repeat;
    background-size: contain;
}

.login-form .login-return {
    display: block;
    width: 100%;
    line-height: 1.35;
    text-align: center;
    margin: 0 0 12px;
    font-weight: 700;
    color: #fff;
    background: var(--login-danger);
    padding: 10px 12px;
    border-radius: 12px 6px 12px 6px;
    font-size: 14px;
}

/* Faixa vertical só no bloco login + senha */
.login-form .login-inputs {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    margin: 14px 0;
    padding-left: calc(var(--strip-w) + 2px);
    border: none;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
    box-shadow:
        inset 0 0 0 1px var(--login-border),
        0 12px 36px rgba(15, 23, 42, 0.1);
}

.login-form .login-inputs::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--strip-w);
    background: linear-gradient(180deg, #38bdf8 0%, #6366f1 48%, #14b8a6 100%);
    border-radius: 18px 0 0 18px;
    box-shadow: 2px 0 16px rgba(56, 189, 248, 0.35);
    animation: loginStripGlow 6s ease-in-out infinite alternate;
}

@keyframes loginStripGlow {
    0% {
        opacity: 0.82;
    }
    100% {
        opacity: 1;
    }
}

.login-form .login-inputs input {
    display: block;
    width: 100%;
    height: 50px;
    background: transparent;
    border: 0 none;
    text-align: left;
    padding: 0 14px 0 46px;
    line-height: 50px;
    color: var(--login-ink);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
}

.login-form .login-inputs input:first-child {
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%235c6573' stroke-width='1.5'%3E%3Cpath d='M10 10a3 3 0 100-6 3 3 0 000 6zM4 18a6 6 0 0112 0'/%3E%3C/svg%3E") 16px center no-repeat;
}

.login-form .login-inputs input:last-child {
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%235c6573' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 9.5V7a3.5 3.5 0 117 0v2.5'/%3E%3Crect x='4' y='9.5' width='12' height='9' rx='2'/%3E%3Ccircle cx='10' cy='14' r='1' fill='%235c6573' stroke='none'/%3E%3C/svg%3E") 16px center no-repeat;
}

.login-form .submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--login-primary) 0%, #0a3555 100%);
    color: #fff;
    text-align: center;
    line-height: 1;
    border: 0 none;
    font-weight: 700;
    font-size: 15px;
    border-radius: 14px 8px 14px 8px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 10px 28px rgba(13, 79, 124, 0.35);
    transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.login-form .submit-button:hover {
    background: linear-gradient(135deg, var(--login-primary-hover) 0%, #082a44 100%);
    box-shadow: 0 12px 32px rgba(13, 79, 124, 0.42);
}

.login-form .submit-button:active {
    transform: translateY(1px);
}

.login-form .submit-button:focus-visible {
    outline: 2px solid var(--login-accent);
    outline-offset: 2px;
}

.login-form .login-help {
    font-size: 14px;
    color: var(--login-muted);
    text-align: center;
    margin: 18px 0 12px;
    display: block;
}

.login-form .login-help a {
    font-weight: 700 !important;
    font-size: 14px;
    background-color: transparent;
    text-decoration: none;
    color: var(--login-primary) !important;
}

.login-form .login-help a:hover {
    text-decoration: underline;
}

/* Rodapé: versão em destaque + chips harmônicos + selos */
.login-meta {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
}

.login-meta__version {
    text-align: center;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(13, 79, 124, 0.08), rgba(56, 189, 248, 0.06));
    border: 1px solid rgba(13, 79, 124, 0.12);
}

.login-meta__version-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--login-muted);
    margin-bottom: 0.2rem;
}

.login-meta__version-num {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--login-primary);
    line-height: 1.2;
}

.login-meta__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: stretch;
}

.login-meta__chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.45rem 0.65rem;
    min-width: 0;
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 0.72rem;
    color: var(--login-muted);
    line-height: 1.3;
    text-align: center;
}

.login-meta__chip-k {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--login-muted);
}

.login-meta__chip-v {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--login-ink);
    word-break: break-all;
}

.login-meta__chip--ip .login-meta__chip-v {
    font-family: ui-monospace, monospace;
    font-size: 0.74rem;
    color: #b91c1c;
}

.login-meta__chip--warn {
    background: rgba(254, 226, 226, 0.85);
    border-color: rgba(248, 113, 113, 0.45);
    color: #991b1b;
}

.login-meta__chip--warn .login-meta__chip-v {
    font-weight: 700;
}

.login-meta__chip--lic {
    background: rgba(254, 243, 199, 0.9);
    border-color: rgba(251, 191, 36, 0.55);
}

.login-meta__chip--lic .login-meta__chip-k {
    color: #92400e;
}

.login-meta__chip--lic .login-meta__chip-v {
    color: #b45309;
    word-break: normal;
}

.login-meta__chip--lic-urgente {
    animation: login-lic-pisca-forte 0.75s ease-in-out infinite;
}

@keyframes login-lic-pisca-forte {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.45); }
    50% { opacity: 0.55; box-shadow: 0 0 12px 2px rgba(248, 113, 113, 0.75); }
}

.login-selos-wrap {
    text-align: center;
    margin-top: 0.35rem;
}

.login-selos-label {
    margin: 0 0 0.2rem;
    line-height: 1.15;
    font-size: 0.45rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--login-muted);
}

.login-selos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.login-selos li {
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 0;
}

.login-selos img {
    height: 34px;
    width: auto;
    max-width: 72px;
    object-fit: contain;
    opacity: 0.95;
    transition: opacity 0.15s ease;
}

.login-selos img:hover {
    opacity: 1;
}

.prelogin-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.prelogin-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.42);
    backdrop-filter: blur(4px);
}

.prelogin-modal__panel {
    position: relative;
    z-index: 1;
    width: min(94vw, 700px);
    height: auto;
    max-height: 86vh;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 26px 70px rgba(2, 6, 23, 0.42);
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

.prelogin-form {
    margin: 0;
    width: 100%;
    background: transparent;
}

.prelogin-form__bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.15rem;
    background: linear-gradient(135deg, rgba(31, 118, 178, 0.95), rgba(24, 143, 184, 0.92));
    color: #f8fafc;
    border-radius: 0;
}

.prelogin-form__bar-icon {
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: none;
}

.prelogin-form__bar-title {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.prelogin-form__body {
    padding: 1.1rem 1.15rem 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.prelogin-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.prelogin-label {
    color: #f8fafc;
    font-size: 1.04rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(2, 6, 23, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.prelogin-label__icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    opacity: 0.98;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.prelogin-control {
    position: relative;
}

.prelogin-select {
    width: 100%;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 600;
    padding: 0 0.95rem;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.prelogin-select:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.22);
}

.prelogin-form__actions {
    padding: 0.9rem 1.15rem 1.15rem;
    display: flex;
    justify-content: flex-end;
}

.prelogin-submit {
    min-width: 220px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #1f76b2, #2596bf);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(31, 118, 178, 0.38);
}

.prelogin-submit:hover {
    filter: brightness(1.05);
}

.prelogin-modal__panel--enter {
    animation: modalFromBack 280ms cubic-bezier(.2,.9,.2,1) both;
    transform-origin: center center;
}

@keyframes modalFromBack {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0) scale(.92);
        filter: blur(6px);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}

@media (max-width: 768px) {
    .prelogin-modal {
        padding: 0.65rem;
    }

    .prelogin-modal__panel {
        width: min(96vw, 620px);
        max-height: 88vh;
        border-radius: 18px;
    }

    .prelogin-form__bar-title {
        font-size: 0.95rem;
    }

    .prelogin-label {
        font-size: 0.96rem;
    }

    .prelogin-select {
        height: 44px;
        font-size: 0.94rem;
    }

    .prelogin-submit {
        width: 100%;
        min-width: 0;
        height: 44px;
        font-size: 0.95rem;
    }
}

@media (max-width: 520px) {
    .login-meta__version-num {
        font-size: 1.2rem;
    }

    .login-meta__chips {
        flex-direction: column;
    }

    .login-meta__chip {
        width: 100%;
    }

    .login-selos img {
        max-width: 64px;
        height: 16px;
    }

    .login-selos-label {
        font-size: 0.4rem;
    }
}

input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    cursor: pointer;
    display: block;
    width: 8px;
    color: #333;
    text-align: center;
    position: relative;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
    margin: 0;
}

html * {
    outline: 0 none !important;
}

@media (prefers-reduced-motion: reduce) {
    .login-bg__blob,
    .login-form .login-inputs::before {
        animation: none !important;
    }

    .login-bg__blob {
        opacity: 0.48 !important;
        transform: none !important;
    }

    .login-form .submit-button {
        transition: none;
    }

    .login-form .submit-button:active {
        transform: none;
    }
}
