@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=PT+Sans&family=Poppins:wght@300;400;500;600;700;800&display=swap');

* {
    font-family: PT sans;
}

body {
    display: flex;
    justify-content: center;
    margin: 0;
}

.container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding-top: 48px;
}

.logo img {
    height: 57.41px;
    width: 140px;
}

.login-container {
    display: flex;
    justify-content: center;
    flex-direction: column;
    min-height: 158px;
    width: 100%;
    padding: 14px;
    max-width: 385px;
    gap: 64px;
}

.login-container .inputs {
    width: 100%;
}

.input {
    position: relative;
    padding-right: 30px;
    display: flex;
    flex-direction: column;
    border: 1px solid #DDDDDD;
    border-radius: 10px;
    height: 18px;
    padding: 14px;
    margin-bottom: 16px;
    box-sizing: content-box;
}

.input:focus-within {
    border: 1px solid #00469B;
    outline: none;
}

.input .icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
}

.input .icon i {
    color: #BFBFBF;
    font-size: 16px;
    outline: none;
}


.input label {
    position: absolute;
    margin-left: 0px;
    margin-top: -26px;
    background-color: #FFF;
}

.input input {
    border: none;
    outline: none;
}

.buttons {
    display: flex;    
    gap: 12px;
    align-self: stretch;
}

.flex-end {
    justify-content: flex-end;
}

.space-between {
    justify-content: space-between !important;
}

.button {
    border-radius: 200px;
    display: flex;
    height: 40px;
    padding: 5px 20px;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.link {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 4px;
}

.txt-white {
    color: #FFF;
}

.outline {
    border: 1px solid #00469B;
}

.fill {
    background-color: #00469B;
    color: #FFF !important;
}

.login-container .buttons input {
    background-color: transparent;
    border: none;
    display: flex;
}

.login-container .buttons a {
    text-decoration: none;
    color: #00469B;
}

.alert-error {
    width: 100%;
    max-width: 339px;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 0 auto 16px auto;
    background-color: #FDECEA;
    border: 1px solid #E74C3C;
    color: #A93226;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.4;
}

.alert-error-icon {
    color: #E74C3C;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-error-message {
    flex: 1;
}

.toaster {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    height: 57px;
    border-radius: 10px;
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background-color: #FFF;
    box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.15);
    animation: fadeInOut .4s ease-in-out;
    z-index: 9999;
}

.message {
    margin-bottom: 15px;
}

.none {
    display: none;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.toaster .content {
    display: flex;
    max-width: 300px;
    max-width: 500px;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.toaster .icon {
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toaster-message {
    color: #363632;
    font-size: 14px;
}

.success {
    font-weight: 700;
    color: #008A17
}

.danger {
    font-weight: 700;
    color: #CC0000;
}

.toaster-content {
    display: flex;
    justify-content: space-between;
}

.toaster-action {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: auto;
    padding: 16px 0;
}

.footer-logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-logo img {
    width: 130px;
    height: 17px;
}

.copyright {
    margin-top: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer span {
    color: #BFBFBF;
}

.footer .copyright span, .footer .copyright a {
    color: #BFBFBF;
    text-decoration: none;
}

.kc-page-container a {
    color: #00469B;
    text-decoration: underline;
}

.kc-page-container a:hover {
    text-decoration: none;
}

.links {
    display: flex;
    justify-content: center;
    align-items: center;
}

.links span {
    color: #BFBFBF;
}

.footer .links a {
    text-decoration: none;
    color: #BFBFBF;
}

.spinner {
    width: 64px;
    height: 64px;
}

.login-button {
    background-color: #00469B !important;
    color: #FFF;
    border-radius: 200px;
    display: flex;
    padding: 5px 20px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-width: 87px;
    height: 50px;
}

.login-button:hover {
    cursor: pointer;
}


@keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    100% {
        -webkit-transform: rotate(270deg);
        transform: rotate(270deg);
    }
}

.path {
    stroke-dasharray: 187;
    stroke-dashoffset: 0;    
    transform-origin: center;
    animation: dash 1.4s linear infinite, colors 5.6s linear infinite;
}

@keyframes colors {

    0% {
        stroke: #00469B;
      }     
      100% {
        stroke: #00469B;
      }
}

@keyframes dash {
    0% {
        stroke-dashoffset: 187;
    }

    50% {
        stroke-dashoffset: 46.75;        
        transform: rotate(135deg);
    }

    100% {
        stroke-dashoffset: 187;        
        transform: rotate(450deg);
    }
}


input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #FFF inset !important;
    box-shadow: 0 0 0 1000px #FFF inset !important;
}

.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 16px;
}

.kc-page-container {
    width: 100%;
    max-width: 900px;
    padding: 24px 32px;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kc-page-container > * {
    width: 100%;
}

.kc-page-container > .login-container {
    max-width: 385px;
}

.kc-totp-already {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px;
    text-align: center;
    line-height: 1.5;
}

.kc-totp-already p {
    margin-bottom: 16px;
}

.kc-totp-already form {
    margin-top: 24px;
}

.kc-totp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.kc-totp-instructions {
    padding-right: 16px;
}

.kc-totp-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.kc-totp-action #kc-totp-secret-qr-code {
    width: 240px;
    height: 240px;
    margin: 0;
}

.kc-totp-action > form {
    width: 100%;
    margin-top: 16px;
}

@media screen and (max-width: 768px) {
    .kc-totp-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .kc-totp-instructions {
        padding-right: 0;
    }
}

.kc-page-container ol {
    padding-left: 28px;
    margin: 0 0 24px 0;
}

.kc-page-container ol > li {
    margin-bottom: 24px;
    line-height: 1.5;
}

.kc-page-container ol > li > p {
    margin: 0 0 12px 0;
}

.kc-page-container ul {
    padding-left: 24px;
    margin: 8px 0 0 0;
    list-style: disc;
}

.kc-page-container ul > li {
    margin-bottom: 4px;
    line-height: 1.5;
}


#kc-totp-secret-key {
    display: inline-block;
    margin: 8px 0;
    padding: 8px 12px;
    background: #F5F5F5;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    letter-spacing: 1px;
    word-break: break-all;
}

