/* ==========================================================================
   1. CSS Custom Properties (Variablen)
   ========================================================================== */
:root {
    /* Basis-Schriftgröße und responsive Skalierung */
    font-size: clamp(14px, 1vw + 0.5rem, 20px);

    /* Farbpalette */
    --primary-color: #152039;
    --secondary-color: #e5803a;

    /* Typografie */
    --font-family: Arial, sans-serif;
    --font-size-base: 1rem;
    --font-size-label: 1.125rem;
    --font-size-input: 1rem;
    --font-size-button: 1.125rem;

    /* Abstände und Ränder */
    --border-radius: 1.25rem;
    --container-padding: 2rem;
    --input-padding: 0.75rem;
    --spacing-sm: 1rem;

    /* Schatten und Rahmen */
    --box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    --input-border-color: #ccc;

    /* Button-Padding */
    --button-padding-y: 0.75rem;
    --button-padding-x: 1rem;
}

/* ==========================================================================
   2. Basis-Elemente
   ========================================================================== */
html {
    /* Volle Höhe für Flexbox-Layout */
    height: 100%;
}

body {
    /* Hintergrund- und Flexbox-Einstellungen */
    background-color: var(--primary-color);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    position: relative;
}

/* ==========================================================================
   3. Layout-Struktur
   ========================================================================== */
.login-container {
    /* Gesamt-Wrapper für die Login-Seite */
    display: flex;
    width: 100%;
    height: 100vh;
}

.left-pane {
    /* Linker Bereich mit Hintergrundbild und Einführungstext */
    width: 60%;
    padding: var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.left-pane .intro {
    /* Textcontainer in der linken Spalte */
    max-width: 80%;
    text-align: left;
}

.left-pane .intro h1 {
    /* Überschrift im Einführungstext */
    font-size: 2.6rem;
    margin-bottom: var(--spacing-sm);
}

.left-pane .intro p {
    /* Absatz im Einführungstext */
    font-size: 1.25rem;
    line-height: 1.5;
}

.right-pane {
    /* Rechter Bereich mit Formular */
    width: 40%;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--container-padding);
}

.form-wrapper {
    /* Maximale Breite des Formulars */
    max-width: 25rem;
    width: 100%;
}

/* ==========================================================================
   4. Komponenten
   ========================================================================== */

/* 4.1 Logo */
.logo-container {
    /* Zentrierter Logo-Container */
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: contain;
    background-repeat: no-repeat;
    margin: 0 auto 20px;
}

.logo-container img {
    /* Logo-Größe und Skalierung */
    max-width: 12.5rem;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* 4.2 Navigationsoptionen */
.options {
    /* Leiste für Optionen wie "Remember me" */
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-label);
}

/* 4.3 Links */
a {
    /* Grundstil für Links */
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    /* Hover-Effekt für Links */
    text-decoration: underline;
}

/* 4.4 Zurück-zum-Login-Link */
.back-to-login {
    /* Container für den Zurück-Link */
    text-align: left;
    margin-bottom: 20px;
}

.back-to-login a {
    /* Stil des Zurück-Links */
    font-size: var(--font-size-label);
}

.back-to-login a:hover {
    /* Hover-Effekt für Zurück-Link */
    text-decoration: underline;
}

.back-to-login i {
    /* Icon-Abstand im Zurück-Link */
    margin-right: 8px;
}

/* 4.5 Buttons */
button {
    /* Grundlegendes Button-Design */
    background-color: var(--secondary-color);
    color: white;
    padding: var(--button-padding-y) var(--button-padding-x);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: var(--font-size-button);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

button::before {
    /* Liquid Hover Effekt: gleitender Glanz */
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0.3), rgba(255,255,255,0));
    transform: skewX(-20deg);
    transition: left 0.5s;
    z-index: -1;
}

button:hover {
    /* Hover-Zustand für Button */
    background-color: var(--secondary-color);
    opacity: 0.8;
}

button:hover::before {
    /* Aktivierung des Liquid Hover Effekts */
    left: 100%;
}

button:disabled,
button[disabled] {
    /* Deaktivierter Button-Stil */
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.7;
}

