/*
 * NhPanel – Konto-Bereich (Profil, Sicherheit, Sitzungen, E-Mail-Verlauf, Datenschutz, Kontozugriff, API,
 * Domain-Kontakte) und Registrierung.
 * Wird auf allen storefront.account*-Seiten geladen (auch ohne Shell): alles unter .nh-shell-page gekapselt –
 * einzige Ausnahme ist der Abschnitt "Registrierung" (Gäste, bewusst ohne Shell-Bindung, nur Barrierefreiheit).
 */

/* ---------- Registrierung (/account/register, Gäste) ----------
   Booking zeichnet Kontrollkästchen #dfdfe3 auf Weiß (Kontrast 1,3:1, WCAG verlangt 3:1) und ohne Fokusring –
   das Newsletter-/Datenschutz-Häkchen war dadurch kaum als Kästchen zu erkennen. Nur Rahmen/Füllung im
   nicht angehakten Zustand und ein sichtbarer Tastaturfokus; angehakt bleibt die Theme-Darstellung.
   Gilt für die bisherige Darstellung (NH_PANEL_AUTH_DESIGN=false); die Nexthosting-Anmeldeseiten (auth.css) haben
   dieselbe Korrektur eingebaut, dort gibt es .nh-register-body nicht mehr. */
.hw-center-main .nh-register-body .form-check-input:not(:checked) {
    background-color: #fff;
    border-color: #7b8494;          /* 3,8:1 auf Weiß */
}

.hw-center-main .nh-register-body .form-check-input:focus-visible {
    outline: 2px solid #5143d9;
    outline-offset: 2px;
}

/* ---------- Konto-Shell: Formularelemente ---------- */

/* Gleiche Korrektur für Kontrollkästchen und Schalter auf den Konto-Seiten dieses Bereichs (Profil, Newsletter, Modals).
   Bewusst nur diese Routen: die Datei lädt auf allen Kontoseiten, andere Bereiche gestalten ihre Formulare selbst. */
.nh-shell-page [data-nhpanel-route^="storefront.account.settings"] .form-check-input:not(:checked),
.nh-shell-page [data-nhpanel-route^="storefront.account.access"] .form-check-input:not(:checked),
.nh-shell-page [data-nhpanel-route="storefront.account.api"] .form-check-input:not(:checked),
.nh-shell-page [data-nhpanel-route^="storefront.account.domain.handles"] .form-check-input:not(:checked) {
    background-color: #fff;
    border-color: #7b8494;
}

.nh-shell-page [data-nhpanel-route^="storefront.account.settings"] .form-switch .form-check-input:not(:checked),
.nh-shell-page [data-nhpanel-route^="storefront.account.access"] .form-switch .form-check-input:not(:checked),
.nh-shell-page [data-nhpanel-route="storefront.account.api"] .form-switch .form-check-input:not(:checked),
.nh-shell-page [data-nhpanel-route^="storefront.account.domain.handles"] .form-switch .form-check-input:not(:checked) {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%237b8494'/%3e%3c/svg%3e");
}

.nh-shell-page [data-nhpanel-route^="storefront.account.settings"] .form-check-input:focus-visible,
.nh-shell-page [data-nhpanel-route^="storefront.account.access"] .form-check-input:focus-visible,
.nh-shell-page [data-nhpanel-route="storefront.account.api"] .form-check-input:focus-visible,
.nh-shell-page [data-nhpanel-route^="storefront.account.domain.handles"] .form-check-input:focus-visible {
    outline: 2px solid var(--nh-primary);
    outline-offset: 2px;
}

/* Nachträglich bedienbar gemachte Hostware-Symbole (panel-account.js): Passwort anzeigen, Kopieren */
.nh-shell-page .nh-shell-main [data-nh-a11y][role="button"] {
    cursor: pointer;
    border-radius: 4px;
}

/* ---------- Konto-Bereich: Gruppenüberschriften & Aktionen ---------- */

