/*
    Layout des IdentityServers, dunkel, angelehnt an die bme-App (Werte aus WebApp/Core/UI/src/scss): Header mit
    angemeldetem Benutzer und Abmelde-Icons, zentrierte Karte wie der Login-Dialog, Eingaben mit Unterstrich, grüne
    Buttons, Footer mit Logo. Farben nur über die Variablen unten.
    1rem = 10px (wie in der App).
*/

:root {
    color-scheme: dark;

    --color-page: #181818;
    --color-bar: #242424;
    --color-surface: #2a2a2a;
    --color-text: rgba(255, 255, 255, .87);
    --color-text-muted: rgba(255, 255, 255, .6);
    --color-line: rgba(255, 255, 255, .24);
    --color-line-hover: rgba(255, 255, 255, .6);
    --color-hover: rgba(255, 255, 255, .12);
    --color-accent: #9bbf1a;
    --color-primary: #5f8100;
    --color-primary-hover: #76a000;
    --color-error: #ef6b5f;
    --color-error-surface: #b3372c;
    --color-error-surface-hover: #93291f;
    --color-success-surface: #5f8100;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
}

/* Footer immer unten, auch bei kurzer Seite */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background-color: var(--color-page);
    color: var(--color-text);
    font: 300 1.4rem/1.4 Roboto, sans-serif;
}

strong {
    font-weight: 500;
}

h2 {
    margin: 0;
    font-size: 2.1rem;
    font-weight: 300;
    line-height: 1.2;
}

/* Header: angemeldeter Benutzer links (kürzt sich), Abmelde-Icons rechts */

.app-header {
    display: flex;
    align-items: center;
    gap: .4rem;
    height: 5.4rem;
    padding: 0 .4rem 0 1.6rem;
    background-color: var(--color-bar);
    border-bottom: 1px solid var(--color-line);
}

.app-header .name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 1.6rem;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header form {
    flex-shrink: 0;
    margin: 0;
}

.icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.4rem;
    height: 4.4rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: background-color 160ms cubic-bezier(.4, 0, .2, 1);
}

.icon-button:hover,
.icon-button:focus-visible {
    outline: none;
    background-color: var(--color-hover);
}

.icon-button svg {
    width: 2.4rem;
    height: 2.4rem;
    fill: currentColor;
}

.canvas {
    flex: 1 0 auto;
    padding: 3.2rem .8rem;
}

/* Footer mit Logo (Logo mit weisser Schrift, für dunklen Hintergrund) */

.app-footer {
    display: flex;
    justify-content: center;
    padding: 1.2rem 0 1.6rem;
}

.app-footer .logo {
    display: block;
    width: 12rem;
    height: 5rem;
    background: url('../img/bme-logo.svg') center -.6rem / 140% no-repeat;
    opacity: .8;
}

/* Karte (wie der Login-Dialog der bme-App) */

.dialog {
    max-width: 57.6rem;
    margin: 0 auto;
    background-color: var(--color-surface);
    border-radius: .2rem;
    box-shadow: 0 19px 38px rgba(0, 0, 0, .5), 0 15px 12px rgba(0, 0, 0, .4);
}

.dialog .header {
    padding: 1.2rem 1.6rem 1.6rem;
}

.dialog .content {
    padding: 0 1.6rem 1.2rem;
    font-size: 1.6rem;
}

.dialog .action {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    padding: 0 1.6rem 1.2rem;
}

/* Formulare in der Aktionszeile nehmen nicht am Flex-Layout teil, nur ihre Buttons */
.dialog .action form {
    display: contents;
}

/* Alles ab diesem Element rechtsbündig (sekundäre Aktionen) */
.dialog .action .push {
    margin-left: auto;
}

/* Fehlermeldung im Kopf der Karte (Login: gilt für Microsoft und Passwort) */
.dialog .header .validation-summary-errors {
    margin: 1.2rem 0 0;
}

/* Login: Microsoft-Button über die ganze Breite, Trennlinie zum Bereich mit Benutzername und Passwort */
.button.wide {
    flex: 1 1 100%;
    gap: 1.2rem;
    min-height: 4.4rem;
}

.microsoft-logo {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
}

.separator {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem 1.6rem 1.2rem;
    color: var(--color-text-muted);
    font-size: 1.2rem;
    text-align: center;
}

.separator::before,
.separator::after {
    content: "";
    flex: 1 1 0;
    border-top: 1px solid var(--color-line);
}

