/**
 * ============================================================
 * LOGIN.CSS – Microsoft-Style Anmeldeseite
 * ============================================================
 * Simuliert das visuelle Design des Microsoft-Anmeldeportals.
 * Ausschließlich für interne Schulungszwecke.
 */

/* ── Reset & Basis ──────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --ms-blue:        #0067b8;
    --ms-blue-dark:   #004e8c;
    --ms-blue-light:  #e8f0fe;
    --ms-text:        #1b1b1b;
    --ms-text-light:  #616161;
    --ms-border:      #8a8886;
    --ms-bg:          #f2f2f2;
    --ms-white:       #ffffff;
    --ms-link:        #0067b8;
    --ms-error:       #a80000;
    --ms-red:         #f25022;
    --ms-green:       #7fba00;
    --ms-cyan:        #00a4ef;
    --ms-yellow:      #ffb900;
    --radius:         4px;
    --shadow:         0 2px 6px rgba(0,0,0,.2);
    --font:           'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font);
    background-color: var(--ms-bg);
    color: var(--ms-text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
}

/* ── Seiten-Layout ──────────────────────────────────────────── */
.ms-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────── */
.ms-header {
    padding: 16px 24px;
    background: var(--ms-white);
}

.ms-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.ms-logo-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--ms-text);
    letter-spacing: -.3px;
}

/* ── Hauptinhalt ────────────────────────────────────────────── */
.ms-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    gap: 20px;
}

/* ── Karte ──────────────────────────────────────────────────── */
.ms-card {
    background: var(--ms-white);
    padding: 44px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    animation: fadeIn .25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Schritte ───────────────────────────────────────────────── */
.ms-step {
    animation: fadeIn .2s ease;
}

/* ── Titel & Untertitel ─────────────────────────────────────── */
.ms-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--ms-text);
    margin-bottom: 8px;
}

.ms-subtitle {
    font-size: 14px;
    color: var(--ms-text-light);
    margin-bottom: 24px;
}

/* ── Input ──────────────────────────────────────────────────── */
.ms-input-group {
    position: relative;
    margin-bottom: 16px;
}

.ms-input {
    width: 100%;
    padding: 8px 0;
    font-size: 15px;
    font-family: var(--font);
    color: var(--ms-text);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ms-border);
    outline: none;
    transition: border-color .2s;
}

.ms-input:focus {
    border-bottom: 2px solid var(--ms-blue);
}

.ms-input-label {
    position: absolute;
    top: 8px;
    left: 0;
    font-size: 15px;
    color: var(--ms-text-light);
    pointer-events: none;
    transition: all .2s ease;
}

.ms-input:focus + .ms-input-label,
.ms-input:not(:placeholder-shown) + .ms-input-label {
    top: -16px;
    font-size: 11px;
    color: var(--ms-blue);
}

.ms-input::placeholder {
    color: transparent;
}

/* ── Links ──────────────────────────────────────────────────── */
.ms-link {
    color: var(--ms-link);
    text-decoration: none;
    font-size: 14px;
}

.ms-link:hover {
    text-decoration: underline;
}

.ms-help-text {
    font-size: 13px;
    color: var(--ms-text-light);
    margin-bottom: 8px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.ms-button-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.ms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 15px;
    font-family: var(--font);
    font-weight: 400;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, border-color .15s;
    white-space: nowrap;
}

.ms-btn-primary {
    background: var(--ms-blue);
    color: #fff;
    border-color: var(--ms-blue);
}

.ms-btn-primary:hover {
    background: var(--ms-blue-dark);
    border-color: var(--ms-blue-dark);
}

.ms-btn-secondary {
    background: transparent;
    color: var(--ms-text);
    border-color: var(--ms-border);
    width: 100%;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
}

.ms-btn-secondary:hover {
    background: #f5f5f5;
}

/* ── Zurück-Button ──────────────────────────────────────────── */
.ms-back-row {
    margin-bottom: 16px;
}

.ms-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--ms-link);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    font-family: var(--font);
}

.ms-back-btn:hover {
    text-decoration: underline;
}

/* ── QR-Code ────────────────────────────────────────────────── */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 24px 0 16px;
    gap: 12px;
}

.qr-frame {
    position: relative;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    display: inline-block;
}

#qrcode-display {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    min-height: 200px;
}

#qrcode-display canvas,
#qrcode-display img {
    display: block;
    border-radius: 4px;
}

/* QR-Code Ecken-Dekoration */
.qr-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--ms-blue);
    border-style: solid;
}

.qr-tl { top: -1px;  left: -1px;  border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.qr-tr { top: -1px;  right: -1px; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.qr-bl { bottom: -1px; left: -1px;  border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.qr-br { bottom: -1px; right: -1px; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

.qr-hint {
    font-size: 13px;
    color: var(--ms-text-light);
    text-align: center;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 280px;
    line-height: 1.4;
}

.qr-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--ms-text-light);
}

.qr-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--ms-link);
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font);
}

.qr-refresh-btn:hover {
    text-decoration: underline;
}

.qr-timer {
    font-size: 12px;
    color: #888;
}

.qr-timer.expiring {
    color: var(--ms-error);
    font-weight: 600;
}

/* ── Trennlinie ─────────────────────────────────────────────── */
.ms-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--ms-text-light);
    font-size: 13px;
}

.ms-divider::before,
.ms-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

/* ── Footer ─────────────────────────────────────────────────── */
.ms-footer {
    width: 100%;
    max-width: 440px;
    padding: 8px 0;
}

.ms-footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ms-footer-link {
    font-size: 12px;
    color: var(--ms-text-light);
    text-decoration: none;
}

.ms-footer-link:hover {
    color: var(--ms-link);
    text-decoration: underline;
}

/* ── Modal ──────────────────────────────────────────────────── */
.ms-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.ms-modal.active {
    display: block;
}

.ms-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
}

.ms-modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--ms-white);
    padding: 32px;
    border-radius: var(--radius);
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

.ms-modal-box h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

.ms-modal-box p {
    font-size: 14px;
    color: var(--ms-text-light);
    margin-bottom: 20px;
}

/* ── Loading Spinner ────────────────────────────────────────── */
.ms-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--ms-text-light);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--ms-blue);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .ms-card {
        padding: 32px 24px;
        box-shadow: none;
        border-radius: 0;
        max-width: 100%;
    }

    .ms-main {
        padding: 20px 0;
        justify-content: flex-start;
    }

    .ms-footer {
        padding: 16px;
    }
}

@media (max-width: 360px) {
    .ms-card {
        padding: 24px 16px;
    }

    .ms-title {
        font-size: 20px;
    }
}

/* ── Accessibility ──────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--ms-blue);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