button:disabled::before,
button[disabled]::before {
    /* Entfernen des Effekts bei deaktiviertem Button */
    content: none;
}

button:disabled:hover::before,
button[disabled]:hover::before {
    /* Kein Effekt beim Hover, wenn deaktiviert */
    left: -100%;
}

/* 4.6 Nachrichtenboxen */
.message {
    /* Basis-Stil für Nachrichten */
    margin-top: 20px;
    padding: 10px;
    border-radius: var(--border-radius);
    text-align: center;
}

.success {
    /* Erfolgsmeldung */
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    /* Fehlermeldung */
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 4.7 Eingabefelder mit Icon */
.input-icon {
    /* Wrapper für Eingabe mit Icon */
    position: relative;
    width: 100%;
    margin-bottom: var(--spacing-sm);
}

.input-icon .icon {
    /* Positionierung des Icons */
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.2rem;
    height: auto;
}

.input-icon input {
    /* Stil des Eingabefelds */
    width: 100%;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.125rem;
    background-color: #EAE6FF;
    padding: var(--input-padding) 1rem;
    padding-left: calc(1.2rem + 2rem);
    box-sizing: border-box;
}

/* 4.8 Passwortstärke-Anzeige */
.password-strength-bar {
    /* Hintergrundleiste */
    height: 10px;
    width: 100%;
    background-color: #ddd;
    border-radius: var(--border-radius);
    margin-top: 5px;
    margin-bottom: 5px;
    position: relative;
}

.password-strength-level {
    /* Füllleiste für Stärke */
    height: 100%;
    width: 0;
    background-color: red;
    border-radius: var(--border-radius);
    transition: width 0.3s;
}

.password-strength-bar::before,
.password-strength-bar span,
.password-strength-bar span:nth-child(2),
.password-strength-bar::after {
    /* Markierungen bei 20%, 40%, 60%, 80% */
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #fff;
}

.password-strength-bar::before {
    left: 20%;
}

.password-strength-bar span {
    left: 40%;
}

.password-strength-bar span:nth-child(2) {
    left: 60%;
}

.password-strength-bar::after {
    left: 80%;
}

.password-strength-label {
    /* Beschriftung der Stärkenanzeige */
    font-size: 0.9em;
    margin-top: 5px;
    margin-bottom: 2px;
    text-align: left;
    width: 50%;
}

.requirements {
    /* Container der Anforderungen */
    margin-left: 5px;
    font-size: 0.9em;
    max-width: 80%;
    margin-bottom: 20px;
}

.requirement {
    /* Einzelanforderung */
    color: red;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.requirement.valid {
    /* Erfüllte Anforderung */
    color: green;
}

.requirement .icon {
    /* Icon-Abstand bei Anforderungen */
    margin-right: 8px;
    display: flex;
    align-items: center;
}

/* ==========================================================================
   5. Responsive Styles (Mobil)
   ========================================================================== */
@media (max-width: 768px) {
    /* Körper: Hintergrundbild aus .left-pane nutzen und Inhalt zentrieren */
    body {
        justify-content: center;
        background: none; /* Weißen Hintergrund entfernen */
        position: relative;
        overflow: hidden;
        padding: 0px 10px;
    }

    /* Left-pane: als Vollbild-Hintergrund verwenden */
    .left-pane {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 0;
    }
    .left-pane .intro {
        display: none; /* Text ausblenden */
    }

    /* Right-pane: abgerundete Box für das Login-Formular */
    .right-pane {
        width: 90%;
        max-width: 25rem;
        background-color: rgba(255, 255, 255, 1);
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
        position: relative;
        z-index: 1;
        padding: var(--container-padding);
        margin: 1rem auto;
    }

    /* Formular-Wrapper: volle Breite innerhalb der Box */
    .form-wrapper {
        max-width: 100%;
    }
    /* Verhindert, dass die Login-Box die volle Höhe einnimmt */
    .login-container {
        height: auto;
    }
    /* Login-Box nicht strecken */
    .right-pane {
        align-self: center;
    }
}