.login-pf body {
    background: linear-gradient(150deg, #006089 0%, #003a52 60%, #001e2e 100%);
    height: 100%;
}

.alert-error {
    background-color: #ffffff;
    border-color: #cc0000;
    color: #333333;
}

.login-button{
    background-image: linear-gradient(to bottom,#458eaf 0,#0c4f74 100%);
    border-color: #0d5073;

}
#kc-locale ul {
    display: none;
    position: absolute;
    background-color: #fff;
    list-style: none;
    right: 0;
    top: 20px;
    min-width: 100px;
    padding: 2px 0;
    border: solid 1px #bbb;
}

#kc-locale:hover ul {
    display: block;
    margin: 0;
}

#kc-locale ul li a {
    display: block;
    padding: 5px 14px;
    color: #000 !important;
    text-decoration: none;
    line-height: 20px;
}

#kc-locale ul li a:hover {
    color: #4d5258;
    background-color: #d4edfa;
}

#kc-locale-dropdown a {
    color: #4d5258;
    background: 0 0;
    padding: 0 15px 0 0;
    font-weight: 300;
}

#kc-locale-dropdown a:hover {
    text-decoration: none;
}

a#kc-current-locale-link {
    display: block;
    padding: 0 5px;
}

/* a#kc-current-locale-link:hover {
    background-color: rgba(0,0,0,0.2);
} */

a#kc-current-locale-link::after {
    content: "\2c5";
    margin-left: 4px;
}

.login-pf .container {
    padding-top: 40px;
}

.login-pf a:hover {
    color: #0099d3;
}

#kc-header {
    color: #ededed;
    overflow: visible;
    white-space: nowrap;
}

/* Logo: en KC25 el elemento del template es #kc-header-wrapper */
#kc-header-wrapper {
    background-image: url(../img/keycloak-logo-text.png);
    background-repeat: no-repeat;
    background-position: center top;
    background-size: auto 80px;
    height: 110px;
    font-size: 0;
    color: transparent;
    padding: 10px 10px 0;
    white-space: normal;
}

/* Colores de marca para botón primario (PatternFly 4 variables) */
:root {
    --pf-c-button--m-primary--BackgroundColor: #015a84;
    --pf-c-button--m-primary--hover--BackgroundColor: #0c4f74;
    --pf-c-button--m-primary--focus--BackgroundColor: #0c4f74;
    --pf-c-button--m-primary--active--BackgroundColor: #0c4f74;
}

#kc-content {
    width: 100%;
}

#kc-attempted-username{
    font-size: 20px;
    font-family:inherit;
    font-weight: normal;
    padding-right:10px;
}

#kc-username{
    text-align: center;
}

/* #kc-content-wrapper {
    overflow-y: hidden;
} */

#kc-info {
    padding-bottom: 200px;
    margin-bottom: -200px;
}

#kc-info-wrapper {
    font-size: 13px;
}

#kc-form-options span {
    display: block;
}

#kc-form-options .checkbox {
    margin-top: 0;
    color: #72767b;
}

#kc-terms-text {
    margin-bottom: 20px;
}

#kc-registration {
    margin-bottom: 15px;
}

/* TOTP */

.subtitle {
    text-align: right;
    margin-top: 30px;
    color: #909090;
}

.required {
    color: #CB2915;
}

ol#kc-totp-settings {
    margin: 0;
    padding-left: 20px;
}

ul#kc-totp-supported-apps {
  margin-bottom: 10px;
}

#kc-totp-secret-qr-code {
    max-width:150px;
    max-height:150px;
}

#kc-totp-secret-key {
    background-color: #fff;
    color: #333333;
    font-size: 16px;
    padding: 10px 0;
}

/* OAuth */

#kc-oauth h3 {
    margin-top: 0;
}

#kc-oauth ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#kc-oauth ul li {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    padding: 10px 0;
}

#kc-oauth ul li:first-of-type {
    border-top: 0;
}

#kc-oauth .kc-role {
    display: inline-block;
    width: 50%;
}

/* Code */
#kc-code textarea {
    width: 100%;
    height: 8em;
}

/* Social */

#kc-social-providers ul {
    padding: 0;
}

#kc-social-providers li {
    display: block;
}

#kc-social-providers li:first-of-type {
    margin-top: 0;
}

.kc-login-tooltip{
    position:relative;
    display: inline-block;
}

