/* ============================================================================
   auth.css — Styling fuer den anonymen Auth-Bereich (Login, Registrieren,
   Passwort-vergessen/-zuruecksetzen).

   Optik bewusst am bestehenden Portal ausgerichtet (eessiStyles.css):
     - Seitenhintergrund #EFEEEF, Kopf-/Fusszeile weiss mit schwarzer Trennlinie
     - eckige Ecken (border-radius: 0), Akzentfarbe Rot #dc3545
     - Outline-Buttons (schwarze Schrift/Rahmen, rot beim Hover)
     - Eingabefelder 44px hoch, roter Fokusrahmen wie im uebrigen Portal
   Neu sind nur Aufteilung und Bedienkomfort (Karte, Spinner, Passwort-Toggle,
   Regelpruefung) - nicht die Farbwelt.

   Ohne externe Abhaengigkeiten (keine CDN-Fonts/-Icons) -> laedt in der
   ITSG-DMZ ohne Internet garantiert korrekt.
   ============================================================================ */

/* Lokale Schrift (kein Google-Fonts-CDN); gleiche Familie wie im Portal. */
@font-face {
    font-family: 'MontserratLocal';
    src: url('../Fonts/Montserrat_Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --auth-accent: #dc3545;              /* Portal-Rot */
    --auth-accent-soft: #ffd7d7;         /* wie ::selection im Portal */
    --auth-page-bg: #EFEEEF;             /* Portal-Seitenhintergrund */
    --auth-card-bg: #ffffff;
    --auth-text: #000000;
    --auth-text-muted: #9999B2;          /* Portal-Grauton */
    --auth-border: #ced4da;
    --auth-border-strong: #000000;
    --auth-danger: #dc3545;
    --auth-success: #2e7d32;
    --auth-font: 'MontserratLocal', 'Montserrat', sans-serif;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--auth-page-bg);
    color: var(--auth-text);
    font-family: var(--auth-font);
    font-size: 15px;
    line-height: 1.5;
}

/* --- Kopf / Fuss (wie Portal: weiss, schwarze Trennlinie) ----------------- */
.auth-header {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border-bottom: 1px solid black;
    min-height: 80px;
    padding: 8px 16px;
}
.auth-brand img { height: 48px; width: auto; display: block; }

.auth-main {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px 40px;
}

.auth-footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border-top: 1px solid black;
    min-height: 60px;
    padding: 12px 16px;
    font-size: 14px;
}
.auth-footer a { color: #000000; text-decoration: none; }
.auth-footer a:hover { color: var(--auth-accent); text-decoration: none; }

/* --- Karte (weiss, eckig, schlichter Rahmen) ------------------------------ */
.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-border-strong);
    border-radius: 0;
    padding: 28px 30px 26px;
}
.auth-card--wide { max-width: 940px; }

.auth-title { font-size: 1.5rem; font-weight: 500; margin: 0 0 4px; }
.auth-subtitle { color: #000; margin: 0 0 20px; font-size: 14px; line-height: 1.8; }
.auth-card hr { border: 0; border-top: 1px solid var(--auth-border); margin: 16px 0 20px; }

/* --- Felder --------------------------------------------------------------- */
.auth-field { margin-bottom: 18px; }
.auth-field > label,
.auth-label { display: block; font-weight: 400; font-size: 15px; margin-bottom: 6px; }
.auth-req { color: var(--auth-danger); }

.auth-input,
.auth-page input[type="text"].form-control,
.auth-page input[type="email"].form-control,
.auth-page input[type="password"].form-control,
.auth-page input[type="tel"].form-control {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    padding: 8px 12px;
    font: inherit;
    color: var(--auth-text);
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: 0;
}
textarea.auth-input { height: auto; min-height: 44px; resize: vertical; }

.auth-input:focus,
.auth-page .form-control:focus {
    border-color: var(--auth-accent);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, .25);
}
.auth-input[readonly] { background: #f3f3f4; color: #555; }
.auth-input.input-invalid { border-color: var(--auth-danger); }
.auth-input.input-valid { border-color: var(--auth-success); }

/* Passwortfeld mit Auge-Toggle */
.auth-input-group { position: relative; display: flex; }
.auth-input-group .auth-input { padding-right: 44px; }
.auth-toggle {
    position: absolute; top: 0; right: 0; height: 44px; width: 42px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 0; cursor: pointer; color: #666;
}
.auth-toggle:hover { color: var(--auth-accent); }
.auth-toggle svg { width: 20px; height: 20px; }

/* --- Buttons (Outline-Stil wie .btn-outline-danger im Portal) ------------- */
.auth-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 18px;
    font: inherit;
    color: #000000;
    background-color: transparent;
    border: 1px solid #000000;
    border-radius: 0;
    cursor: pointer;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}
