/* =====================================================
   info - Auth + Admin spezifische Styles
   nutzt Tokens aus styles.css
   ===================================================== */

/* ---------- Auth Shell ---------- */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface-2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 40px 36px 32px;
    animation: card-in .4s var(--ease);
}

.auth-card-wide { max-width: 640px; }

@keyframes card-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}
.auth-brand img {
    height: 44px;
    width: auto;
}

.auth-title {
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -.02em;
    text-align: center;
}
.auth-title .serif {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-style: italic;
}

.auth-sub {
    text-align: center;
    color: var(--ink-mute);
    margin: 0 0 24px;
    font-size: 15px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 18px;
}

.auth-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-label span {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}
.auth-label input,
.auth-input,
.form-input {
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--ink);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.auth-label input:focus,
.auth-input:focus,
.form-input:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .15);
}

.auth-code-input {
    font-family: 'Inter', monospace;
    font-size: 22px !important;
    letter-spacing: .35em;
    text-align: center;
    font-weight: 600;
}

.auth-btn {
    background: var(--grad-primary);
    color: white;
    padding: 13px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    transition: transform .15s var(--ease), box-shadow .2s var(--ease), opacity .2s;
}
.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(6, 95, 70, .5);
}
.auth-btn:active { transform: translateY(0); }
.auth-btn-inline {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    margin-top: 16px;
}
.auth-btn-ghost {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border-2);
}
.auth-btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.auth-hint {
    color: var(--ink-mute);
    font-size: 13px;
    text-align: center;
    margin: 6px 0 0;
}
.auth-hint a { color: var(--green-700); font-weight: 500; }

.auth-fehler {
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .3);
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}
[data-theme="dark"] .auth-fehler { color: #fca5a5; }

/* ---------- TOTP Setup ---------- */
.totp-steps {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 20px;
}
.totp-step {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}
.totp-step-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
}
.totp-step h3 {
    margin: 6px 0 6px;
    font-size: 17px;
    font-weight: 700;
}
.totp-step p {
    margin: 0 0 12px;
    color: var(--ink-mute);
    font-size: 14px;
}
.totp-qr-wrap { flex: 1; }
.totp-qr {
    background: white;
    padding: 12px;
    border-radius: var(--radius-sm);
    display: inline-block;
    box-shadow: var(--shadow-card);
    margin: 8px 0 12px;
}
.totp-qr img { display: block; }
.totp-manual {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--ink-soft);
}
.totp-manual summary { cursor: pointer; font-weight: 600; }
.totp-manual code {
    display: block;
    margin-top: 8px;
    font-family: monospace;
    font-size: 14px;
    letter-spacing: .08em;
    word-break: break-all;
    color: var(--ink);
}

/* ---------- Flash Messages ---------- */
.flash-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 480px;
}
.flash {
    background: var(--surface-2);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    box-shadow: var(--shadow-card);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: flash-in .25s var(--ease);
    font-size: 14px;
}
@keyframes flash-in {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}
.flash-ok { border-left: 4px solid var(--green-500); }
.flash-fehler { border-left: 4px solid #ef4444; }
.flash-passwort {
    border-left: 4px solid #f59e0b;
    font-family: monospace;
    font-size: 13px;
}
.flash-close {
    margin-left: auto;
    font-size: 20px;
    line-height: 1;
    opacity: .5;
}
.flash-close:hover { opacity: 1; }

/* ---------- Admin Shell ---------- */
.admin-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 24px 80px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.admin-topbar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.admin-topbar .brand img { height: 32px; }
.admin-topbar h1 {
    font-size: 18px;
    margin: 0;
    font-weight: 700;
}
.admin-topbar h1 .serif {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-style: italic;
}
.admin-topbar .spacer { flex: 1; }
.admin-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 999px;
    font-size: 14px;
}
.admin-user-chip strong { color: var(--ink); }

.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-2);
    padding-bottom: 0;
}
.admin-tab {
    padding: 10px 18px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
    border-bottom: none;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.admin-tab:hover {
    background: var(--surface);
    color: var(--ink);
}
.admin-tab.active {
    background: var(--surface-2);
    color: var(--green-700);
    border-color: var(--border-2);
    position: relative;
    top: 1px;
}
[data-theme="dark"] .admin-tab.active { color: var(--green-300); }

.admin-panel {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-card);
}

.admin-section-titel {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 18px;
    letter-spacing: -.01em;
}

/* ---------- Tabellen ---------- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table thead th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-2);
    font-weight: 600;
    color: var(--ink-soft);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.admin-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}
.admin-table tbody tr:hover { background: var(--surface); }
.admin-table tbody tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.badge-admin {
    background: rgba(16, 185, 129, .15);
    color: var(--green-700);
}
.badge-aktiv {
    background: rgba(16, 185, 129, .15);
    color: var(--green-700);
}
.badge-inaktiv {
    background: rgba(148, 163, 184, .2);
    color: #475569;
}
.badge-gesperrt {
    background: rgba(239, 68, 68, .15);
    color: #b91c1c;
}
.badge-2fa-ok {
    background: rgba(59, 130, 246, .15);
    color: #1d4ed8;
}
.badge-2fa-fehlt {
    background: rgba(245, 158, 11, .15);
    color: #b45309;
}
[data-theme="dark"] .badge-admin,
[data-theme="dark"] .badge-aktiv { color: var(--green-300); }
[data-theme="dark"] .badge-2fa-ok { color: #93c5fd; }
[data-theme="dark"] .badge-2fa-fehlt { color: #fcd34d; }
[data-theme="dark"] .badge-gesperrt { color: #fca5a5; }
[data-theme="dark"] .badge-inaktiv { color: #94a3b8; }

/* ---------- Forms ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}
.form-input {
    width: 100%;
}
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s var(--ease);
}
.form-check:hover { background: var(--surface-2); }
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--green-600);
}
.form-check-label {
    font-size: 14px;
    font-weight: 500;
}
.form-check-meta {
    margin-left: auto;
    font-size: 12px;
    color: var(--ink-mute);
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.btn {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform .12s var(--ease), background .15s var(--ease);
}
.btn:hover { transform: translateY(-1px); background: var(--surface-2); }
.btn-primary {
    background: var(--grad-primary);
    color: white;
    border-color: transparent;
}
.btn-primary:hover { background: var(--grad-primary); }
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
    border-color: transparent;
}
.btn-warn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-color: transparent;
}

/* ---------- App-Zugriffe Grid ---------- */
.access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}

/* ---------- Detail-Sektionen ---------- */
.detail-section {
    padding: 22px 0;
    border-top: 1px solid var(--border);
}
.detail-section:first-of-type {
    border-top: none;
    padding-top: 0;
}
.detail-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.detail-section .desc {
    font-size: 13px;
    color: var(--ink-mute);
    margin: -6px 0 14px;
}

.session-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 13px;
}
.session-row .meta { color: var(--ink-mute); font-size: 12px; }

.platzhalter {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-mute);
}
.platzhalter h2 {
    font-size: 22px;
    margin: 0 0 8px;
    color: var(--ink);
}
.platzhalter .serif {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
}

/* ---------- Dashboard-Anpassungen ---------- */
.user-strip {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-strip .user-name {
    font-size: 14px;
    color: var(--ink-soft);
    font-weight: 500;
}
.user-strip .icon-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--ink-soft);
    background: transparent;
    transition: background .15s var(--ease);
}
.user-strip .icon-btn:hover {
    background: var(--surface);
    color: var(--ink);
}