.kc-login-tooltip .kc-tooltip-text{
    top:-3px;
    left:160%;
    background-color: black;
    visibility: hidden;
    color: #fff;

    min-width:130px;
    text-align: center;
    border-radius: 2px;
    box-shadow:0 1px 8px rgba(0,0,0,0.6);
    padding: 5px;

    position: absolute;
    opacity:0;
    transition:opacity 0.5s;
}

/* Show tooltip */
.kc-login-tooltip:hover .kc-tooltip-text {
    visibility: visible;
    opacity:0.7;
}

/* Arrow for tooltip */
.kc-login-tooltip .kc-tooltip-text::after {
    content: " ";
    position: absolute;
    top: 15px;
    right: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent black transparent transparent;
}

.zocial,
a.zocial  {
    width: 100%;
    font-weight: normal;
    font-size: 14px;
    text-shadow: none;
    border: 0;
    background: #f5f5f5;
    color: #72767b;
    border-radius: 0;
    white-space: normal;
}
.zocial:before {
  border-right: 0;
  margin-right: 0;
}
.zocial span:before {
    padding: 7px 10px;
    font-size: 14px;
}
.zocial:hover {
    background: #ededed !important;
}

.zocial.facebook,
.zocial.github,
.zocial.google,
.zocial.microsoft,
.zocial.stackoverflow,
.zocial.linkedin,
.zocial.twitter {
    background-image: none;
    border: 0;

    box-shadow: none;
    text-shadow: none;
}

/* Copy of zocial windows classes to be used for microsoft's social provider button */
.zocial.microsoft:before{ content: "\f15d"; }
.zocial.stackoverflow:before{ color: inherit; }


@media (min-width: 768px) {
    #kc-container-wrapper {
        position: absolute;
        width: 100%;
    }

    .login-pf .container {
        padding-right: 80px;
    }

    #kc-locale {
        position: relative;
        text-align: right;
        z-index: 9999;
    }
}

@media (max-width: 767px) {

    .login-pf body {
      background: white;
    }

    #kc-header {
        padding-left: 15px;
        padding-right: 15px;
        float: none;
        text-align: left;
    }

    #kc-header-wrapper {
        background-position: left top;
        background-size: auto 40px;
        height: 60px;
        padding: 10px 0 0;
    }

    #kc-form {
        float: none;
    }

    #kc-info-wrapper {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 15px;
        padding-top: 15px;
        padding-left: 0px;
        padding-right: 15px;
    }

    #kc-social-providers li {
        display: block;
        margin-right: 5px;
    }

    .login-pf .container {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    #kc-locale {
        position: absolute;
        width: 200px;
        top: 20px;
        right: 20px;
        text-align: right;
        z-index: 9999;
    }


}

@media (min-height: 646px) {
    #kc-container-wrapper {
        bottom: 12%;
    }
}

@media (max-height: 645px) {
    #kc-container-wrapper {
        padding-top: 50px;
        top: 20%;
    }
}

.card-pf form.form-actions .btn {
    float: right;
    margin-left: 10px;
}

#kc-form-buttons {
  margin-top: 40px;
}

.login-pf-page .login-pf-brand {
  margin-top: 20px;
  max-width: 360px;
  width: 40%;
}

.card-pf {
  background: #fff;
  margin: 0 auto;
  padding: 0 20px;
  max-width: 500px;
  border-top: 0;
  box-shadow: 0 0 0;
}

/*tablet*/
@media (max-width: 840px) {
    .login-pf-page .card-pf{
      max-width: none;
      margin-left: 20px;
      margin-right: 20px;
      padding: 20px 20px 30px 20px;
    }
}
@media (max-width: 767px) {
    .login-pf-page .card-pf{
      max-width: none;
      margin-left: 0;
      margin-right: 0;
      padding-top: 0;
    }
    .card-pf.login-pf-accounts{
      max-width: none;
    }
}

.login-pf-page .login-pf-signup {
  font-size: 15px;
  color: #72767b;
}
#kc-content-wrapper .row {
  margin-left: 0;
  margin-right: 0;
}

@media (min-width: 768px) {
  .login-pf-page .login-pf-social-section:first-of-type {
    padding-right: 39px;
    border-right: 1px solid #d1d1d1;
    margin-right: -1px;
  }
  .login-pf-page .login-pf-social-section:last-of-type {
    padding-left: 40px;
  }
  .login-pf-page .login-pf-social-section .login-pf-social-link:last-of-type {
    margin-bottom: 0;
  }
}

.login-pf-page .login-pf-social-link {
  margin-bottom: 25px;
}
.login-pf-page .login-pf-social-link a {
  padding: 2px 0;
}

