/*
 * SPDX-License-Identifier: MPL-2.0
 * SPDX-FileCopyrightText: Copyright 2024 Siemens AG
 */

:root {
    --font-size: 14px;
    --font-size-smaller: calc(var(--font-size) - 1px);
    --font-size-xsmall: calc(var(--font-size) - 3px);
    --font-size-larger: 15px;
    --font-family: Arial, Helvetica, Sans-Serif;
    --monospace-size: 12px;
}

/*
 * Colors from https://protocol.mozilla.org/docs/fundamentals/color.html
 */

:root {
    --light-gray-05: #ffffff;
    --light-gray-10: #f9f9fb;
    --light-gray-20: #f0f0f4;
    --light-gray-30: #e0e0e6;
    --light-gray-40: #cfcfd8;
    --light-gray-50: #bfbfc9;
    --dark-gray-05: #5b5b66;
    --dark-gray-20: #4a4a55;
    --dark-gray-40: #3a3944;
    --dark-gray-90: #15141a;
    --red-40: #ff6a75;
    --red-70: #c50042;
    --green-40: #54ffbd;
    --green-70: #008787;
    --orange-40: #ff8a50;
    --orange-70: #cc3d00;
}

/* set color scheme before JS overwrites it to avoid flickering of white page on dark default */
@media (prefers-color-scheme: light) {
    :root {
        --surface-0: var(--light-gray-05);
        --surface-1: var(--light-gray-20);
        --surface-2: var(--light-gray-40);
    }
}
@media (prefers-color-scheme: dark) {
    :root {
        --surface-0: var(--dark-gray-90);
        --surface-1: var(--dark-gray-40);
        --surface-2: var(--dark-gray-20);
    }
}

:root.light {
    --surface-0: var(--light-gray-05);
    --surface-1: var(--light-gray-20);
    --surface-2: var(--light-gray-40);
    --border-0: var(--light-gray-30);
    --text-0: var(--dark-gray-90);
    --text-1: var(--dark-gray-05);
    --text-red: var(--red-70);
    --text-green: var(--green-70);
    --text-orange: var(--orange-70);
}

:root.dark {
    --surface-0: var(--dark-gray-90);
    --surface-1: var(--dark-gray-40);
    --surface-2: var(--dark-gray-20);
    --border-0: var(--dark-gray-05);
    --text-0: var(--light-gray-05);
    --text-1: var(--light-gray-50);
    --text-red: var(--red-40);
    --text-green: var(--green-40);
    --text-orange: var(--orange-40);
}

html,
body {
    width: 420px;
    padding: 0;
    margin: 0;
}

body {
    background-color: var(--surface-0);
    font-family: var(--font-family);
}

.entity {
    padding: 10px;
    margin: 10px;
    border-radius: 15px;
    color: var(--text-1);
    cursor: pointer;
    display: flow-root;
}

.info-no-trust {
    display: none;
}
body.has-account .info-no-trust {
    display: inline-block;
}
body.has-account .info-no-account {
    display: none;
}

body.pending .entity {
    cursor: wait;
}

body.nm-connected #nm-error-box {
    display: none;
}

.entity:hover {
    background-color: var(--surface-1);
}

.entity.active {
    background-color: var(--surface-2);
    color: var(--text-0);
    cursor: default;
}

.entity .avatar {
    float: left;
    margin-right: 10px;
}

.entity .info .name {
    font-size: var(--font-size-larger);
}
.entity .info .email {
    font-size: var(--font-size-smaller);
}

.entity .avatar img {
    width: 48px;
    height: 48px;
}

.state-connected-icon {
    color: var(--text-red);
}
.connected .state-connected-icon {
    color: var(--text-green);
}

.state-compliant-icon {
    color: var(--text-red);
}
.compliant .state-compliant-icon {
    color: var(--text-green);
}

.hidden {
    display: none !important;
}

.footer {
    padding-bottom: 5px;
    font-size: var(--font-size-smaller);
    min-height: 1em;
    color: var(--text-1);
}

.footer > .footer-block {
    border-top: 1px solid var(--border-0);
    padding-top: 5px;
    padding-bottom: 5px;
    margin: 0px 5px 0px 5px;
}

.footer > .footer-block > div {
    clear: both;
}

.footer a,
.footer a:visited {
    color: var(--text-1);
}

.footer .right {
    float: right;
}

.footer .clear {
    clear: both;
}

.error-text {
    color: var(--text-red);
}
.footer .error-text a,
.footer .error-text a:visited {
    color: var(--text-red);
}

.warning-text {
    color: var(--text-orange);
}

span.link {
    text-decoration: underline dotted;
    cursor: pointer;
}

#withdraw-access {
    display: none;
}
.connected #grant-access {
    display: none;
}
.connected #withdraw-access {
    display: inline-block;
}

#bg-sso-state.immutable .link {
    display: none;
}
/* show the immutable texts only when immutable */
#bg-sso-state .info-text-immutable {
    display: none;
}
#bg-sso-state.immutable .info-text-immutable.disabled {
    display: inline-block;
}
#bg-sso-state.immutable.connected .info-text-immutable.disabled {
    display: none;
}
#bg-sso-state.immutable.connected .info-text-immutable.enabled {
    display: inline-block;
}
