@font-face {
    font-family: "JetBrains Mono";
    src: url("https://css.sbdm.lol/static/JetBrainsMono-VariableFont_wght.ttf")
        format("truetype-variations");
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f5f6f8;
    --card: #ffffff;
    --text: #101828;
    --muted: #667085;
    --accent: #2952e3;
    --accent-hover: #1f3fb8;
    --border: #e4e7ec;
    --danger-bg: #fef3f2;
    --danger-text: #b42318;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.06);
}

[data-theme="dark"] {
    --bg: #0b0f17;
    --card: #131a26;
    --text: #f2f4f7;
    --muted: #94a3b8;
    --accent: #5b8def;
    --accent-hover: #7ba3f2;
    --border: #232b3a;
    --danger-bg: #2a1618;
    --danger-text: #f97066;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: "JetBrains Mono", monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.topbar {
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem clamp(1rem, 4vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
}

.theme-toggle svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 5vw, 3rem);
    min-height: calc(100vh - 4rem);
}

.card {
    width: 100%;
    max-width: 26rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    padding: clamp(1.5rem, 5vw, 2.5rem);
}

/* Login */

.title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 600;
}

.subtitle {
    margin: 0 0 1.75rem;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--danger-bg);
    color: var(--danger-text);
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

.debug {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: left;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    min-height: 2.75rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    margin-top: 1.75rem;
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
}

.btn-secondary:hover {
    color: var(--text);
    border-color: var(--muted);
}

/* Profile */

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.avatar {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--bg);
    margin-bottom: 1.25rem;
}

.greeting {
    margin: 0 0 1.5rem;
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    font-weight: 600;
    line-height: 1.4;
}

.profile-list {
    width: 100%;
    margin: 0;
    border-top: 1px solid var(--border);
}

.profile-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.profile-row dt {
    color: var(--muted);
    font-size: 0.8rem;
}

.profile-row dd {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

/* Kleine Bildschirme */
@media (max-width: 420px) {
    .profile-row {
        flex-direction: column;
        gap: 0.2rem;
        text-align: left;
    }
    .profile-row dd {
        text-align: left;
    }
}

/* Touch-Ziele */
@media (pointer: coarse) {
    .btn, .theme-toggle {
        min-height: 2.9rem;
    }
}
