/*
 * auth-modern.css
 * Standalone Auth-Pages (Login / Register / PW-Reset / Logout-Success).
 *
 * Layout: zentrierte Single-Column-Karte auf hellgrauem Hintergrund.
 * Logo ueber der Karte, Footer-Links unter der Karte.
 */

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: #f1f5f9;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a2233;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body { min-height: 100vh; }

/* ============================================================
   WRAPPER — vertikal/horizontal zentrieren
   ============================================================ */
.bm-auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 40px 20px;
    box-sizing: border-box;
}
.bm-auth, .bm-auth *, .bm-auth *::before, .bm-auth *::after {
    box-sizing: border-box;
}

/* Brand-Panel rechts: in der neuen Single-Card-Optik nicht mehr benoetigt */
.bm-auth__right { display: none !important; }

/* Linke Spalte: zur Container-Wrapper-Klasse umfunktioniert */
.bm-auth__left {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
    padding: 0;
    background: transparent;
}

/* ============================================================
   LOGO ueber der Karte
   ============================================================ */
.bm-auth__brand {
    margin: 0 0 28px;
    padding: 0;
    text-align: center;
    display: block;
}
.bm-auth__brand a {
    display: inline-block;
    line-height: 1;
}
.bm-auth__brand img {
    height: 48px;
    width: auto;
    max-width: 260px;
    display: block;
    margin: 0 auto;
    border: 0;
}

/* ============================================================
   KARTE (.bm-auth__main) — weisser Card, Schatten, runde Ecken
   ============================================================ */
.bm-auth__main {
    width: 100%;
    max-width: 440px;
    margin: 0;
    padding: 36px 36px 28px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
}

.bm-auth__title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: #1a2233;
    letter-spacing: -0.01em;
    line-height: 1.2;
    text-align: center;
}
.bm-auth__lead {
    margin: 0 0 24px;
    font-size: 14px;
    color: #5f6675;
    line-height: 1.5;
    text-align: center;
}

/* ============================================================
   FORM — gescoped auf body.page-auth, identisch zur vorigen Logik,
   nur visuell auf den Card-Look abgestimmt.
   ============================================================ */
body.page-auth .bm-auth form {
    margin: 0;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}
/* forms.css setzt .stn-form auf width:580px → in der Auth-Card laeuft
   das ueber den Rand. Hier auf 100% kappen. */
body.page-auth .bm-auth form.stn-form,
body.page-auth .bm-auth .stn-form {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}
body.page-auth .bm-auth form fieldset,
body.page-auth .bm-auth form dl,
body.page-auth .bm-auth form .form {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}
/* Forms-modern .actionrow neutralisieren: dort liegt der Submit-Button.
   Default: margin-left:188px + border-top + flex — alles raus damit der
   Button full-width unter dem Form-Layout sitzt. */
body.page-auth .bm-auth form .actionrow,
body.page-auth .bm-auth form .stn-form .actionrow {
    display: block !important;
    margin: 8px 0 0 !important;
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
    width: 100% !important;
}
/* Legend (z.B. 'Login') aus dem Form aussetzen — wir haben oben
   .bm-auth__title; doppelte Headlines waeren stoerend. */
