/*
 * File: login-override.css
 * STATO FINALE: Massima specificità CSS per combattere stili inline JS.
 */

/* ==================================== */
/* 1. STILE DEL CORPO / SFONDO (Pagina di Login) */
/* ==================================== */

/* Applica lo sfondo, allineamento e font solo quando è presente la classe .login-ui (schermata di login) */
.login-ui {
    /* FORZA SFONDO: Usa !important per garantire la priorità assoluta sullo sfondo */
    background-image: url('/app/ext/tempnamespace/images/sfondo.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;

    background-color: transparent !important; 

    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'Roboto', sans-serif;
}

/* Applica un overlay scuro o chiaro per migliorare la leggibilità del form */
.login-ui::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2); /* Overlay leggermente scuro */
    z-index: -1;
}

/* FIX: Resetta lo sfondo del body quando la classe .login-ui viene rimossa (dopo il login) */
body {
    background-image: none !important;
    background-color: #f8f9fa !important; /* Colore di default per la dashboard */
}

/* Rimuovi il background del contenitore principale (se impostato da Guacamole) */
.login-ui .login-dialog-container {
    background: transparent !important;
}

/* ==================================== */
/* 2. BOX DI LOGIN (La "Card") */
/* ==================================== */

.login-ui .login-dialog {
    max-width: 400px;
    width: 100%;
    /* Colore di sfondo del form personalizzato richiesto */
    background-color: #dbeafd;
    border: none;
    border-radius: 12px;
    padding: 35px 40px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    position: relative;
    top: 0;
    margin: auto;
    text-align: center;
    box-sizing: border-box;
    /* Bordo per l'effetto contrasto/trasparenza */
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
}

.login-ui .login-dialog:after {
    display: none;
}

/* ==================================== */
/* 3. LOGO */
/* ==================================== */

.login-ui .login-dialog .logo {
    background-image: url('/app/ext/tempnamespace/images/logo-placeholder.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 120px;
    height: 120px;
    margin: 0 auto 25px auto;
    display: block;
}

/* ==================================== */
/* 4. HEADINGS / TESTI */
/* ==================================== */

.login-ui .login-dialog h1 {
    display: none;
}

.login-ui .login-dialog .login-name {
    color: #2c3e50;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
}

/* ==================================== */
/* 5. CAMPI E INPUT (Stile "Outlined" Simulato) - MASSIMA SPECIFICITÀ */
/* ==================================== */

.login-ui .login-fields .field {
    position: relative;
    margin-bottom: 25px;
}

/* TARGET Input Username & Password per rimuovere il giallo e i bordi */
.login-ui .login-fields input[name="username"],
.login-ui .login-fields input[name="password"] {
    /* CORREZIONE MASSIVA: Forza lo sfondo bianco/trasparente e rimuove bordi non voluti */
    background-color: rgba(255, 255, 255, 0.8) !important; 
    border: none !important; 
    
    /* Forza il bordo inferiore per l'effetto "outlined" */
    border-bottom: 2px solid #a8c1e4 !important; 
    
    border-radius: 4px; 
    padding: 10px 10px; 
    font-size: 16px;
    color: #495057;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease-in-out, background-color 0.3s ease;
    outline: none;
}

/* Forza lo stile FOCUS */
.login-ui .login-fields input[name="username"]:focus,
.login-ui .login-fields input[name="password"]:focus {
    border-color: #3498db !important; 
    box-shadow: none !important; 
    background-color: #ffffff !important;
}

.login-ui .login-fields label {
    display: none;
}

/* ==================================== */
/* 6. PULSANTE DI LOGIN (Arrotondato) - MASSIMA SPECIFICITÀ */
/* ==================================== */

/* Target specifico per il pulsante di login (Submit) */
.login-ui .login-dialog .login-button[type="submit"] {
    background-color: #3498db !important; /* Forza il colore BLU */
    color: #ffffff !important;
    border: none !important;
    
    /* IMPOSTAZIONE RICHIESTA: 5px con !important per la massima priorità */
    border-radius: 5px !important; 
    
    padding: 12px 20px;
    font-size: 17px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    width: 100%;
    box-sizing: border-box;
    margin-top: 25px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.login-ui .login-dialog .login-button[type="submit"]:hover {
    /* Corretto selettore specifico anche per l'hover */
    background-color: #2980b9 !important; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ==================================== */
/* 7. MESSAGGI DI ERRORE / INFO */
/* ==================================== */

.login-ui .login-dialog .messages {
    margin-top: 20px;
    font-size: 14px;
    color: #c0392b;
    text-align: center;
}

/* ==================================== */
/* 8. LINK "Password dimenticata?" */
/* ==================================== */

.login-ui .login-dialog .guac-form-footer a {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    margin-top: 20px;
    display: block;
    transition: color 0.2s ease;
}

.login-ui .login-dialog .guac-form-footer a:hover {
    color: #2980b9;
    text-decoration: underline;
}/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

/* Label/tag denoting the user that shared a connection */
.jdbc-share-tag {

    background: #0095ff;
    padding: 0.25em;

    -moz-border-radius:    0.25em;
    -webkit-border-radius: 0.25em;
    -khtml-border-radius:  0.25em;
    border-radius:         0.25em;

    color: white;
    font-size: 0.75em;
    font-weight: bold;

}
.totp-enroll p,.totp-details{font-size:.8em}.totp-qr-code{text-align:center}.totp-qr-code img{margin:1em;border:1px solid rgba(0,0,0,0.25);box-shadow:1px 1px 2px rgba(0,0,0,0.25);cursor:pointer}h3.totp-details-header{font-size:.8em}h3.totp-details-header::before{content:'▸ '}.totp-details-visible h3.totp-details-header::before{content:'▾ '}.totp-details,.totp-hide-details{display:none}.totp-details-visible .totp-details{display:table}.totp-details-visible .totp-hide-details{display:inline}.totp-details-visible .totp-show-details{display:none}.totp-hide-details,.totp-show-details{color:blue;text-decoration:underline;cursor:pointer;margin:0 .25em;font-weight:normal}.totp-details{margin:0 auto}.totp-details th{padding-right:.25em;text-align:left}.totp-details td{font-family:monospace}.totp-detail{display:inline-block;margin:0 .25em}