/* Hostwares Trennüberschriften (20 px, teils mit Inline-Abständen 60 px / -3 px) einheitlich */
.nh-shell-page [data-nhpanel-route^="storefront.account.settings"] .hw-text-devider,
.nh-shell-page [data-nhpanel-route="storefront.account.api"] .hw-text-devider,
.nh-shell-page [data-nhpanel-route^="storefront.account.domain.handles"] .hw-text-devider {
    margin: 26px 0 12px !important;
    color: var(--nh-ink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.nh-shell-page [data-nhpanel-route^="storefront.account.settings"] .hw-text-devider::after,
.nh-shell-page [data-nhpanel-route="storefront.account.api"] .hw-text-devider::after,
.nh-shell-page [data-nhpanel-route^="storefront.account.domain.handles"] .hw-text-devider::after {
    margin-top: 11px;
    border: 0;
    border-top: 1px solid var(--nh-line);
}

.nh-shell-page [data-nhpanel-route^="storefront.account.settings"] .hw-text-devider + .text-muted {
    margin-top: -6px;
}

/* Profil: Booking zentriert das (Registrierungs-)Formular auf max. 920 px – in der Karte volle Breite */
.nh-shell-page [data-nhpanel-route="storefront.account.settings"] .nh-register-shell {
    width: auto;
    margin-inline: 0;
}

/* Kopfaktionen (Sitzungsfilter + "Alle anderen abmelden", Kontozugriff) umbrechen statt seitlich zu überlaufen */
.nh-shell-page [data-nhpanel-route^="storefront.account.settings"] .hw-page-actions > .d-flex,
.nh-shell-page [data-nhpanel-route^="storefront.account.access"] .hw-page-actions > .d-flex {
    flex-wrap: wrap;
    gap: 8px !important;
}

.nh-shell-page [data-nhpanel-route^="storefront.account.settings"] .hw-page-actions .form-select {
    max-width: 100%;
    min-height: 42px;
}

/* Hauptaktion eines Seitenformulars unten rechts statt über die volle Breite (mobil weiter volle Breite) */
.nh-shell-page [data-nhpanel-route="storefront.account.settings"] #authRegisterForm > .btn-block,
.nh-shell-page [data-nhpanel-route^="storefront.account.domain.handles"] .card-body > form > .btn-block {
    display: block;
    width: fit-content;
    min-width: 12rem;
    min-height: 42px;
    margin-left: auto;
}

@media (max-width: 575.98px) {
    .nh-shell-page [data-nhpanel-route="storefront.account.settings"] #authRegisterForm > .btn-block,
    .nh-shell-page [data-nhpanel-route^="storefront.account.domain.handles"] .card-body > form > .btn-block {
        width: 100%;
    }
}

/* Aktionsleiste unter eigenen Formularen (Newsletter) */
.nh-shell-page .nh-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--nh-line);
    background: var(--nh-surface-2);
}

.nh-shell-page .nh-form-actions .btn { min-height: 42px; }

@media (max-width: 575.98px) {
    .nh-shell-page .nh-form-actions .btn { width: 100%; }
}

/* ---------- Profil: Verweis auf die Newsletter-Einstellungen ---------- */

.nh-shell-page .nh-pointer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
}

.nh-shell-page .nh-pointer-text { flex: 1 1 16rem; min-width: 0; }