body.page-auth .bm-auth form > legend,
body.page-auth .bm-auth form fieldset > legend {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Field-Row */
body.page-auth .bm-auth form .field {
    display: grid;
    grid-template-columns: max-content 1fr;
    grid-template-areas: "label help" "input input" "errors errors";
    align-items: center;
    column-gap: 6px;
    row-gap: 6px;
    margin: 0 0 14px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
    position: relative;
    clear: both;
    float: none !important;
}
body.page-auth .bm-auth form .field > label {
    grid-area: label !important;
    justify-self: start !important;
    align-self: center !important;
    display: inline-block !important;
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #1a2233 !important;
    text-align: left !important;
    text-shadow: none !important;
    line-height: 1.4 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
body.page-auth .bm-auth form .field > label em.required,
body.page-auth .bm-auth form .field > label .required,
body.page-auth .bm-auth form .field > label > em {
    display: inline !important;
    margin-left: 3px !important;
    color: #2f56a0 !important;
    font-style: normal !important;
    font-weight: 600 !important;
    position: static !important;
}

/* Inputs */
body.page-auth .bm-auth form .field input[type="text"],
body.page-auth .bm-auth form .field input[type="email"],
body.page-auth .bm-auth form .field input[type="password"],
body.page-auth .bm-auth form .field input[type="search"],
body.page-auth .bm-auth form .field input[type="tel"],
body.page-auth .bm-auth form .field input[type="number"],
body.page-auth .bm-auth form .field input[type="url"],
body.page-auth .bm-auth form .field select,
body.page-auth .bm-auth form .field textarea {
    grid-area: input !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 46px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid #d8dce3 !important;
    border-radius: 10px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #1a2233 !important;
    box-shadow: none !important;
    outline: none !important;
    float: none !important;
    transition: border-color .12s ease, box-shadow .12s ease;
}
body.page-auth .bm-auth form .field ul.errors,
body.page-auth .bm-auth form .field .errorText,
body.page-auth .bm-auth form .field span.errorText {
    grid-area: errors !important;
    display: block !important;
    margin: 6px 0 0 !important;
    padding: 8px 12px !important;
    background: #fdecef !important;
    border: 1px solid #f5c2cd !important;
    border-radius: 8px !important;
    color: #8a1c34 !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    width: 100% !important;
    text-align: left !important;
    float: none !important;
    position: static !important;
}
body.page-auth .bm-auth form .field textarea {
    height: auto !important;
    min-height: 96px !important;
    padding: 12px 14px !important;
    resize: vertical;
}
body.page-auth .bm-auth form .field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6675' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    cursor: pointer;
}
body.page-auth .bm-auth form .field input:focus,
body.page-auth .bm-auth form .field select:focus,
body.page-auth .bm-auth form .field textarea:focus {
    border-color: #2f56a0 !important;
    box-shadow: 0 0 0 3px rgba(47, 86, 160, .12) !important;
}
body.page-auth .bm-auth form .field input::placeholder { color: #9aa0a6; }

/* Help-Icons ausblenden */
body.page-auth .bm-auth form a.help,
body.page-auth .bm-auth form .field > a.help,
body.page-auth .bm-auth .stn-form a.help {
    display: none !important;
}

/* Errors */
body.page-auth .bm-auth form ul.errors {
    list-style: none !important;
    margin: 6px 0 0 !important;
    padding: 8px 12px !important;
    background: #fdecef !important;
    border: 1px solid #f5c2cd !important;
    border-radius: 8px !important;
    color: #8a1c34 !important;
    font-size: 12px !important;
}
body.page-auth .bm-auth form ul.errors li { margin: 0; padding: 0; line-height: 1.4; }

/* Description */
body.page-auth .bm-auth form .form_subtext,
body.page-auth .bm-auth form .description {
    margin: 4px 0 0 !important;
    padding: 0 !important;
    font-size: 12px !important;
    color: #9aa0a6 !important;
    background: transparent !important;
    border: none !important;
}

/* Radio-Gruppe als Pills */
body.page-auth .bm-auth form .field input[type="radio"] + label,
body.page-auth .bm-auth form .controlset .controlset-fields > label,
body.page-auth .bm-auth form .input-pretty-container {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 8px 4px 0 !important;
    padding: 9px 16px !important;
    background: #ffffff !important;
    border: 1px solid #d8dce3 !important;
    border-radius: 8px !important;
    color: #1a2233 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    width: auto !important;
    float: none !important;
    transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
body.page-auth .bm-auth form .field input[type="radio"]:checked + label,
body.page-auth .bm-auth form .controlset .controlset-fields > input[type="radio"]:checked + label {
    background: #eff4fc !important;
    border-color: #2f56a0 !important;
    color: #2f56a0 !important;
    font-weight: 600 !important;
}
body.page-auth .bm-auth form .field input[type="radio"],
body.page-auth .bm-auth form .controlset .controlset-fields > input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
}
body.page-auth .bm-auth form .controlset.field {
    display: block !important;
    margin: 0 0 16px !important;
}
body.page-auth .bm-auth form .controlset .controlset-fields {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 6px 0 0 !important;
    padding: 0 !important;
    align-items: stretch;
}
body.page-auth .bm-auth form .controlset .controlset-fields > br {
    display: none !important;
}

/* Checkbox-Field — kompakt, ohne Card-Look (matcht Backlinked) */
body.page-auth .bm-auth form .field input[type="checkbox"] {
    margin: 0 8px 0 0 !important;
    width: 16px !important;
    height: 16px !important;
    accent-color: #2f56a0 !important;
    flex: 0 0 auto !important;
    vertical-align: middle;
    cursor: pointer;
}
body.page-auth .bm-auth form .field:has(input[type="checkbox"]) {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    margin: 4px 0 16px !important;
}
body.page-auth .bm-auth form .field:has(input[type="checkbox"]),
body.page-auth .bm-auth form .field:has(input[type="checkbox"]) *:not(a):not(strong):not(b):not(em) {
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
    color: #5f6675 !important;
}
body.page-auth .bm-auth form .field:has(input[type="checkbox"]) a {
    font-size: 12px !important;
    color: #2f56a0 !important;
    font-weight: 600 !important;
}
body.page-auth .bm-auth form .field:has(input[type="checkbox"]) > label {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 1 auto !important;
}
/* AGB-Datenschutz: das erste <label> ist der Feld-Titel
   ("AGB und Datenschutz *") und ist redundant zum Inline-Text
   ("Hiermit akzeptiere ich die AGB und die Datenschutzerklaerung...").
   Wir verstecken alle Element-Titel-Labels (jene mit em.required) und
   lassen das Description-Label sichtbar. */
body.page-auth .bm-auth form .field:has(input[type="checkbox"]) > label:has(em.required),
body.page-auth .bm-auth form .field:has(input[type="checkbox"]) > label:has(.required) {
    display: none !important;
}
body.page-auth .bm-auth form .field:has(input[type="checkbox"]) a {
    color: #2f56a0;
    text-decoration: none;
    font-weight: 600;
}
body.page-auth .bm-auth form .field:has(input[type="checkbox"]) a:hover {
    text-decoration: underline;
}
/* Pretty-Checkbox-Wrapper kompakt machen */
body.page-auth .bm-auth form .field:has(input[type="checkbox"]) .input-pretty-container {
    flex: 0 0 auto !important;
    margin: 0 8px 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}
body.page-auth .bm-auth form .field a {
    color: #2f56a0;
    text-decoration: none;
    font-weight: 600;
}
body.page-auth .bm-auth form .field a:hover { color: #1f3b74; text-decoration: underline; }

/* Submit-Button: full-width, gross, primary */
body.page-auth .bm-auth form input[type="submit"],
body.page-auth .bm-auth form button[type="submit"],
body.page-auth .bm-auth form .gradientbtn {
    display: block !important;
    width: 100% !important;
    height: 48px !important;
    padding: 0 24px !important;
    margin: 18px 0 0 !important;
    background: #2f56a0 !important;
    background-image: none !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 999px !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    text-shadow: none !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08) !important;
    text-align: center !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    letter-spacing: .01em;
    transition: background-color .12s ease, box-shadow .12s ease, transform .08s ease;
    text-transform: none !important;
    float: none !important;
}
body.page-auth .bm-auth form input[type="submit"]:hover,
body.page-auth .bm-auth form button[type="submit"]:hover,
body.page-auth .bm-auth form .gradientbtn:hover {
    background: #1f3b74 !important;
    box-shadow: 0 4px 12px rgba(47, 86, 160, .25) !important;
}

/* h1/h2/h3 innerhalb Form */
body.page-auth .bm-auth form h1,
body.page-auth .bm-auth form h2,
body.page-auth .bm-auth form h3 {
    margin: 0 0 12px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1a2233 !important;
    background: transparent !important;
    text-shadow: none !important;
}

/* Register-Form Wrapper */
body.page-auth .bm-auth #register-form {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
body.page-auth .bm-auth #register-introduce-text {
    display: none !important;
}

/* ============================================================
   Forgot-Password Inline-Block (innerhalb login.phtml)
   ============================================================ */
.bm-auth__main #bm-auth-forgot {
    margin-top: 28px !important;
    padding-top: 22px !important;
    border-top: 1px solid #eef0f3 !important;
}
.bm-auth__main #bm-auth-forgot h2 {
    text-align: center;
    font-size: 16px !important;
    margin: 0 0 6px !important;
}
.bm-auth__main #bm-auth-forgot .bm-auth__lead {
    margin-bottom: 14px;
}

