:root {
    --bg: #f3efe6;
    --ink: #111111;
    --paper: #fffaf2;
    --edge: #1b1b1b;
    --accent: #e9562a;
    --accent-2: #0f766e;
    --soft: #d9d0bf;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Space Grotesk", system-ui, sans-serif;
    color: var(--ink);
    background: radial-gradient(1000px 700px at 120% -10%, #ffd9ae 0%, transparent 60%), radial-gradient(700px 500px at -20% 110%, #b6f3e7 0%, transparent 65%), var(--bg);
}

.bg-shape {
    position: fixed;
    z-index: 0;
    filter: blur(40px);
    opacity: 0.35;
    pointer-events: none;
}

.bg-shape-a {
    width: 260px;
    height: 260px;
    border-radius: 48px;
    background: #ff9d66;
    top: 8%;
    right: 10%;
    transform: rotate(24deg);
}

.bg-shape-b {
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: #5bd2c1;
    bottom: 10%;
    left: 8%;
}

.shell {
    position: relative;
    z-index: 1;
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 18px 40px;
}

.hero {
    margin-bottom: 18px;
    animation: rise 500ms ease-out;
}

.eyebrow {
    margin: 0;
    font: 500 12px/1.2 "IBM Plex Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5b5040;
}

h1 {
    margin: 8px 0 6px;
    font-size: clamp(2rem, 6vw, 3rem);
    line-height: 1.05;
}

.hero-copy {
    margin: 0;
    max-width: 740px;
    color: #4b433a;
}

.grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.panel {
    border: 2px solid var(--edge);
    border-radius: 16px;
    padding: 14px;
    background: color-mix(in oklab, var(--paper) 85%, white 15%);
    box-shadow: 6px 6px 0 rgba(17, 17, 17, 0.08);
    animation: rise 420ms ease-out;
}

.panel h2 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

label {
    display: block;
    margin: 10px 0 4px;
    font: 500 12px/1 "IBM Plex Mono", monospace;
    color: #433a2f;
}

input {
    width: 100%;
    border: 2px solid #30271d;
    border-radius: 10px;
    padding: 10px 11px;
    font: 500 14px/1.2 "Space Grotesk", sans-serif;
    background: #fff;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.btn {
    appearance: none;
    border: 2px solid var(--edge);
    background: #fff;
    color: var(--ink);
    border-radius: 999px;
    padding: 8px 12px;
    font: 500 13px/1 "IBM Plex Mono", monospace;
    cursor: pointer;
    transition: transform 140ms ease, background-color 140ms ease;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.icon-btn svg {
    display: block;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    background: var(--accent);
    color: #fff;
    border-color: #8c3319;
}

.btn.ghost {
    background: transparent;
}

.btn.danger {
    background: #fff1ef;
    color: #8c1d18;
    border-color: #b44b42;
}

.stats {
    display: grid;
    gap: 8px;
}

.stat {
    border: 1px solid var(--soft);
    border-radius: 10px;
    padding: 10px;
    background: #fffcf6;
}

.stat span {
    display: block;
    font: 500 11px/1 "IBM Plex Mono", monospace;
    text-transform: uppercase;
    color: #655a4b;
}

.stat strong {
    display: block;
    margin-top: 4px;
    font-size: 0.95rem;
}

.help {
    margin: 10px 0 0;
    font-size: 12px;
    color: #5f5447;
}

.divider {
    margin: 14px 0;
    border: 0;
    border-top: 1px solid #d9d0bf;
}

.hidden {
    display: none !important;
}

.mfa-qr {
    margin-top: 12px;
    border: 1px dashed #6d5f4c;
    border-radius: 12px;
    padding: 10px;
    background: #fffef9;
}

.mfa-qr-code {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid #ddd2c0;
    border-radius: 8px;
    overflow: hidden;
}

.mfa-qr-code img,
.mfa-qr-code canvas {
    display: block;
}

.mfa-qr-status {
    margin: 10px 0 6px;
    font-size: 12px;
    text-align: center;
    color: #3f362b;
}

.mfa-otp-link {
    display: block;
    text-align: center;
    font: 500 12px/1.2 "IBM Plex Mono", monospace;
    color: #0f766e;
    text-decoration: none;
}

.mfa-otp-link:hover {
    text-decoration: underline;
}

.log-panel {
    margin-top: 14px;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

pre {
    margin: 0;
    min-height: 160px;
    max-height: 360px;
    overflow: auto;
    border: 2px solid #1a1a1a;
    border-radius: 12px;
    padding: 12px;
    background: #121214;
    color: #dbf8ef;
    font: 400 12px/1.45 "IBM Plex Mono", monospace;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .shell {
        padding: 16px 12px 28px;
    }
}