.kc-page-container form {
    margin-top: 24px;
}

.kc-page-container .pf-v5-c-form__group {
    margin-bottom: 16px;
}

.kc-page-container #kc-form-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

@media screen and (max-width: 600px) {
    .kc-page-container {
        padding: 16px;
    }
}

.social-providers {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.social-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: #BFBFBF;
    font-size: 12px;
}

.social-separator::before,
.social-separator::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #DDDDDD;
}

.social-separator span {
    padding: 0 12px;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 44px;
    border: 1px solid #DDDDDD;
    border-radius: 200px;
    color: #363632 !important;
    text-decoration: none !important;
    font-weight: 500;
    transition: background-color 0.15s ease;
}

.social-button:hover {
    background-color: #F5F5F5;
}

.social-button i {
    font-size: 18px;
}

.social-google i { color: #DB4437; }
.social-microsoft i { color: #00A4EF; }

@media screen and (max-width: 600px) {

    .link {
        display: flex;
        justify-content: flex-start;
    }

    .buttons {
        flex-direction: column-reverse;
    }

    .buttons-container {
        margin-top: 32px;
    }
}

@media screen and (max-width: 360px) {

    form {
        padding: 0px 10px;
    }

    .message {
        padding: 0px 10px;
    }

    .toaster {
        width: 308px;
    }

    .login-button {
        height: 50px;
    }
}
/* Botão de passkey (Opção A) — alternativa à senha, na mesma tela.
   O id é o que a macro passkeys.conditionalUIData emite; estilizamos
   aqui porque o tema não define as classes kcButton* do tema base. */
.passkey-login {
    /* order:1 move o botao de passkey para DEPOIS do bloco social, ficando
       abaixo de Google/Microsoft (agrupado com as demais formas de entrar).
       .passkey-login e .social-providers sao irmaos no .login-container (flex),
       entao basta o order — sem mexer no DOM/macro.
       O container usa gap:64px; as margens negativas encolhem esse gap: com
       order:1 o -48 controla o espaco social -> passkey (~16px). */
    order: 1;
    margin-top: -48px;
    margin-bottom: -52px;
    width: 100%;
}
/* O bloco contem um <form id="webauth"> OCULTO (usado pelo WebAuthn via JS).
   Sendo um <form> dentro do .kc-page-container, ele herdava
   `.kc-page-container form { margin-top: 24px }` e criava 24px de espaco vazio
   ACIMA do botao. Zeramos essa margem do form oculto. */
.passkey-login > form {
    margin-top: 0;
}
/* O .social-providers tem margin-top:24px proprio; logo apos o passkey isso
   somava ao espaco de baixo do botao e empurrava Google/Microsoft p/ fora da
   tela. Zera so nesse caso. */
.passkey-login + .social-providers {
    margin-top: 0;
}
#authenticateWebAuthnButton {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 44px;
    border: 1px solid #00469B;
    border-radius: 200px;
    color: #00469B !important;
    background-color: #FFF;
    text-decoration: none !important;
    font-weight: 500;
    transition: background-color 0.15s ease;
}
#authenticateWebAuthnButton::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f084"; /* fa-key */
    font-size: 16px;
}
#authenticateWebAuthnButton:hover {
    background-color: #F0F5FC;
    cursor: pointer;
}
/* O botao vem do keycloak.v2 com classes PatternFly (pf-m-secondary), que
   desenha a borda num pseudo-elemento sobreposto (.pf-v5-c-button::after).
   Como ja damos a nossa propria `border` no <a>, zeramos a do ::after,
   senao o botao fica com duas bordas concentricas. */
