/*
 * NhPanel – Anmeldeseiten (Login, Registrierung, Passwort vergessen/zurücksetzen, 2FA).
 * Nur auf diesen Routen geladen (<link> am Anfang von Resources/views/auth/frame.twig, damit nach Theme-CSS, panel.css
 * und custom_css), nicht Teil des panel-*.css-Bündels. Markup: frame.twig + unveränderte Hostware-Formulare.
 * Tokens aus panel.css (--nh-*, auf allen storefront.account*-Seiten geladen) mit Rückfallwerten.
 * Grundsatz: ruhig, technisch, klar begrenzt – keine Verläufe, kein Glas, keine Animationen.
 *
 * !important steht nur dort, wo booking/css/nh-custom.css selbst !important setzt (Feldrand, Feldradius, Fokus-Schatten,
 * Hover der Knöpfe) oder Bootstrap-Hilfsklassen im Hostware-Markup stecken (.mt-3, .mb-4, .text-muted, .d-inline-block).
 */

main.hw-center-main {
    --nh-auth-ink: var(--nh-ink, #0b1224);
    --nh-auth-text: var(--nh-text, #334155);
    --nh-auth-muted: var(--nh-muted, #5b6b82);
    --nh-auth-line: #cdd3e0;            /* Kartenrand: auf Weiß und auf der Seitenfläche klar sichtbar */
    --nh-auth-line-soft: #e3e7ef;       /* Trennlinien in der Karte */
    --nh-auth-field: #8792a6;           /* Feldrand 3,1:1 auf Weiß (WCAG 1.4.11); bisher rgba(15,23,42,.14) = 1,3:1 */
    --nh-auth-field-hover: #5b6b82;
    --nh-auth-surface: #ffffff;
    --nh-auth-page: #f3f4fa;            /* sehr helle, markengetönte Fläche statt Weiß/Verlauf */
    --nh-auth-primary: var(--nh-primary, #5143d9);
    --nh-auth-primary-hover: #4436c4;
    --nh-auth-primary-ink: var(--nh-primary-ink, #3b2fb8);
    --nh-auth-primary-tint: var(--nh-primary-tint, rgba(81, 67, 217, .09));
    --nh-auth-danger-ink: var(--nh-danger-ink, #b42318);
    --nh-auth-danger-tint: var(--nh-danger-tint, #fdecea);
    --nh-auth-success-ink: var(--nh-success-ink, #06734f);
    --nh-auth-success-tint: var(--nh-success-tint, #e6f6ef);
    --nh-auth-radius: 16px;
    --nh-auth-radius-sm: 10px;
    --nh-auth-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 32px rgba(15, 23, 42, .07);
    --nh-auth-focus: 0 0 0 3px rgba(81, 67, 217, .28);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 48px 16px 64px;
    background: var(--nh-auth-page);
    color: var(--nh-auth-text);
}

/* ---------- Rahmen ---------- */

.nh-auth {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
}

.nh-auth--wide {
    max-width: 1180px;
}

.nh-auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

@media (min-width: 992px) {
    .nh-auth-grid {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 40px;
    }
}

/* ---------- Karte ---------- */

.nh-auth-card {
    min-width: 0;
    padding: 36px 40px 32px;
    border: 1px solid var(--nh-auth-line);
    border-radius: var(--nh-auth-radius);
    background: var(--nh-auth-surface);
    box-shadow: var(--nh-auth-shadow);
}

/* Ohne Seitenleiste (unter 992 px) bleibt die schmale Karte schmal statt 880 px breit zu werden. */
@media (max-width: 991.98px) {
    .nh-auth:not(.nh-auth--wide) .nh-auth-card {
        width: 100%;
        max-width: 540px;
        margin: 0 auto;
    }
}

.nh-auth-title {
    margin: 0 0 6px;
    color: var(--nh-auth-ink);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.nh-auth-subtitle {
    margin: 0 0 24px;
    color: var(--nh-auth-muted);
    font-size: .97rem;
    line-height: 1.55;
}

.nh-auth-title + .nh-auth-body,
.nh-auth-title + .hw-alerting-wrapper {
    margin-top: 20px;
}

.nh-auth-body {
    min-width: 0;
}

.nh-auth-body form {
    width: 100%;
}

/* Hostwares Hinweistexte (Passwort vergessen: „Sofern zu der E-Mail-Adresse …“, 2FA) */
.nh-auth-body > p,
.nh-auth-body p.d-inline-block {
    display: block !important;
    max-width: none !important;
    margin: 0 0 20px;
    color: var(--nh-auth-text);
    font-size: .97rem;
    line-height: 1.55;
}

/* ---------- Meldungen (Hostware alerting.twig / alert.twig) ---------- */

.nh-auth-card .hw-alerting-wrapper {
    width: 100%;
    max-width: none;            /* Core: .hw-center-main .hw-alerting-wrapper { max-width: 600px } */
    margin-bottom: 0;
}

/* #passkey-error trägt style="display: none" und wird von Hostwares JS eingeblendet – deshalb hier kein !important. */
.nh-auth-card .alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid var(--nh-auth-line);
    border-radius: var(--nh-auth-radius-sm);
    background: var(--nh-auth-surface);
    color: var(--nh-auth-text);
    font-size: .94rem;
    line-height: 1.5;
    box-shadow: none;
}

/* nh-custom: .hw-alerting-wrapper .alert:last-child { margin-bottom: 0 } – Abstand zum Formular behalten */
.nh-auth-card .hw-alerting-wrapper .alert:last-child {
    margin-bottom: 20px;
}

.nh-auth-card .alert > i {
    flex: 0 0 auto;
    margin-top: 3px;
    font-size: 1.05rem;
}

.nh-auth-card .alert-danger {
    border-color: rgba(180, 35, 24, .4);
    background: var(--nh-auth-danger-tint);
    color: var(--nh-auth-danger-ink);
}

.nh-auth-card .alert-success {
    border-color: rgba(6, 115, 79, .4);
    background: var(--nh-auth-success-tint);
    color: var(--nh-auth-success-ink);
}

.nh-auth-card .alert-primary {
    border-color: rgba(81, 67, 217, .34);
    background: var(--nh-auth-primary-tint);
    color: var(--nh-auth-primary-ink);
}

/* ---------- Abschnitte (Registrierung) ---------- */

.nh-auth-section,
.nh-auth-body .hw-text-devider {
    display: block;
    margin: 26px 0 16px !important;
    padding: 22px 0 0;
    border: 0;
    border-top: 1px solid var(--nh-auth-line-soft);
    color: var(--nh-auth-muted);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .07em;
    line-height: 1.4;
    text-transform: uppercase;
    text-align: left;
}

.nh-auth-body .hw-text-devider::before,
.nh-auth-body .hw-text-devider::after {
    display: none;
}

.nh-auth-body > .nh-auth-section:first-child,
.nh-auth-body > .alert + .nh-auth-section {
    margin-top: 0 !important;
    padding-top: 0;
    border-top: 0;
}

/* „Unternehmen“ klappt direkt unter dem Häkchen „Geschäftskunde?“ auf und das erste Feld heißt ebenfalls
   „Unternehmen“ – die Zwischenüberschrift wäre dreifach. */
.nh-auth-body .hw-only-company .hw-text-devider {
    display: none;
}

/* Unterüberschrift „Newsletter“ direkt unter „Einwilligungen“ */
.nh-auth-body .nh-auth-section + .hw-text-devider {
    margin: 4px 0 10px !important;
    padding-top: 0;
    border-top: 0;
    color: var(--nh-auth-ink);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.nh-auth-body .hw-text-devider + p.text-muted {
    margin: -4px 0 10px;
    font-size: .9rem;
    line-height: 1.5;
}

/* Booking-Bootstrap: .text-muted = Weiß 75 % !important (für dunkle Flächen), lesbar bisher nur über .card .text-muted.
   Ohne .card wären Newsletter-Beschreibung und Hinweise auf Weiß unsichtbar. */
.nh-auth .text-muted {
    color: var(--nh-auth-muted) !important;
}

/* ---------- Formularraster (Hostware-.row/.col-md-* als Grid: mobil eine Spalte, ab 768 px kurze Felder nebeneinander) ---------- */

.nh-auth-body .row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 0;
    margin: 0;
}

.nh-auth-body .row > [class*="col"] {
    grid-column: span 12;
    width: auto;
    max-width: none;
    flex: none;
    padding: 0;
}

@media (min-width: 768px) {
    .nh-auth-body .row > .col-md-3 { grid-column: span 3; }
    .nh-auth-body .row > .col-md-4 { grid-column: span 4; }
    .nh-auth-body .row > .col-md-5 { grid-column: span 5; }
    .nh-auth-body .row > .col-md-6 { grid-column: span 6; }
    .nh-auth-body .row > .col-md-7 { grid-column: span 7; }
    /* Registrierung, erste Zeile (.col-md ohne Zahl, DOM: Anrede, Vorname, Nachname, Sprache):
       Anrede halb, darunter Vorname | Nachname, darunter Sprache halb – Reihenfolge und Tab-Folge bleiben Hostware. */
    .nh-auth-body .row > .col-md { grid-column: span 6; }
    .nh-auth-body .row > .col-md:nth-child(2),
    .nh-auth-body .row > .col-md:nth-child(4) { grid-column: 1 / span 6; }

    /* Adresse: Straße | Nr., Zusatz, PLZ | Ort, Land. Zuordnung über name= (Hostware vergibt die id
       loginForm-street-number doppelt für Hausnummer und Zusatz). Ohne :has() bleibt Bootstraps Aufteilung. */
    .nh-auth-body .row:has(> [class*="col"] [name="zipcode"]) > .col-md-5 { grid-column: span 8; }
    .nh-auth-body .row:has(> [class*="col"] [name="zipcode"]) > .col-md-3 { grid-column: span 4; }
    .nh-auth-body .row:has(> [class*="col"] [name="zipcode"]) > .col-md-4:has([name="street_extra"]),
    .nh-auth-body .row:has(> [class*="col"] [name="zipcode"]) > .col-md-4:has([name="country"]) { grid-column: span 12; }
    .nh-auth-body .row:has(> [class*="col"] [name="zipcode"]) > .col-md-4:has([name="zipcode"]) { grid-column: span 4; }
    .nh-auth-body .row:has(> [class*="col"] [name="zipcode"]) > .col-md-4:has([name="city"]) { grid-column: span 8; }
}

/* ---------- Felder ---------- */

.nh-auth-body .form-group {
    margin: 0 0 18px;
}

.nh-auth-body label,
.nh-auth-body .form-label {
    display: inline-block;
    margin: 0 0 6px;
    color: var(--nh-auth-ink);
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.4;
}

/* Passwort-Zeile im Login: Beschriftung links, „Vergessen?“ rechts (Hostware-Markup) */
.nh-auth-body .form-group > .d-flex {
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.nh-auth-body .form-group > .d-flex > label {
    margin-bottom: 0;
}

.nh-auth-body .form-group > .d-flex > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: -12px 0;
    color: var(--nh-auth-primary-ink) !important;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.nh-auth-body .form-group > .d-flex > a:hover {
    text-decoration: underline !important;
}

/* Hostwares Passwort-Auge (JS: .input-toggler): größere Trefferfläche ohne Versatz der Zeile */
.nh-auth-body label .input-toggler {
    display: inline-block;
    margin: -12px -6px -12px 0;
    padding: 12px 10px;
    color: var(--nh-auth-muted);
    font-size: .95em;
    vertical-align: middle;
}

.nh-auth-body label .input-toggler:hover {
    color: var(--nh-auth-ink);
}

.nh-auth-body .form-control,
.nh-auth-body .form-select,
.nh-auth-body .custom-select {
    display: block;
    width: 100%;
    min-height: 46px;
    height: auto;
    padding: 10px 14px;
    border: 1px solid var(--nh-auth-field) !important;
    border-radius: var(--nh-auth-radius-sm) !important;
    background-color: var(--nh-auth-surface) !important;
    color: var(--nh-auth-ink);
    font-size: 1rem;
    line-height: 1.4;
    box-shadow: none;
    transition: none;
}

.nh-auth-body .form-select,
.nh-auth-body select.form-control {
    padding-right: 2.5rem;
}

.nh-auth-body .form-control::placeholder {
    color: #6b778c;                     /* 4,5:1 auf Weiß */
    opacity: 1;
}

/* nh-custom setzt Hover (0,4,0) und Fokus mit !important – deshalb hier gleiche Gewichtung, später geladen. */
.nh-auth-body .form-control:hover:not(:focus),
.nh-auth-body .form-select:hover:not(:focus),
.nh-auth-body .custom-select:hover:not(:focus) {
    border-color: var(--nh-auth-field-hover) !important;
}

.nh-auth .nh-auth-body .form-control:focus,
.nh-auth .nh-auth-body .form-select:focus,
.nh-auth .nh-auth-body .custom-select:focus {
    border-color: var(--nh-auth-primary) !important;
    outline: 0;
    box-shadow: var(--nh-auth-focus) !important;
}

.nh-auth-body .form-text,
.nh-auth-body small.form-text {
    display: block;
    margin-top: 6px;
    color: var(--nh-auth-muted);
    font-size: .86rem;
}

/* 2FA-Code: lesbare Ziffern */
.nh-auth-body #form-code {
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: .12em;
}

/* ---------- Kontrollkästchen (Geschäftskunde, Newsletter, Datenschutz) ---------- */

.nh-auth-body .form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 44px;
    margin: 0 0 4px !important;
    padding: 10px 0;
}

.nh-auth-body .form-check-input {
    flex: 0 0 auto;
    float: none;
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
    border: 1px solid #6b778c;          /* 4,5:1 auf Weiß; Booking: #dfdfe3 = 1,3:1 */
    border-radius: 6px;
    background-color: var(--nh-auth-surface);
    cursor: pointer;
    box-shadow: none;
    transition: none;
}

.nh-auth-body .form-check-input:checked {
    border-color: var(--nh-auth-primary);
    background-color: var(--nh-auth-primary);
}

.nh-auth-body .form-check-input:focus {
    border-color: var(--nh-auth-primary);
    box-shadow: var(--nh-auth-focus);
}

.nh-auth-body .form-check-input:focus-visible {
    outline: 2px solid var(--nh-auth-primary);
    outline-offset: 2px;
}

.nh-auth-body .form-check-label {
    margin: 0;
    padding-top: 1px;
    color: var(--nh-auth-ink);
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
}

.nh-auth-body .form-check-label small {
    margin-top: 2px;
    color: var(--nh-auth-muted);
    font-size: .86rem;
    font-weight: 400;
    line-height: 1.5;
}

.nh-auth-body .form-check-label a {
    color: var(--nh-auth-primary-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nh-auth-body .hw-newsletter-list-selection {
    margin-bottom: 0 !important;
}

/* hCaptcha: fester Rahmen 303 × 78 px. Karte innen: 375 px → 325, 360 px → 310; darunter verkleinert. */
.nh-auth-body .h-captcha {
    margin: 0 !important;
}

.nh-auth-body form > .mb-2:has(> .h-captcha) {
    margin: 14px 0 18px !important;
}

/* ---------- Knöpfe ---------- */

.nh-auth-body .btn-block {
    display: block;
    width: 100%;
}

.nh-auth-body .btn {
    min-height: 48px;
    padding: 11px 18px;
    border-radius: var(--nh-auth-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    box-shadow: none;
    filter: none;
    transition: none;
    transform: none !important;         /* nh-custom: .btn:hover { transform: translateY(-1px) } */
}

.nh-auth-body .btn-primary {
    border: 1px solid var(--nh-auth-primary);
    background: var(--nh-auth-primary);
    color: #fff;
}

/* nh-custom: .btn-primary:hover:not(:disabled):not(.disabled) { box-shadow … !important } (0,4,0) */
.nh-auth .nh-auth-body .btn.btn-primary:hover,
.nh-auth .nh-auth-body .btn.btn-primary:focus,
.nh-auth .nh-auth-body .btn.btn-primary:active {
    border-color: var(--nh-auth-primary-hover);
    background: var(--nh-auth-primary-hover);
    color: #fff;
    box-shadow: none !important;
    filter: none !important;
}

.nh-auth-body .btn:focus-visible {
    outline: 2px solid var(--nh-auth-primary);
    outline-offset: 2px;
    box-shadow: none !important;
}

/* Passkey: klare Zweitaktion als Umriss (Hostware: .btn-outline-primary.btn-sm, JS #hw-passkey-login) */
.nh-auth-body .btn-outline-primary {
    min-height: 46px;
    margin-top: 12px !important;
    border: 1px solid var(--nh-auth-field);
    background: var(--nh-auth-surface);
    color: var(--nh-auth-ink);
    font-size: .95rem;
}

.nh-auth .nh-auth-body .btn.btn-outline-primary:hover,
.nh-auth .nh-auth-body .btn.btn-outline-primary:focus,
.nh-auth .nh-auth-body .btn.btn-outline-primary:active {
    border-color: var(--nh-auth-primary) !important;
    background: var(--nh-auth-primary-tint) !important;
    color: var(--nh-auth-primary-ink) !important;
    box-shadow: none !important;
}

.nh-auth-body .btn-outline-primary i {
    margin-right: 6px;
    color: var(--nh-auth-muted);
}

.nh-auth-body .btn-outline-primary:hover i,
.nh-auth-body .btn-outline-primary:focus i {
    color: inherit;
}

.nh-auth-body #passkey-error {
    margin: 14px 0 0 !important;
}

/* ---------- Kartenfuß (Registrieren / Anmelden / Zurück) ---------- */

.nh-auth-foot {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--nh-auth-line-soft);
    color: var(--nh-auth-muted);
    font-size: .95rem;
    line-height: 1.5;
    text-align: center;
}

.nh-auth-foot a {
    display: inline-block;
    padding: 10px 2px;
    margin: -10px 0;
    color: var(--nh-auth-primary-ink);
    font-weight: 600;
    text-decoration: none;
}

.nh-auth-foot a:hover {
    text-decoration: underline;
}

.nh-auth-foot a:focus-visible,
.nh-auth-body a:focus-visible {
    outline: 2px solid var(--nh-auth-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Seitenleiste (ab 992 px): drei Fakten, ohne Kasten ---------- */

.nh-auth-aside {
    display: none;
}

@media (min-width: 992px) {
    .nh-auth-aside {
        display: block;
        padding: 38px 0 0;              /* Überschrift auf Höhe des Kartentitels */
    }

    /* Lange Registrierung: Fakten bleiben beim Scrollen sichtbar (Kopfzeile der Seite ist sticky) */
    .nh-auth--wide .nh-auth-aside {
        position: sticky;
        top: 96px;
    }
}

.nh-auth-aside-title {
    margin: 0 0 22px;
    color: var(--nh-auth-ink);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.3;
}

.nh-auth-facts {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nh-auth-facts li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.nh-auth-fact-icon {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--nh-auth-line);
    border-radius: var(--nh-auth-radius-sm);
    background: var(--nh-auth-surface);
    color: var(--nh-auth-primary-ink);
    font-size: 1rem;
}

.nh-auth-fact-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding-top: 1px;
}

.nh-auth-fact-text strong {
    color: var(--nh-auth-ink);
    font-size: .97rem;
    font-weight: 600;
    line-height: 1.35;
}

.nh-auth-fact-text small {
    color: var(--nh-auth-muted);
    font-size: .88rem;
    line-height: 1.5;
}

/* ---------- Schmal ---------- */

@media (max-width: 767.98px) {
    main.hw-center-main {
        padding: 24px 12px 48px;
    }

    .nh-auth-card {
        padding: 26px 20px 24px;
    }

    .nh-auth-title {
        font-size: 1.45rem;
    }
}

/* 360-px-Geräte: hCaptcha (303 px) muss in die Karte passen → 360 − 2 × 8 − 2 × 16 − 2 = 310 px */
@media (max-width: 374.98px) {
    main.hw-center-main {
        padding-left: 8px;
        padding-right: 8px;
    }

    .nh-auth-card {
        padding: 22px 16px 20px;
    }
}

/* 320-px-Geräte: 270 px innen → hCaptcha auf 88 % (267 px) */
@media (max-width: 352.98px) {
    .nh-auth-body .h-captcha {
        transform: scale(.88);
        transform-origin: 0 0;
    }
}
