/* index.css – Login-Bildschirm, abgestimmt auf das dunkle Webdesign
   (vgl. styles/style.css: --bg-dark var(--bg-dark), --nav-bg var(--nav-bg),
    --primary-color #007bff, Segoe UI). */

:root {
    --primary-color: #007bff;
    --bg-dark: #1a1d21;
    --card-bg: #2a2e35;
    --field-bg: #1f232b;
    --border: #3f4458;
    --card-border: rgba(255, 255, 255, 0.06);
    --placeholder: rgba(255, 255, 255, 0.35);
    --text-light: #f8f9fa;
    --text-muted: #a0a0a0;
    --transition: all 0.3s ease;
    color-scheme: dark;
}

/* Helles Farbschema (gesetzt von js/theme.js; Umschalter im Header der
   inneren Seiten — die Login-Seite folgt der gespeicherten Wahl). */
html[data-theme="light"] {
    --bg-dark: #eef1f5;
    --card-bg: #ffffff;
    --field-bg: #f5f7fa;
    --border: #c9ced8;
    --card-border: rgba(0, 0, 0, 0.08);
    --placeholder: rgba(0, 0, 0, 0.35);
    --text-light: #1d2129;
    --text-muted: #5a6270;
    color-scheme: light;
}

html {
    background-color: var(--bg-dark);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background-color: var(--bg-dark);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-light);
}

/* ── Karte ──────────────────────────────────────────────────────────── */
.modal-content {
    width: 100%;
    max-width: 380px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    animation: login-appear 0.35s ease;
}

@keyframes login-appear {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo ───────────────────────────────────────────────────────────── */
.imgcontainer {
    text-align: center;
    margin: 0;
    padding: 32px 32px 8px;
    position: relative;
}

img.avatar {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.08));
}

.container {
    padding: 20px 32px 32px;
}

/* ── Beschriftungen & Felder ───────────────────────────────────────── */
label {
    display: block;
    text-align: left;
    margin: 14px 0 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

input[type='password'],
input[type='text'] {
    width: 100%;
    padding: 12px 14px;
    box-sizing: border-box;
    background-color: var(--field-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.95rem;
    transition: var(--transition);
}

input[type='password']::placeholder,
input[type='text']::placeholder {
    color: var(--placeholder);
}

input[type='password']:focus,
input[type='text']:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* ── Passwort-Sichtbarkeit (Auge im Feld) ──────────────────────────── */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px; /* Platz für das Auge */
}

/* Überschreibt bewusst die globalen button-Styles dieser Seite
   (width 100%, blauer Hintergrund, margin, :active-Verschiebung). */
.toggle-psw,
.toggle-psw:hover,
.toggle-psw:active {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: auto;
    margin: 0;
    padding: 6px;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    box-shadow: none;
    color: var(--text-muted);
}

.toggle-psw:hover {
    color: var(--text-light);
}

.toggle-psw svg {
    width: 20px;
    height: 20px;
    flex: none;          /* Firefox: nicht als Flex-Item strecken */
    display: block;
    pointer-events: none; /* Klick landet immer auf dem Button, nie auf dem Pfad */
}

.toggle-psw .icon-hide { display: none; }
.toggle-psw.visible .icon-show { display: none; }
.toggle-psw.visible .icon-hide { display: block; }

/* ── Feststelltaste-Warnung ────────────────────────────────────────── */
.capslock-warning {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(240, 173, 78, 0.5);
    background-color: rgba(240, 173, 78, 0.12);
    color: #f0ad4e;
    font-size: 0.82rem;
    text-align: left;
}

/* ── Schaltfläche ──────────────────────────────────────────────────── */
button {
    width: 100%;
    margin-top: 22px;
    padding: 13px 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

button:hover {
    background-color: #1a87ff;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.4);
}

button:active {
    transform: translateY(1px);
}

/* ── TOTP-Eingabe ──────────────────────────────────────────────────── */
.totp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 16px 0 4px;
}

.totp-digit {
    width: 44px;
    height: 54px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-light);
    background-color: var(--field-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    caret-color: transparent;
    transition: var(--transition);
}

.totp-digit:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.totp-digit.filled {
    border-color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.10);
}

/* ── Fehlermeldung ─────────────────────────────────────────────────── */
.error-popup {
    text-align: center;
    background: #c0392b;
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 1rem;
    margin: 16px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-popup--visible {
    opacity: 1;
}

/* ── Link unten rechts ─────────────────────────────────────────────── */
.site-link {
    position: fixed;
    right: 18px;
    bottom: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.site-link:hover {
    color: var(--primary-color);
}