/* ============================================================
   Footer-Links innerhalb der Karte
   ============================================================ */
.bm-auth__footer {
    margin: 22px 0 0;
    font-size: 13px;
    color: #5f6675;
    line-height: 1.6;
    text-align: center;
}
.bm-auth__footer a {
    color: #2f56a0;
    font-weight: 600;
    text-decoration: none;
    transition: color .12s ease;
}
.bm-auth__footer a:hover {
    color: #1f3b74;
    text-decoration: underline;
}
/* Footer-Row: stacked + zentriert. Vorher space-between zwischen
   "Passwort vergessen?" und "Du hast noch kein Konto? Registrieren"
   sind beide auf zwei Zeilen umgebrochen — jetzt jede Zeile fuer sich
   und sauber zentriert. */
.bm-auth__footer-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    text-align: center;
}
.bm-auth__footer-row > * {
    white-space: nowrap;
}

.bm-auth__inline-link {
    color: #2f56a0;
    font-weight: 600;
    text-decoration: none;
}
.bm-auth__inline-link:hover { color: #1f3b74; text-decoration: underline; }

/* Status-Alerts */
.bm-auth__alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
}
.bm-auth__alert--success { background: #e7f7ec; border: 1px solid #b8e0c5; color: #135e2e; }
.bm-auth__alert--error   { background: #fdecef; border: 1px solid #f5c2cd; color: #8a1c34; }
.bm-auth__alert strong { font-weight: 700; }

/* Standalone-CTA (Logout-Success / Bestaetigungen) */
.bm-auth__cta {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: #2f56a0;
    color: #ffffff !important;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    text-align: center;
    cursor: pointer;
    transition: background-color .12s ease, box-shadow .12s ease;
    margin: 8px 0 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.bm-auth__cta:hover {
    background: #1f3b74;
    box-shadow: 0 4px 12px rgba(47, 86, 160, .25);
}

/* ============================================================
   Legal-Links — unter der Karte, dezent
   ============================================================ */
.bm-auth__legal {
    margin: 28px 0 0;
    text-align: center;
    font-size: 12px;
    color: #9aa0a6;
}
.bm-auth__legal a {
    color: #9aa0a6;
    text-decoration: none;
    margin: 0 10px;
}
.bm-auth__legal a:hover { color: #5f6675; text-decoration: underline; }

/* Register-Form ist breiter (mehrere Felder) — gib der Karte etwas
   mehr Luft, bleibt aber im Card-Look. */
body.page-user-register .bm-auth__left,
body.page-user-register .bm-auth__main {
    max-width: 560px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 540px) {
    .bm-auth { padding: 32px 16px 32px; }
    .bm-auth__main { padding: 28px 22px 22px; border-radius: 14px; }
    .bm-auth__title { font-size: 22px; }
    .bm-auth__brand { margin: 0 0 22px; }
    .bm-auth__brand img { height: 40px; }
}
