@charset "utf-8";

/* ==========================================================================
   login_panel — Anmeldepanel mit umschaltbaren Modi
   --------------------------------------------------------------------------
   Fachkomponente innerhalb der login_stage_card. Bietet Kopfbereich
   (Schlüssel-Icon, Pretext, Titel, Beschreibung), Modus-Abschnitte
   (lokal / registrieren / extern / Ersteinrichtung), Formularfelder,
   Aktionen sowie den aufklappbaren Bereich „Weitere Anmeldeoptionen".

   Zustände:  login_panel_section_active, login_panel_more_open,
              login_panel_more_panel_open, login_panel_input_filled
   Varianten: login_panel_methods über data-view-mode="scroll|grid"
   ========================================================================== */

.login_panel {
    font-family: var(--font-sans);
    font-weight: var(--w-light);
    color: var(--q-dark);
}

/* ── Kopfbereich ──────────────────────────────────────────────────────── */
.login_panel_header_icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: var(--radius-circle);

    display: grid;
    place-items: center;

    background: var(--q-highlight-2);
    box-shadow: 0 10px 30px rgba(16, 49, 78, 0.45);
}

.login_panel_header_icon img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
}

.login_panel_pretext {
    text-align: center;

    font-family: var(--font-sans);
    font-weight: var(--w-bold);
    font-size: var(--fs-12);
    letter-spacing: var(--tracking-xwide);
    text-transform: uppercase;
    color: var(--q-highlight-2);
}

.login_panel_title {
    margin: 8px 0 6px;

    text-align: center;
    font-family: var(--font-display);
    font-weight: var(--w-bold);
    font-size: var(--fs-28);
    line-height: var(--lh-tight);
    color: var(--q-highlight-3);
}

.login_panel_description {
    margin: 0 0 26px;

    text-align: center;
    font-size: var(--fs-14);
    color: var(--q-medium);
    text-wrap: pretty;
}

/* ── Meldungen (Fehlerbanner) ─────────────────────────────────────────── */
.login_panel_message {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    margin-bottom: 18px;
    padding: 11px 13px;
    border: 1px solid #E7B9B9;
    border-radius: var(--radius-sm);

    background: #FBEAEA;
    color: #9A3838;
    font-size: var(--fs-14);

    animation: login_panel_message_shake 380ms var(--ease-std);
}

@keyframes login_panel_message_shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ── Modus-Abschnitte ─────────────────────────────────────────────────── */
.login_panel_section {
    display: none;
}

.login_panel_section_active {
    display: block;
}

/* ── Formularfelder — markentypisch eckige Inputs, 2px-Rahmen ─────────── */
.login_panel_field {
    margin-bottom: 16px;
}

.login_panel_field_caption {
    display: block;
    margin-bottom: 7px;

    font-size: var(--fs-12);
    font-weight: var(--w-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--q-dark);
}

.login_panel_field_value {
    position: relative;
    display: flex;
    align-items: center;
}

.login_panel_input {
    width: 100%;
    padding: 13px 14px;
    border: 2px solid var(--q-medium);
    border-radius: 0;

    background: var(--q-white);
    outline: none;

    font: inherit;
    font-weight: var(--w-light);
    font-size: var(--fs-16);
    color: var(--q-dark);

    transition: border-color var(--dur-fast) var(--ease-std);
}

.login_panel_input::placeholder {
    color: var(--q-medium);
}

.login_panel_input:hover {
    border-color: #9A9A9A;
}

.login_panel_input:focus,
.login_panel_input_filled {
    border-color: var(--q-highlight-1);
}

.login_panel_input_with_control {
    padding-right: 92px;
}

/* Passwort ein-/ausblenden */
.login_panel_field_control {
    position: absolute;
    right: 8px;
    height: 32px;
    padding: 0 8px;
    border: none;

    background: none;
    cursor: pointer;

    font-size: var(--fs-12);
    font-weight: var(--w-bold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--q-highlight-2);
}

.login_panel_field_control:hover {
    color: var(--q-highlight-3);
}

/* ── Optionszeile: Angemeldet bleiben + Passwort vergessen ────────────── */
.login_panel_options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 22px;
}

.login_panel_check {
    display: flex;
    align-items: center;
    gap: 9px;

    cursor: pointer;
    font-size: var(--fs-14);
    color: var(--q-dark);
}

.login_panel_check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.login_panel_check_box {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid var(--q-medium);
    border-radius: var(--radius-xs);

    display: grid;
    place-items: center;

    background: var(--q-white);

    transition: all var(--dur-fast) var(--ease-std);
}

