/* Styles für login.html */

.login-wrapper {
    max-width: 420px;
    margin: 48px auto;
    padding: 24px;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 2px 16px var(--shadow);
}

.login-wrapper h1 {
    margin-top: 0;
    font-size: 1.4rem;
}

.login-wrapper fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-inline-size: 0;
}

.login-wrapper legend {
    font-weight: 600;
    margin: 0 0 4px;
    padding: 0;
}

.login-wrapper label {
    display: block;
    margin: 12px 0 4px;
    font-weight: 600;
}

.login-wrapper input {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 6px;
    box-sizing: border-box;
}

/*
 * Grid statt position:absolute+top-Offset: Label/Input/Button bleiben im DOM
 * direkte Geschwister (a11y-Linter verlangt Label direkt neben Input), die
 * grid-area-Zuordnung bestimmt unabhängig davon die visuelle Anordnung.
 */
.password-field {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "label label"
        "input button";
    align-items: center;
    column-gap: 4px;
}

.password-field label {
    grid-area: label;
}

.password-field input {
    grid-area: input;
}

.password-toggle {
    grid-area: button;
    padding: 6px 8px;
    background: transparent;
    /* Explizite Textfarbe: ohne sie erbte das Auge-Icon eine Farbe, die fast mit
       dem Kartenhintergrund verschmolz (pa11y: 1.05:1, gefordert 4.5:1). --text
       liegt in beiden Themes bei ~14:1 gegen --card; --text-muted waere im
       hellen Theme mit ~4.6:1 zu knapp an der Grenze. */
    color: var(--text, #1e293b);
    border: 0;
    border-radius: 4px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.password-toggle:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.login-wrapper button.primary {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.login-wrapper button.primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-error {
    margin-top: 12px;
    color: #b91c1c;
    font-weight: 600;
    min-height: 1.2em;
}

.login-status {
    margin-top: 12px;
    color: #166534;
    font-weight: 600;
    min-height: 1.2em;
}

.login-meta {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-toggle {
    margin-top: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-toggle a {
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
}

.pw-strength-track {
    height: 4px;
    background: var(--border, #e2e8f0);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.pw-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition:
        width 0.2s,
        background 0.2s;
}

.pw-strength-fill[data-level="weak"] {
    width: 33%;
    background: #ef4444;
}
.pw-strength-fill[data-level="medium"] {
    width: 66%;
    background: #f59e0b;
}
.pw-strength-fill[data-level="strong"] {
    width: 100%;
    background: #22c55e;
}

.pw-strength-label {
    font-size: 0.78rem;
    margin: 3px 0 0;
    min-height: 1em;
}

.pw-strength-label[data-level="weak"] {
    color: #ef4444;
}
.pw-strength-label[data-level="medium"] {
    color: #92400e;
}
.pw-strength-label[data-level="strong"] {
    color: #166534;
}

/* Hover-Effekte nur für echte Zeigegeräte: auf Touch bleibt der
   Hover-Zustand nach dem Tap kleben, bis woanders hingetippt wird. */
@media (hover: hover) and (pointer: fine) {
    .password-toggle:hover {
        background: var(--border, #e2e8f0);
    }
}