#authenticateWebAuthnButton::after {
    border: 0 !important;
}
/* Restaura o foco de teclado (a11y): o PF indicava o foco justamente pela
   borda do ::after (que zeramos acima). */
#authenticateWebAuthnButton:focus-visible {
    outline: 2px solid #00469B;
    outline-offset: 2px;
}

/* Reautenticacao (confirmar senha p/ acao de seguranca): mensagem + usuario fixo */
.reauth-message {
    margin: 0 0 16px;
    color: #4A4A4A;
    font-size: 14px;
    line-height: 1.4;
}

.reauth-username {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #DDDDDD;
    border-radius: 10px;
    background-color: #F7F9FC;
    color: #00469B;
    font-weight: 600;
    word-break: break-all;
}

/* ===== Passo "Reforçar a conta" (offer-enrollment.ftl) ===== */
.enroll-form { width: 100%; display: flex; flex-direction: column; }
/* Só na tela "Reforçar conta": desliga a centralização vertical do card
   (que criava espaço acima do título) e aproxima o card da logo. */
.login-container--enroll { justify-content: flex-start; min-height: 0; gap: 0; margin-top: -60px; }
.enroll-head { text-align: center; margin-bottom: 22px; }
.enroll-badge {
    display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: #00469B; background: #eef4ff; border: 1px solid #e0e5ee;
    padding: 3px 10px; border-radius: 999px; margin-bottom: 11px;
}
.enroll-title { margin: 0 0 7px; font-size: 20px; font-weight: 800; letter-spacing: -.015em; color: #1e2632; }
.enroll-sub { margin: 0; font-size: 13px; color: #7a8390; line-height: 1.65; }
.enroll-sub b { color: #1e2632; font-weight: 700; }
.enroll-card {
    display: flex; align-items: center; gap: 13px; width: 100%;
    text-align: left; font: inherit; color: inherit; cursor: pointer; margin-bottom: 11px;
    padding: 14px; border: 1px solid #e0e5ee; border-radius: 14px; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.enroll-card:hover { border-color: #00469B; box-shadow: 0 0 0 3px rgba(0,70,155,.12); }
.enroll-card:focus-visible { outline: 2px solid #00469B; outline-offset: 2px; }
.enroll-ic {
    flex: none; width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center; background: #e7eefb; color: #00469B;
}
.enroll-ic svg { width: 21px; height: 21px; }
.enroll-tx { flex: 1; min-width: 0; }
.enroll-tx > b { display: block; font-size: 14px; color: #1e2632; margin-bottom: 2px; }
.enroll-tx > span:not(.enroll-compat) { display: block; font-size: 12px; color: #7a8390; line-height: 1.45; }
.enroll-tx span b { color: #1e2632; font-weight: 700; }
.enroll-go { flex: none; color: #c2c9d3; font-size: 22px; line-height: 1; }
.enroll-compat {
    display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700;
    color: #008A17; background: rgba(0,138,23,.12); border-radius: 999px; padding: 2px 8px; margin-top: 6px;
}
.enroll-compat svg { width: 11px; height: 11px; flex: none; }
.enroll-explain { margin: 2px 2px 14px; }
.enroll-explain summary { cursor: pointer; font-size: 12px; color: #00469B; font-weight: 600; list-style: none; }
.enroll-explain summary::-webkit-details-marker { display: none; }
.enroll-explain p {
    font-size: 12px; color: #7a8390; line-height: 1.55; margin: 8px 2px 0;
    background: #F0F5FC; border: 1px solid #e0e5ee; border-radius: 10px; padding: 10px 12px;
}
.enroll-skip {
    width: 100%; padding: 13px; border-radius: 12px; border: 1.5px solid #00469B;
    background: #00469B; color: #fff; font: inherit; font-weight: 700; font-size: 14.5px;
    cursor: pointer; margin-top: 4px;
}
.enroll-skip:hover { background: #0a5bd1; border-color: #0a5bd1; }
.enroll-skip:focus-visible { outline: 3px solid rgba(0,70,155,.45); outline-offset: 3px; }
.enroll-skipnote { text-align: center; font-size: 12px; color: #7a8390; margin: 9px 2px 0; line-height: 1.5; }
.enroll-none { text-align: center; padding: 6px 0 4px; margin-bottom: 12px; }
.enroll-none-ic {
    width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 14px;
    display: grid; place-items: center; background: rgba(0,138,23,.14); color: #008A17;
}
.enroll-none-ic svg { width: 32px; height: 32px; }

/* ===== Tela de OTP / MFA (login-otp.ftl) ===== */
.otp-form { width: 100%; display: flex; flex-direction: column; }
.otp-head { text-align: center; margin-bottom: 18px; }
.otp-title { margin: 0 0 6px; font-size: 19px; font-weight: 700; color: #1e2632; letter-spacing: -.01em; }
.otp-sub { margin: 0; font-size: 13px; color: #7a8390; line-height: 1.5; }
.otp-boxes { display: flex; gap: 9px; justify-content: center; margin: 4px 0 18px; }
.otp-box {
    width: 44px; height: 52px; text-align: center;
    font-size: 20px; font-weight: 700; color: #1e2632;
    border: 1px solid #c9d0da; border-radius: 10px; background: #fff;
    -moz-appearance: textfield;
}
.otp-box::-webkit-outer-spin-button, .otp-box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.otp-box:focus { outline: none; border-color: #00469B; box-shadow: 0 0 0 3px rgba(0,70,155,.12); }
.otp-submit { margin-top: 2px; }
.otp-error { display: block; text-align: center; color: #d13438; font-size: 12.5px; margin: -8px 0 14px; }
/* Seleção de credencial (mais de um OTP) */
.otp-credentials { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.otp-cred-input { position: absolute; opacity: 0; pointer-events: none; }
.otp-cred-label {
    display: block; padding: 11px 14px; border: 1px solid #d7dde6; border-radius: 10px;
    font-size: 13.5px; color: #1e2632; cursor: pointer; background: #fff;
}
.otp-cred-input:checked + .otp-cred-label { border-color: #00469B; box-shadow: 0 0 0 2px rgba(0,70,155,.12); }

/* ===== Cadastro de passkey (webauthn-register.ftl / webauthn-error.ftl) =====
   Reaproveita .enroll-* do offer-enrollment; aqui só o que é próprio da tela. */
.login-container--enroll.pk-reg-wrap { margin-top: 0; }
.pk-reg .enroll-head { margin-bottom: 18px; }
.pk-reg-ic {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; margin-bottom: 12px; border-radius: 50%;
    background: #EEF4FC; color: #00469B;
}
.pk-reg-ic svg { width: 28px; height: 28px; }
.kc-page-container ol.pk-reg-steps {
    margin: 0 0 20px; padding: 14px 16px 14px 34px;
    border: 1px solid #e3e8ef; border-radius: 12px; background: #F7F9FC;
}
.kc-page-container ol.pk-reg-steps > li { font-size: 13px; color: #4A4A4A; line-height: 1.5; margin: 0 0 6px; }
.kc-page-container ol.pk-reg-steps > li:last-child { margin-bottom: 0; }
.pk-reg-steps b { color: #1e2632; }
/* O <form id="register"> é só de campos ocultos: sem a margem padrão de form. */
.pk-reg #register { margin: 0; }
.pk-reg-go[disabled] { opacity: .7; cursor: progress; }
.kc-page-container form.pk-reg-cancel-form { margin-top: 10px; }
.pk-reg-cancel {
    width: 100%; padding: 12px; border: 1.5px solid #c9d2de; border-radius: 12px;
    background: #fff; color: #00469B; font-weight: 600; font-size: 14px; cursor: pointer;
}
.pk-reg-cancel:hover { background: #F0F5FC; }
.pk-reg-cancel:focus-visible { outline: 2px solid #00469B; outline-offset: 2px; }