.content p {
    margin: 0 0 1.2rem;
}

.client-info {
    margin: .4rem 0 0;
    font-size: 1.4rem;
    color: var(--color-text-muted);
}

.client-info strong {
    color: var(--color-text);
}

/* Eingabefelder: Beschriftung oben, nur Unterstrich */

.field {
    position: relative;
    margin-bottom: 1.6rem;
    padding-top: 1.6rem;
}

.field > label {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 1.2rem;
    line-height: 1.6rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.field > input {
    width: 100%;
    padding: .2rem 0 .4rem;
    border: none;
    border-bottom: 1px solid var(--color-line);
    border-radius: 0;
    background-color: transparent;
    color: inherit;
    font: 400 1.6rem/1.4 Roboto, sans-serif;
}

/* Vom Browser ausgefüllte Felder nicht hell hinterlegen */
.field > input:-webkit-autofill {
    -webkit-text-fill-color: var(--color-text);
    box-shadow: inset 0 0 0 10rem var(--color-surface);
    caret-color: var(--color-text);
}

.field > input:hover {
    border-bottom-color: var(--color-line-hover);
}

.field > input:focus {
    outline: none;
    padding-bottom: .3rem;
    border-bottom: 2px solid var(--color-accent);
}

.field > input.input-validation-error:hover,
.field > input.input-validation-error:focus {
    border-bottom-color: var(--color-error);
}

.field-validation-error {
    display: block;
    margin-top: .4rem;
    color: var(--color-error);
    font-size: 1.2rem;
    font-weight: 400;
}

.field-validation-valid {
    display: none;
}

/* Checkbox mit Beschriftung rechts */

.checkbox {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
    padding: .8rem 0;
    font-weight: 400;
    cursor: pointer;
}

.checkbox > input {
    width: 1.8rem;
    height: 1.8rem;
    margin: 0;
    accent-color: var(--color-accent);
    cursor: pointer;
}

/* Buttons: primär grün, sekundär mit Rahmen, gefährlich rot */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.6rem;
    padding: 0 1.2rem;
    border: none;
    border-radius: .1rem;
    background-color: var(--color-primary);
    color: rgba(255, 255, 255, .92);
    font: 400 1.4rem/1 Roboto, sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms cubic-bezier(.4, 0, .2, 1);
}

.button:hover,
.button:focus-visible {
    outline: none;
    background-color: var(--color-primary-hover);
}

.button.secondary {
    background-color: transparent;
    color: inherit;
    box-shadow: inset 0 0 0 1px var(--color-line);
}

.button.secondary:hover,
.button.secondary:focus-visible {
    background-color: var(--color-hover);
}

.button.danger {
    background-color: var(--color-error-surface);
    color: #ffffff;
}

.button.danger:hover,
.button.danger:focus-visible {
    background-color: var(--color-error-surface-hover);
}

/* Meldungen; validation-summary-* erzeugt der Tag-Helper asp-validation-summary */

.message,
.validation-summary-errors {
    margin: 0 0 1.2rem;
    padding: .8rem 1.2rem;
    border-radius: .2rem;
    font-size: 1.4rem;
    font-weight: 400;
}

.message.error,
.validation-summary-errors {
    background-color: var(--color-error-surface);
    color: #ffffff;
}

.message.success {
    background-color: var(--color-success-surface);
    color: #ffffff;
}

.validation-summary-errors ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.validation-summary-valid {
    display: none;
}

/* Einrichtung der Authenticator-App; der QR-Code braucht einen hellen Rand, sonst erkennen ihn manche Apps nicht */

.qr-code {
    display: block;
    width: 20rem;
    max-width: 100%;
    margin: 0 auto 1.2rem;
    padding: 1.2rem;
    border-radius: .2rem;
    background-color: #ffffff;
}

.shared-key {
    font-family: Consolas, monospace;
    font-weight: 400;
    word-break: break-all;
}

/* Schmale Bildschirme: weniger Rand, Buttons untereinander über die ganze Breite */

@media (max-width: 619px) {
    .app-header {
        padding-left: .8rem;
    }

    .dialog .header,
    .dialog .content,
    .dialog .action,
    .separator {
        padding-left: .8rem;
        padding-right: .8rem;
    }

    .dialog .action .button {
        flex: 1 1 100%;
    }

    .dialog .action .push {
        margin-left: 0;
    }
}