.login-pf-page.login-pf-page-accounts {
  margin-left: auto;
  margin-right: auto;
}

.login-pf-page .btn-primary {
    margin-top: 0;
}

.login-pf-page .list-view-pf .list-group-item {
    border-bottom: 1px solid #ededed;
}

.login-pf-page .list-view-pf-description {
    width: 100%;
}

.login-pf-page .card-pf{
  margin-bottom: 10px;
}

#kc-form-login div.form-group:last-of-type,
#kc-register-form div.form-group:last-of-type,
#kc-update-profile-form div.form-group:last-of-type {
    margin-bottom: 0px;
}

#kc-back {
    margin-top: 5px;
}

form#kc-select-back-form div.login-pf-social-section {
    padding-left: 0px;
    border-left: 0px;
}

/* ============================================================
   DISEÑO MODERNO v2 — Estilo Ubiquiti
   ============================================================ */

/* Ocultar header externo: logo va dentro de la card */
#kc-header {
    display: none !important;
}

/* Centrar la card — flexbox sobre el contenedor real en KC25 */
.login-pf-page {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    padding: 6vh 16px 18vh !important;
    box-sizing: border-box !important;
}

/* Animación de entrada sobre la card */
@keyframes kcFadeSlideUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Card: blanca pura */
.card-pf {
    background: #ffffff !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border-radius: 10px !important;
    border: none !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45) !important;
    padding: 36px 32px 28px !important;
    width: 100% !important;
    max-width: 420px !important;
    margin: 0 !important;
    animation: kcFadeSlideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Logo dentro de la card */
.card-pf::before {
    content: "";
    display: block;
    background-image: url(../img/logo-coamalaga.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 100%;
    height: 52px;
    margin-bottom: 24px;
}

/* Ocultar título "Sign in to your account" */
.login-pf-header,
#kc-form-header {
    display: none !important;
}

/* Inputs */
.login-pf-page .form-control {
    border-radius: 5px;
    border: 1.5px solid #d0d5dd;
    background: #fff;
    height: 42px;
    font-size: 15px;
    color: #111827;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: none;
}

.login-pf-page .form-control:focus {
    border-color: #006089;
    box-shadow: 0 0 0 3px rgba(0, 96, 137, 0.14);
    background: #fff;
}

/* Input-group (contraseña + ojo) */
.login-pf-page .input-group .form-control {
    border-radius: 5px 0 0 5px;
}

.login-pf-page .input-group-addon,
.login-pf-page .input-group-btn:last-child > .btn {
    border-radius: 0 5px 5px 0;
    border: 1.5px solid #d0d5dd;
    border-left: 0;
    background: #fff;
}

.login-pf-page .input-group:focus-within .input-group-addon,
.login-pf-page .input-group:focus-within .input-group-btn:last-child > .btn {
    border-color: #006089;
}

/* Labels */
.login-pf-page .control-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #374151;
}

/* Botón principal */
.login-pf-page .login-button,
.login-pf-page .btn-primary.login-button {
    background-image: none !important;
    background-color: #006089 !important;
    border-color: transparent !important;
    border-radius: 5px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    padding: 11px 28px !important;
    height: auto !important;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 4px 14px rgba(0, 96, 137, 0.30) !important;
}

.login-pf-page .login-button:hover,
.login-pf-page .btn-primary.login-button:hover {
    background-color: #004f72 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 96, 137, 0.40) !important;
}

.login-pf-page .login-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 96, 137, 0.25) !important;
}

/* Botones secundarios */
.login-pf-page .btn-default {
    border-radius: 5px;
    transition: background-color 0.2s, transform 0.15s;
}

.login-pf-page .btn-default:hover {
    transform: translateY(-1px);
}

/* Checkbox */
#kc-form-options .checkbox label {
    font-size: 13px;
    color: #4b5563;
}

/* Links */
.login-pf-page a,
.login-pf-page a:link {
    color: #006089;
    font-weight: 500;
    transition: color 0.15s;
}

.login-pf-page a:hover {
    color: #004f72 !important;
    text-decoration: underline;
}

/* Alertas */
.login-pf-page .alert {
    border-radius: 5px;
    font-size: 14px;
}

/* Mobile */
@media (max-width: 767px) {
    .login-pf body { background: #006089 !important; }
    .login-pf-page {
        justify-content: flex-start !important;
        padding: 0 !important;
    }
    .card-pf {
        border-radius: 0 !important;
        box-shadow: none !important;
        animation: none;
        max-width: 100% !important;
        padding: 24px 20px !important;
    }
}