.login_panel_check_box svg {
    opacity: 0;
    transition: opacity var(--dur-fast);
}

.login_panel_check input:checked + .login_panel_check_box {
    background: var(--q-highlight-1);
    border-color: var(--q-highlight-1);
}

.login_panel_check input:checked + .login_panel_check_box svg {
    opacity: 1;
}

.login_panel_check input:focus-visible + .login_panel_check_box {
    box-shadow: var(--shadow-focus);
}

.login_panel_forgot {
    font-size: var(--fs-14);
    font-weight: var(--w-bold);
    color: var(--q-highlight-2);
    text-decoration: none;
    white-space: nowrap;
}

.login_panel_forgot:hover {
    color: var(--q-highlight-3);
}

/* ── Aktionen ─────────────────────────────────────────────────────────── */
.login_panel_actions {
    margin-top: 6px;
}

.login_panel_action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    padding: 11px 24px;
    border: 2px solid transparent;
    border-radius: var(--radius-xl);

    cursor: pointer;

    font-family: var(--font-sans);
    font-weight: var(--w-bold);
    font-size: var(--fs-14);

    transition: transform var(--dur-fast) var(--ease-std),
                border-color var(--dur-base) var(--ease-std);
}

.login_panel_action:active {
    transform: scale(0.985);
}

.login_panel_action:disabled {
    opacity: 0.55;
    cursor: default;
}

.login_panel_action_primary {
    background: var(--q-highlight-1);
    border-color: var(--q-highlight-1);
    color: var(--q-white);
}

.login_panel_action_secondary {
    background: var(--q-highlight-2);
    border-color: var(--q-highlight-2);
    color: var(--q-white);
}

/* ── Aufklappbereich „Weitere Anmeldeoptionen" ───────────────────────── */
.login_panel_more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    margin-top: 18px;
    padding: 8px;
    border: none;

    background: none;
    cursor: pointer;

    font: inherit;
    font-size: var(--fs-14);
    font-weight: var(--w-bold);
    letter-spacing: 0.02em;
    color: var(--q-highlight-2);

    transition: color var(--dur-fast) var(--ease-std);
}

.login_panel_more:hover {
    color: var(--q-highlight-3);
}

.login_panel_more svg {
    width: 16px;
    height: 16px;
    transition: transform var(--dur-base) var(--ease-std);
}

.login_panel_more_open svg {
    transform: rotate(180deg);
}

.login_panel_more_panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--dur-base) var(--ease-std);
}

.login_panel_more_panel_open {
    grid-template-rows: 1fr;
}

.login_panel_more_body {
    overflow: hidden;
    min-height: 0;
    opacity: 0;
    transform: translateY(-6px);

    transition: opacity var(--dur-base) var(--ease-std),
                transform var(--dur-base) var(--ease-std);
}

.login_panel_more_panel_open .login_panel_more_body {
    opacity: 1;
    transform: none;
}

/* ── Trennzeile mit Beschriftung ──────────────────────────────────────── */
.login_panel_divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px 0 14px;
}

.login_panel_divider::before,
.login_panel_divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--q-bright);
}

.login_panel_divider span {
    font-size: var(--fs-12);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--q-medium);
    white-space: nowrap;
}

/* ── Ansichtsumschalter der Methoden (Blättern / Raster) ──────────────── */
.login_panel_methods_toggle {
    display: flex;
    justify-content: flex-end;
    padding-top: 14px;
    margin-bottom: 12px;
}

.login_panel_methods_toggle button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 2px;
    border: none;

    background: none;
    cursor: pointer;

    font: inherit;
    font-size: var(--fs-12);
    font-weight: var(--w-bold);
    letter-spacing: 0.04em;
    color: var(--q-highlight-2);

    transition: color var(--dur-fast) var(--ease-std);
}

.login_panel_methods_toggle button:hover {
    color: var(--q-highlight-3);
}

.login_panel_methods_toggle svg {
    width: 15px;
    height: 15px;
}

.login_panel_methods_toggle + .login_panel_methods {
    padding-top: 0;
}

/* ── Methoden-Kacheln (alternative Anmeldewege) ───────────────────────── */
.login_panel_methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 14px;
}

.login_panel_methods[data-view-mode="scroll"] {
    display: flex;
    grid-template-columns: none;

    overflow-x: auto;
    scroll-snap-type: x mandatory;

    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
    padding-bottom: 8px;

    scrollbar-width: thin;
    scrollbar-color: var(--q-medium) transparent;
}

