/*
 * 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;

}
/*
 * RedTreeSupport Labs — sign-in page branding for Apache Guacamole.
 *
 * Everything here is scoped to the login screen (.login-ui); the rest of the
 * Guacamole interface is left as shipped. Asset URLs are relative to app.css,
 * which Guacamole serves from the web application root.
 */

@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("app/ext/redtree-branding/fonts/figtree-latin.woff2") format("woff2");
}

/* ---------- The name ----------
   Written as redtreesupport.com writes it: "Red" in the brand red and
   "TreeSupport" in the site's muted grey, regular weight, tight tracking.
   The greys are the site's own light-theme and dark-theme values. */

.login-ui .rts-name {
    color: #666870;
    font-weight: 400;
    letter-spacing: -0.045em;
    white-space: nowrap;
}

.login-ui .rts-name__red {
    color: #e9141d;
}

.login-ui .rts-hero .rts-name {
    color: #aeb3bd;
}

/* Inside a sentence or the footer: colours only, keep the surrounding type. */
.login-ui .rts-name--inline {
    font-weight: inherit;
    letter-spacing: inherit;
}

/* ---------- Page frame: brand panel left, sign-in right ---------- */

div.login-ui {
    --rts-ink: #0a0a0b;
    --rts-muted: #5b5b63;
    --rts-line: #d4d4da;
    --rts-night: #0a0a0b;
    --rts-font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(400px, 38vw, 580px);
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    background: #fff;
    color: var(--rts-ink);
    font-family: var(--rts-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Brand panel ---------- */

.login-ui .rts-hero {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: clamp(28px, 4.2vw, 60px);
    color: #f5f5f6;
    background:
        radial-gradient(rgba(255, 255, 255, 0.085) 1px, transparent 1.6px) 0 0 / 30px 30px,
        radial-gradient(70% 60% at 0% 100%, rgba(0, 104, 56, 0.62), transparent 72%),
        radial-gradient(48% 42% at 78% 0%, rgba(240, 3, 3, 0.26), transparent 72%),
        radial-gradient(46% 46% at 100% 78%, rgba(255, 221, 89, 0.16), transparent 72%),
        linear-gradient(155deg, #0e1713 0%, #0a0a0b 62%);
}

/* The three-triangle mark, large, as the picture: a soft glow copy behind a
   crisp copy, both bleeding off the top-right corner. */
.login-ui .rts-hero__art,
.login-ui .rts-hero__art::before {
    position: absolute;
    background: url("app/ext/redtree-branding/images/logo-mark.svg") no-repeat center / contain;
}

.login-ui .rts-hero__art {
    z-index: -1;
    top: -9%;
    right: -11%;
    width: min(74%, 96vh);
    aspect-ratio: 1;
}

.login-ui .rts-hero__art::before {
    content: "";
    inset: 0;
    z-index: -1;
    filter: blur(70px) saturate(1.25);
    opacity: 0.55;
    transform: scale(1.12);
}

/* Keeps the headline readable where it sits over the artwork. */
.login-ui .rts-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(10, 10, 11, 0.86) 0%, rgba(10, 10, 11, 0.5) 30%, rgba(10, 10, 11, 0) 62%);
    pointer-events: none;
}

.login-ui .rts-hero__top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-ui .rts-hero__mark {
    flex: none;
    width: 44px;
    height: 44px;
    background: url("app/ext/redtree-branding/images/logo-mark.svg") no-repeat center / contain;
}

.login-ui .rts-hero__name {
    font-size: 23px;
    line-height: 1;
}

.login-ui .rts-hero__product {
    margin-left: 0.12em;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #f5f5f6;
}

/* Text block sits at the bottom-left, clear of the artwork top-right. */
.login-ui .rts-hero__body {
    margin-top: auto;
    text-align: left;
}

.login-ui .rts-hero__label {
    margin: 0 0 18px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(245, 245, 246, 0.7);
}

/* Guacamole styles bare h1 as centred with padding; undo that here. */
.login-ui .rts-hero__headline {
    margin: 0;
    padding: 0;
    text-align: left;
    vertical-align: baseline;
    font-size: clamp(44px, 6.4vw, 108px);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.login-ui .rts-hero__sub {
    margin: 26px 0 0;
    max-width: 30em;
    font-size: clamp(15px, 1.2vw, 18px);
    line-height: 1.5;
    color: rgba(245, 245, 246, 0.78);
}

.login-ui .rts-hero__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(245, 245, 246, 0.6);
}

@media (prefers-reduced-motion: no-preference) {
    .login-ui .rts-hero__body {
        animation: rts-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    .login-ui .rts-hero__art {
        animation: rts-art 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    }
}

@keyframes rts-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

@keyframes rts-art {
    from { opacity: 0; transform: translate(3%, -2%) scale(1.04); }
    to { opacity: 1; transform: none; }
}

/* ---------- Sign-in panel ---------- */

.login-ui .login-dialog-middle {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    width: auto;
    min-width: 0;
    padding: 48px clamp(28px, 4vw, 72px);
    overflow-y: auto;
    background: #fff;
    text-align: left;
    vertical-align: baseline;
}

.login-ui .login-dialog,
.login-ui .login-dialog.notification {
    position: relative;
    display: block;
    width: 100%;
    max-width: 360px;
    margin: auto;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    color: var(--rts-ink);
    font-size: 16px;
}

.login-ui.continuation .login-dialog {
    max-width: 440px;
}

.login-ui .login-dialog .logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    background: url("app/ext/redtree-branding/images/logo-mark.svg") no-repeat center / contain;
}

.login-ui .login-dialog .version {
    padding: 0;
}

.login-ui .login-dialog .version .app-name {
    font-size: 30px;
    font-weight: 400;
    line-height: 1.15;
    text-transform: none;
    text-align: center;
}

.login-ui .login-dialog .version .version-number {
    display: none;
}

.login-ui .rts-signin-label {
    margin: 8px 0 30px;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
    color: var(--rts-muted);
}

.login-ui.continuation .rts-signin-label {
    display: none;
}

.login-ui .login-form > p {
    font-size: 15px;
    line-height: 1.5;
    color: var(--rts-muted);
}

/* Fields: Guacamole draws each label behind its (transparent while empty)
   input, so it reads as a placeholder. Keep that, with our own metrics. */
.login-ui .login-fields .labeled-field {
    margin: 0 0 12px;
}

.login-ui .login-fields .labeled-field .field-header {
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0 16px;
    height: 52px;
    line-height: 52px;
    font-size: 15px;
    color: #6a6a72;
    opacity: 1;
}

.login-ui .login-dialog .login-fields input:not([type="checkbox"]):not([type="radio"]) {
    height: 52px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--rts-line);
    border-radius: 4px;
    box-shadow: none;
    outline: none;
    color: var(--rts-ink);
    font-family: var(--rts-font);
    font-size: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-ui .login-dialog .login-fields input:not([type="checkbox"]):not([type="radio"]):hover {
    border-color: #a9a9b1;
}

.login-ui .login-dialog .login-fields input:not([type="checkbox"]):not([type="radio"]):focus {
    border-color: var(--rts-ink);
    box-shadow: 0 0 0 3px rgba(10, 10, 11, 0.1);
}

.login-ui .login-dialog .buttons {
    margin: 20px 0 0;
}

.login-ui .login-dialog .buttons input[type="submit"] {
    height: 52px;
    margin: 0;
    padding: 0 18px;
    border: 1px solid var(--rts-ink);
    border-radius: 4px;
    box-shadow: none;
    background: var(--rts-ink);
    color: #fff;
    font-family: var(--rts-font);
    font-size: 16px;
    font-weight: 500;
    text-shadow: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.login-ui .login-dialog .buttons input[type="submit"]:hover {
    background: #2b2b30;
}

.login-ui .login-dialog .buttons input[type="submit"]:active {
    background: #000;
    box-shadow: none;
}

.login-ui .login-dialog .buttons input[type="submit"]:focus-visible {
    outline: 2px solid var(--rts-ink);
    outline-offset: 3px;
}

.login-ui .login-dialog .buttons input[type="submit"]:disabled {
    background: var(--rts-ink);
    opacity: 0.55;
    cursor: default;
}

/* Error banner: top of the sign-in panel instead of across the whole page. */
.login-ui.error p.login-error {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: center;
    position: relative;
    z-index: 3;
    top: auto;
    left: auto;
    right: auto;
    width: min(360px, calc(100% - 56px));
    margin: 28px 0 0;
    padding: 12px 14px;
    border: 1px solid #efb4b4;
    border-radius: 4px;
    background: #fdeeee;
    color: #8c1c1c;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

/* ---------- Narrow screens: brand band on top, form below ---------- */

@media (max-width: 900px) {
    div.login-ui {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        overflow-y: auto;
    }

    .login-ui .rts-hero {
        grid-row: 1;
        gap: 28px;
        padding: 22px 24px 28px;
    }

    .login-ui .rts-hero__art {
        top: -30%;
        right: -14%;
        width: min(62%, 300px);
    }

    .login-ui .rts-hero__headline {
        font-size: clamp(36px, 10vw, 56px);
    }

    .login-ui .rts-hero__headline br,
    .login-ui .rts-hero__sub,
    .login-ui .rts-hero__foot {
        display: none;
    }

    .login-ui .rts-hero__label {
        margin-bottom: 10px;
    }

    .login-ui .login-dialog-middle {
        grid-column: 1;
        grid-row: 2;
        overflow: visible;
        padding: 36px 24px 48px;
    }

    .login-ui .login-dialog,
    .login-ui .login-dialog.notification {
        margin: 0 auto;
    }

    .login-ui.error p.login-error {
        grid-column: 1;
        grid-row: 2;
        margin-top: 12px;
    }

    .login-ui.error .login-dialog-middle {
        padding-top: 84px;
    }
}