.auth-btn:hover { color: #fff; background-color: var(--auth-accent); border-color: var(--auth-accent); }
.auth-btn:focus { outline: 0; box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, .25); }
.auth-btn[disabled] { color: var(--auth-text-muted); border-color: var(--auth-border); background-color: transparent; cursor: default; }

.auth-btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 10px 18px;
    font: inherit; color: #000000;
    background-color: transparent;
    border: 1px solid #000000; border-radius: 0;
    text-decoration: none; cursor: pointer;
}
.auth-btn-secondary:hover { color: #fff; background-color: var(--auth-accent); border-color: var(--auth-accent); text-decoration: none; }

.auth-actions { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.auth-links { margin-top: 18px; font-size: 14px; }
.auth-links a { color: #000000; text-decoration: underline; }
.auth-links a:hover { color: var(--auth-accent); }
.auth-link-inline { color: #000000; text-decoration: underline; }
.auth-link-inline:hover { color: var(--auth-accent); }

/* --- Spinner (nimmt die Textfarbe des Buttons an) ------------------------- */
.auth-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(0, 0, 0, .25);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
    display: none;
}
.auth-btn.is-loading .auth-spinner { display: inline-block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* --- Meldungen ------------------------------------------------------------ */
.auth-alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px; border-radius: 0; border: 1px solid;
    font-size: 14px; margin-bottom: 20px;
}
.auth-alert svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; }
.auth-alert--danger  { background: #fdecea; border-color: var(--auth-danger); color: #000; }
.auth-alert--success { background: #eef6ee; border-color: var(--auth-success); color: #000; }
.auth-alert--info    { background: #f5f4f5; border-color: #000; color: #000; }

.auth-error { color: var(--auth-danger); font-size: 14px; margin-top: 6px; display: block; }
.field-validation-error, .auth-page .text-danger { color: var(--auth-danger) !important; }
.auth-hint { color: #555; font-size: 13px; margin-top: 6px; line-height: 1.8; }

/* --- Passwort-Regeln / Staerke ------------------------------------------- */
.auth-rules {
    list-style: none; margin: 10px 0 0; padding: 12px 14px;
    background: var(--auth-page-bg); border: 1px solid var(--auth-border);
}
.auth-rules li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #555; padding: 2px 0; }
.auth-rules li.ok { color: var(--auth-success); }
.auth-rules li.ok .dot { background: var(--auth-success); }
.auth-rules li .dot { width: 8px; height: 8px; border-radius: 50%; background: #bbb; display: inline-block; }

.auth-strength { height: 6px; background: #e2e1e3; margin-top: 10px; overflow: hidden; }
.auth-strength > span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }
.auth-strength.s1 > span { width: 33%;  background: var(--auth-danger); }
.auth-strength.s2 > span { width: 66%;  background: #e0a63b; }
.auth-strength.s3 > span { width: 100%; background: var(--auth-success); }
.auth-strength-label { font-size: 12.5px; color: #555; margin-top: 4px; }

/* --- Diverses ------------------------------------------------------------- */
.auth-captcha { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 6px 0 10px; }
.auth-captcha img { border: 1px solid var(--auth-border); }
.auth-icon-refresh { background: none; border: 0; cursor: pointer; color: #666; padding: 4px; }
.auth-icon-refresh:hover { color: var(--auth-accent); }

@media (max-width: 560px) {
    .auth-card { padding: 22px 18px; }
}

/* Zwei-Spalten-Raster fuer die Registrierung innerhalb der breiten Karte */
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
@media (max-width: 720px) { .auth-grid { grid-template-columns: 1fr; } }

/* Registrierung: Labelspalten vertikal zu ihren Feldern ausrichten.
   (Keine Breiten-Overrides - die wuerden das Bootstrap-Raster der IK-Zeile
   mit col-lg-6/col-lg-2 sprengen.) */
.auth-card--wide .row > [class*="col-lg-4"] { align-self: center; }
.auth-card--wide label { margin-bottom: 0; }
