/*
 * MERAF Desk - Custom Guacamole Branding
 * Dark theme inspired by HestiaCP login
 */

/* ===== Page background ===== */
div.login-ui {
    background: radial-gradient(circle, #4d4d4d 0%, #1f1f1f 100%), #303030;
}

/* ===== Login dialog card ===== */
.login-ui .login-dialog {
    background: #282828;
    border: none;
    border-radius: 12px;
    padding: 2em 2em 1.5em;
    max-width: 360px;
    box-shadow: 0 8px 25px #0000004d, inset 0 0 2px #00000040 !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ===== Headings ===== */
.login-ui .login-dialog h1 {
    color: #e0e0e0;
}

.login-ui .login-dialog th {
    text-shadow: none;
    color: #e0e0e0;
}

/* ===== Logo ===== */
.login-ui .login-dialog .logo {
    width: 80px;
    height: 96px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-image: url("/app/ext/meraf-branding/images/logo.svg") !important;
    margin: 0 auto 0.5em;
}

/* ===== App name (MERAF Desk) ===== */
.login-ui .login-dialog .version {
    padding: 0 0 1em;
}

.login-ui .login-dialog .version .app-name {
    font-weight: 600;
    text-transform: none;
    text-align: center;
    font-size: 1.35em;
    color: #e0e0e0;
    letter-spacing: 0.5px;
}

/* Hide version badge */
.login-ui .login-dialog .version .version-number {
    display: none;
}

/* ===== Input fields ===== */
.login-ui .login-dialog .login-fields input {
    display: block;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #e0e0e0;
    width: 100%;
    margin: 0;
    margin-bottom: 0.5em;
    padding: 0.65em 0.85em;
    max-width: none;
    font-size: 0.95em;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.login-ui .login-dialog .login-fields input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #008fee;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 143, 238, 0.2);
}

.login-ui .login-dialog .login-fields input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

/* Field label (placeholder text) */
.login-ui .login-fields .labeled-field .field-header {
    color: rgba(255, 255, 255, 0.4);
}

.login-ui .login-fields .labeled-field.empty input {
    background: rgba(255, 255, 255, 0.07);
}

.login-ui .login-fields .labeled-field input:focus {
    background: rgba(255, 255, 255, 0.1);
}

/* ===== Login button ===== */
.login-ui .login-dialog .buttons input[type="submit"] {
    width: 100%;
    margin: 0;
    background: linear-gradient(#454545 0%, #353535 65%, #303030 100%), #303030;
    color: #eee;
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.5em;
    font-size: 1em;
    font-weight: 400;
    cursor: pointer;
    text-shadow: 0 1px 1px #00000059;
    box-shadow: 0 1px 4px #0003, inset 0 0 1px #141414, inset 0 0 3px #00000080;
    border-color: #707070;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.login-ui .login-dialog .buttons input[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.login-ui .login-dialog .buttons input[type="submit"]:active {
    transform: translateY(0);
    opacity: 0.8;
}

.login-ui.continuation .login-dialog .buttons input[type="submit"] {
    width: auto;
}

/* ===== Error message ===== */
.login-ui.error p.login-error {
    background: rgba(220, 53, 69, 0.9);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #fff;
    border-radius: 6px;
}

/* ===== Error shake ===== */
.login-ui.error .login-dialog {
    border-color: rgba(220, 53, 69, 0.5);
}

/* ===== Hide password toggle ===== */
.login-ui .login-fields .form-field .password-field .toggle-password {
    display: none;
}

/* ===== Logged-out modal ===== */
.logged-out-modal guac-modal,
.automatic-login-rejected-modal guac-modal {
    background: radial-gradient(circle, #4d4d4d 0%, #1f1f1f 100%), #303030;
    z-index: 20;
}

.logged-out-modal .notification,
.automatic-login-rejected-modal .notification {
    display: inline-block;
    max-width: 360px;
    width: 100%;
    background: #282828;
    box-shadow: 0 8px 25px #0000004d, inset 0 0 2px #00000040;
    border-radius: 12px;
    padding: 2em 2em 1.5em;
    text-align: center;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.logged-out-modal .notification p,
.automatic-login-rejected-modal .notification p {
    color: #e0e0e0;
    font-size: 1.1em;
    margin: 0 0 1em;
}

.logged-out-modal .notification button,
.automatic-login-rejected-modal .notification button {
    background: linear-gradient(#454545 0%, #353535 65%, #303030 100%), #303030;
    color: #eee;
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.5em;
    font-size: 1em;
    font-weight: 400;
    cursor: pointer;
    text-shadow: 0 1px 1px #00000059;
    box-shadow: 0 1px 4px #0003, inset 0 0 1px #141414, inset 0 0 3px #00000080;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.logged-out-modal .notification button:hover,
.automatic-login-rejected-modal .notification button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ===== Global body override ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