.login_panel_methods[data-view-mode="scroll"]::-webkit-scrollbar {
    height: 6px;
}

.login_panel_methods[data-view-mode="scroll"]::-webkit-scrollbar-thumb {
    background: var(--q-bright);
    border-radius: var(--radius-pill);
}

.login_panel_methods[data-view-mode="scroll"] .login_panel_method {
    flex: 0 0 58%;
    scroll-snap-align: center;
}

.login_panel_method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    padding: 16px 12px;
    border: 2px solid var(--q-bright);
    border-radius: var(--radius-md);

    background: var(--q-white);
    cursor: pointer;
    text-align: center;
    font: inherit;

    /* Eine Kachel ist meist eine Schaltfläche, manchmal aber ein echter Link
       auf eine andere Seite. Beide sollen gleich aussehen.                  */
    text-decoration: none;
    color: inherit;

    transition: border-color var(--dur-base) var(--ease-std),
                transform var(--dur-fast) var(--ease-std);
}

.login_panel_method:hover {
    border-color: var(--q-highlight-3);
}

.login_panel_method:active {
    transform: scale(0.98);
}

.login_panel_method_icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-circle);

    display: grid;
    place-items: center;

    background: var(--q-highlight-4);
    color: var(--q-highlight-2);
}

.login_panel_method_icon img {
    width: 22px;
    height: 22px;
}

.login_panel_method_title {
    font-size: var(--fs-14);
    font-weight: var(--w-bold);
    color: var(--q-dark);
}

.login_panel_method_description {
    font-size: 11px;
    color: var(--q-medium);
    line-height: 1.3;
}

/* ── Rücksprung-Link („Zurück zur Anmeldung") ─────────────────────────── */
.login_panel_back {
    justify-content: center;
}

/* ── Technische Angaben (z. B. Redirect-URI) ──────────────────────────── */
.login_panel_meta {
    margin-top: 18px;

    font-size: var(--fs-12);
    color: var(--q-medium);
    line-height: 1.5;
}

.login_panel_meta code {
    font-family: var(--font-mono);
    color: var(--q-dark);
}

/* ── Passkey-Weg ──────────────────────────────────────────────────────────
   Ein zweiter, gleichrangiger Anmeldeweg neben dem Passwort. Er steht
   deshalb als Umriss-Schaltfläche daneben und nicht als weitere gefüllte,
   die mit „Anmelden" um Aufmerksamkeit konkurrieren würde.                 */
.login_panel_action_outline {
    background: var(--q-white);
    border-color: var(--q-highlight-2);
    color: var(--q-highlight-2);
}

.login_panel_action_outline:hover:not(:disabled) {
    background: var(--q-highlight-4);
}

/* Das Schlüsselsymbol trägt im SVG eine feste Farbe. Als Maske gezeichnet
   nimmt es stattdessen die Schriftfarbe der Schaltfläche an: hell auf der
   gefüllten, Navy auf der Umriss-Variante. Sonst bräuchte es zwei Dateien
   für dasselbe Symbol, und jede weitere Variante eine dritte.              */
.login_panel_action_icon {
    width: 18px;
    height: 18px;
    flex: none;

    background-color: currentColor;

    -webkit-mask-image: url('../../images/icons/key_dark.svg');
    mask-image: url('../../images/icons/key_dark.svg');
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Laufender Vorgang: Der Browser zeigt seinen eigenen Dialog, die Seite
   dahinter soll erkennbar warten und nicht ein zweites Mal auslösbar sein. */
.login_panel_action_busy {
    opacity: 0.6;
    cursor: progress;
}

/* Liste der registrierten Passkeys in der Selbstverwaltung. */
.login_panel_keys {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

/* Symbol links, alles Übrige rechts untereinander. Nebeneinander wird es zu
   eng: Name, Datum und drei Bedienelemente passen in einer Zeile weder auf
   ein Telefon noch in dieses Panel.                                         */
.login_panel_key {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 12px 14px;
    border: 1px solid var(--q-bright);
    border-radius: var(--radius-sm);
    background: var(--q-white);
}

.login_panel_key_icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;
    flex: none;
    border-radius: var(--radius-sm);
    background: var(--q-highlight-4);
}

.login_panel_key_icon img {
    width: 18px;
    height: 18px;
}

.login_panel_key_body {
    flex: 1;
    min-width: 0;
}

.login_panel_key_title {
    font-weight: var(--w-bold);
    font-size: var(--fs-14);
    color: var(--q-highlight-2);

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login_panel_key_meta {
    margin-top: 3px;
    font-size: var(--fs-12);
    line-height: 1.5;
    color: var(--q-dark);
}

/* Bedienelemente einer Passkey-Zeile
   --------------------------------------------------------------------------
   Eine Zeile ist überwiegend Information; Umbenennen und Entfernen sind
   seltene Handgriffe. Sie stehen deshalb als zwei ruhige Symbolflächen rechts
   und nicht als beschriftete Schaltflächen unter dem Text, wo sie mit dem
   Namen um Aufmerksamkeit konkurrierten.                                    */
.login_panel_key_controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
}

.login_panel_key_control {
    display: grid;
    place-items: center;

    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--q-bright);
    border-radius: var(--radius-sm);

    background: var(--q-white);
    color: var(--q-dark);
    cursor: pointer;

    transition: border-color var(--dur-base) var(--ease-std),
                color var(--dur-base) var(--ease-std);
}