.nh-shell-page .nh-shell-content .nh-pointer h2 {
    margin: 0 0 2px;
    color: var(--nh-ink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.nh-shell-page .nh-pointer .btn { min-height: 40px; }

/* ---------- Datenschutz: Newsletter & Marketing-E-Mails ---------- */

.nh-shell-page .nh-newsletter-intro {
    max-width: 72ch;
    margin: 0 0 12px;
    color: var(--nh-text);
}

.nh-shell-page .nh-newsletter-intro strong { overflow-wrap: anywhere; }

.nh-shell-page .nh-newsletter-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.nh-shell-page .nh-newsletter-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nh-shell-page .nh-newsletter-item {
    padding: 12px 0;
    border-top: 1px solid var(--nh-line);
}

.nh-shell-page .nh-newsletter-item:first-child { border-top: 0; padding-top: 4px; }
.nh-shell-page .nh-newsletter-item:last-child { padding-bottom: 0; }

.nh-shell-page .nh-newsletter-item .form-check {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    margin: 0;
    padding-left: 0;
}

.nh-shell-page .nh-newsletter-item .form-check-input {
    flex: 0 0 auto;
    float: none;
    width: 2.5rem;
    height: 1.375rem;
    margin: 0;
    cursor: pointer;
}

.nh-shell-page .nh-newsletter-item .form-check-label {
    padding: 8px 0;
    color: var(--nh-ink);
    font-weight: 650;
    cursor: pointer;
}

.nh-shell-page .nh-newsletter-desc,
.nh-shell-page .nh-newsletter-state {
    margin: 0;
    padding-left: calc(2.5rem + 12px);
}

.nh-shell-page .nh-newsletter-desc {
    max-width: calc(72ch + 2.5rem + 12px);
    margin-bottom: 8px;
    color: var(--nh-muted);
    font-size: .9rem;
}

.nh-shell-page .nh-newsletter-state {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.nh-shell-page .nh-newsletter-note { color: var(--nh-muted); font-size: .84rem; }

@media (max-width: 575.98px) {
    .nh-shell-page .nh-newsletter-desc,
    .nh-shell-page .nh-newsletter-state { padding-left: 0; }
}

/* ---------- Sitzungen ---------- */

.nh-shell-page .nh-shell-content .card.nh-session-current { border-color: rgba(6, 115, 79, .32) !important; }

.nh-shell-page .nh-session-current-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.nh-shell-page .nh-session-current-icon {
    display: inline-grid;
    flex: 0 0 40px;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--nh-success-tint);
    color: var(--nh-success-ink);
}

.nh-shell-page .nh-session-current-icon i { color: inherit !important; }

.nh-shell-page .nh-session-current-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.nh-shell-page .nh-shell-content .nh-session-current-title {
    margin: 0 0 2px;
    color: var(--nh-success-ink);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .05em;
    line-height: 1.3;
    text-transform: uppercase;
}

.nh-shell-page .nh-session-device { overflow-wrap: anywhere; }

.nh-shell-page .nh-session-device-icon {
    width: 1.15em;
    margin-right: 6px;
    color: var(--nh-muted) !important;
    text-align: center;
}

/* Die Karte zeigt das Gerätesymbol schon groß */
.nh-shell-page .nh-session-current .nh-session-device-icon { display: none; }

.nh-shell-page .nh-session-ip {
    font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .86rem;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* Gestapelt (panel.css: Zelle = Flex-Zeile "Spaltenname | Wert") stünden Titel und Zusatzzeile sonst nebeneinander:
   Gerät = Kartenüberschrift, Werte als ein Block rechts, "Abmelden" als volles Touch-Ziel. */
@container nhtable (max-width: 680px) {
    .nh-shell-page .nh-sessions-table tbody td:first-child {
        display: block;
        text-align: left;
        padding-bottom: 6px !important;
    }

    .nh-shell-page .nh-sessions-table tbody td:first-child::before { display: none; }
    .nh-shell-page .nh-session-cell { min-width: 0; }
    .nh-shell-page .nh-shell-content .nh-sessions-table tbody td:last-child { width: auto; }
    .nh-shell-page .nh-sessions-table tbody td form { display: block; width: 100%; }
    .nh-shell-page .nh-sessions-table tbody td .btn { width: 100%; min-height: 44px; }
}

/* ---------- Sicherheit: 2FA-Einrichtung ---------- */

/* QR-Code + Text nebeneinander ließ dem Text mobil ~50 px Breite: untereinander, QR begrenzt */
.nh-shell-page [data-nhpanel-route="storefront.account.settings.security"] .card-body > form > .row > .col-auto img {
    max-width: 200px;
}

@media (max-width: 575.98px) {
    .nh-shell-page [data-nhpanel-route="storefront.account.settings.security"] .card-body > form > .row > .col-auto,
    .nh-shell-page [data-nhpanel-route="storefront.account.settings.security"] .card-body > form > .row > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ---------- API ---------- */

.nh-shell-page [data-nhpanel-route="storefront.account.api"] .hw-icon-card { min-height: 0; }
.nh-shell-page [data-nhpanel-route="storefront.account.api"] .hw-icon-card .card-body { padding: 16px 18px; }

.nh-shell-page [data-nhpanel-route="storefront.account.api"] .hw-icon-card h5 {
    margin: 0;
    color: var(--nh-ink);
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.nh-shell-page [data-nhpanel-route="storefront.account.api"] .hw-icon-card h6 {
    margin: 2px 0 0;
    color: var(--nh-muted);
    font-size: .85rem;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    /* Kennzahlen-Karten stießen gestapelt ohne Abstand aneinander */
    .nh-shell-page [data-nhpanel-route="storefront.account.api"] .nh-shell-content > .row > [class*="col-md-"] + [class*="col-md-"] { margin-top: 12px; }
}

@media (max-width: 575.98px) {
    /* Schlüsselfeld + "Neu generieren": untereinander statt gequetscht */
    .nh-shell-page [data-nhpanel-route="storefront.account.api"] .input-group { flex-wrap: wrap; gap: 8px; }
    .nh-shell-page [data-nhpanel-route="storefront.account.api"] .input-group > .form-control {
        flex: 1 1 100%;
        width: 100%;
        border-radius: var(--nh-radius-sm) !important;
    }
    .nh-shell-page [data-nhpanel-route="storefront.account.api"] .input-group > .btn {
        flex: 1 1 100%;
        min-height: 44px;
        margin-left: 0 !important;
        border-radius: 10px !important;
    }
}
