* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg: #0f1117; --bg-card: #1a1d27; --border: #2a2e3a;
    --text: #e4e6eb; --muted: #b9bec9; --primary: #4f8cff; --primary-hover: #3d7aee;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
    /* Dungeon atmosphere (matches the LP): tiled brick wall + vignette, fixed. */
    background-color: #140d07;
    background-image:
        radial-gradient(ellipse 95% 60% at 50% 22%, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0.82) 100%),
        url(/img/crawly/brick.png?v=2);
    background-repeat: no-repeat, repeat;
    background-size: cover, 240px auto;
    background-attachment: fixed, fixed;
    color: var(--text); line-height: 1.7; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
.container { max-width: 920px; margin: 0 auto; padding: 0 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Nav */
.nav { border-bottom: 1px solid var(--border); background: rgba(15,17,23,0.85); backdrop-filter: blur(8px); }
.nav .container { max-width: 1120px; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--text); }
.brand-icon { border-radius: 50%; vertical-align: middle; }
.brand-name { display: inline-flex; flex-direction: column; line-height: 1.05; }
.brand-name small { font-weight: 500; font-size: 0.62rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 1.1rem; font-size: 0.9rem; flex-wrap: nowrap; white-space: nowrap; }
.nav-links a:not(.btn) { color: var(--text); }
.nav-links a:not(.btn):hover { color: var(--primary); }
@media (max-width: 820px) { .nav-links a:not(.btn) { display: none; } }

/* Buttons */
.btn { display: inline-block; border-radius: 8px; font-weight: 600; cursor: pointer; border: 1px solid transparent; padding: 0.55rem 1.1rem; font-size: 0.95rem; transition: all 0.15s; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.88rem; }
.btn-lg { padding: 0.8rem 1.4rem; font-size: 1rem; width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #2a2e3a; color: var(--text); }
.btn-secondary:hover { background: #353a48; }

/* Auth cards */
.auth-wrap { padding: 3.5rem 1.5rem; display: flex; justify-content: center; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.auth-card h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }

.form { display: flex; flex-direction: column; gap: 1rem; margin: 1.4rem 0 1rem; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.form input { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem; color: var(--text); font-size: 1rem; }
.form input:focus { outline: none; border-color: var(--primary); }

.alert { border-radius: 8px; padding: 0.6rem 0.9rem; font-size: 0.9rem; margin-bottom: 0.5rem; }
.alert.err { background: rgba(248,113,113,0.12); border: 1px solid #f87171; color: #fca5a5; }

.key-box { display: flex; align-items: center; gap: 0.6rem; background: var(--bg); border: 1px solid var(--primary); border-radius: 10px; padding: 0.9rem 1rem; margin: 1rem 0 0.4rem; flex-wrap: wrap; }
.key-box code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.2rem; letter-spacing: 0.06em; color: var(--primary); flex: 1; }
.steps { margin: 0.5rem 0 0 1.2rem; color: #c8ccd8; }
.steps li { margin: 0.4rem 0; }
.steps strong { color: var(--text); }

.alert.ok { background: rgba(52,211,153,0.12); border: 1px solid #34d399; color: #6ee7b7; }
.alert.warn { background: rgba(251,191,36,0.10); border: 1px solid rgba(251,191,36,0.5); color: #fbbf24; }

/* contact form textarea */
.form textarea { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem; color: var(--text); font-size: 1rem; font-family: inherit; resize: vertical; }
.form textarea:focus { outline: none; border-color: var(--primary); }

/* license pills (dashboard) */
.pill { display:inline-block; padding:0.12rem 0.55rem; border-radius:999px; font-size:0.72rem; font-weight:600; background:var(--border); color:var(--muted); margin-left:0.4rem; }
.pill.ok { background:#16331f; color:#5ed18a; }
.key-box { display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap; margin:0.4rem 0; }