.login_panel_key_control:hover {
    border-color: var(--q-highlight-2);
    color: var(--q-highlight-2);
}

/* Entfernen ist der einzige Handgriff hier, der sich nicht zurücknehmen
   lässt. Er wird erst beim Ansteuern rot - dauerhaft rot wäre eine Warnung,
   die immer leuchtet und deshalb keine mehr ist.                           */
.login_panel_key_control_danger:hover {
    border-color: #C25B5B;
    color: #C25B5B;
}

.login_panel_key_control_icon {
    width: 16px;
    height: 16px;

    background-color: currentColor;

    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.login_panel_key_control_icon_edit {
    -webkit-mask-image: url('../../images/icons/edit.svg');
    mask-image: url('../../images/icons/edit.svg');
}

.login_panel_key_control_icon_delete {
    -webkit-mask-image: url('../../images/icons/delete.svg');
    mask-image: url('../../images/icons/delete.svg');
}

/* Umbenennen: Das Eingabefeld tritt an die Stelle des Namens, nicht daneben. */
.login_panel_key_rename_form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;

    margin-bottom: 4px;
}

/* Volle Zeile für das Eingabefeld, die beiden Schaltflächen darunter. Die
   Karte ist auf 440px begrenzt; nebeneinander bricht immer eine der drei um,
   und zwar je nach Namenslänge eine andere.                                 */
.login_panel_key_rename {
    flex: 1 1 100%;
    min-width: 0;

    padding: 6px 10px;
    border: 1px solid var(--q-medium);
    border-radius: var(--radius-sm);

    background: var(--q-white);
    color: var(--q-highlight-2);

    font-family: var(--font-sans);
    font-weight: var(--w-bold);
    font-size: var(--fs-14);
}

.login_panel_key_rename:focus {
    outline: none;
    border-color: var(--q-highlight-3);
}

.login_panel_key_action {
    display: inline-flex;
    align-items: center;

    padding: 6px 12px;
    border: 1px solid var(--q-bright);
    border-radius: var(--radius-sm);

    background: var(--q-white);
    color: var(--q-dark);
    cursor: pointer;

    text-decoration: none;
    font-family: var(--font-sans);
    font-size: var(--fs-12);
}

.login_panel_key_action:hover {
    border-color: var(--q-highlight-2);
    color: var(--q-highlight-2);
}

.login_panel_key_action_confirm {
    background: var(--q-highlight-2);
    border-color: var(--q-highlight-2);
    color: var(--q-white);
}

.login_panel_key_action_confirm:hover {
    background: var(--q-highlight-3);
    border-color: var(--q-highlight-3);
    color: var(--q-white);
}

/* Leerzustand der Passkey-Liste. Der untere Abstand entspricht dem der
   gefüllten Liste (login_panel_keys), damit der nächste Abschnitt in beiden
   Fällen gleich weit entfernt steht und nicht anklebt.                      */
.login_panel_key_empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;

    margin-bottom: 18px;
    padding: 22px 18px;
    border: 1px dashed var(--q-medium);
    border-radius: var(--radius-md);

    background: rgba(255, 255, 255, 0.55);
    color: var(--q-dark);
    font-size: var(--fs-14);
    line-height: 1.5;
    text-align: center;
    text-wrap: pretty;
}

.login_panel_key_empty_icon {
    display: grid;
    place-items: center;

    width: 40px;
    height: 40px;
    border-radius: var(--radius-circle);

    background: var(--q-highlight-4);
}

.login_panel_key_empty_icon img {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}
