/* Demonsnet Apps theme: colors from bbs.demonsnet.com and ai.demonsnet.com.
   Every page (portal, login, admin, account) uses this file. */

:root {
  --bg: #000000;
  --band: #0a0909;         /* section bands */
  --line: #1e1c1d;         /* dividers */
  --surface: #141113;      /* cards */
  --surface-hover: #1b1719;
  --input: #1b1a1c;
  --input-line: #2e2b2f;
  --card-line: #4a1d1c;    /* red-tinted border */
  --fg: #f4f4f5;
  --fg-2: #c4c4c8;         /* secondary text, still easy to read */
  --muted: #8e8e94;
  --red: #ec635e;          /* logo */
  --red-text: #eb5149;
  --btn: #ca3a31;          /* primary button */
  --btn-hover: #d9443a;
  --green: #7dfb5a;        /* small accents */
  --green-dim: #4d9c38;
  --danger: #eb5149;
  --glow: radial-gradient(ellipse 70% 420px at 50% 0%, #2b0f0e 0%, #140807 45%, transparent 100%);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: dark;
}

/* ---- base ---- */
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--glow), var(--bg); background-repeat: no-repeat; color: var(--fg); font: 400 15px/1.55 var(--sans); }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
::selection { background: var(--red); color: #000; }

/* ---- top bar ---- */
.topbar-wrap { border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .35); backdrop-filter: blur(8px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--fg); font-weight: 600; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand img { height: 28px; width: 28px; display: block; border-radius: 7px; }
.brand span { padding-left: 12px; border-left: 1px solid var(--input-line); color: var(--fg-2); font-weight: 500; }
.topbar nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; font-size: 14px; }
.topbar nav a { color: var(--fg-2); padding: 6px 12px; border-radius: 8px; }
.topbar nav a:hover { color: var(--fg); background: var(--surface); text-decoration: none; }
.who { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); padding: 6px 12px 6px 8px; margin-right: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-weight: 500; }
.who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green-dim); }

main { max-width: 1180px; margin: 0 auto; padding: 40px 20px 72px; }

/* ---- hero ---- */
.hero { text-align: center; padding: 48px 20px 8px; }
.hero img { width: min(700px, 100%); height: auto; }
.hero h1 { margin: 26px 0 6px; font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.hero p { margin: 0; color: var(--fg-2); font-size: 16px; }

/* ---- app groups ---- */
.group { margin-top: 40px; }
.group h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.group h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.apps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.apps a {
  display: flex; align-items: center; gap: 16px; height: 100%; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: inherit;
  transition: border-color .15s, background .15s, transform .15s;
}
.apps a:hover { text-decoration: none; background: var(--surface-hover); border-color: var(--card-line); transform: translateY(-2px); }
.apps a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.apps img { width: 52px; height: 52px; flex: none; border-radius: 12px; }
.apps b { display: block; font-size: 16px; font-weight: 600; color: var(--fg); }
.apps span { display: block; margin-top: 2px; font-size: 14px; color: var(--fg-2); }
.apps small { display: inline-block; margin-top: 6px; padding: 1px 8px; font-size: 11px; color: var(--red); border: 1px solid var(--card-line); border-radius: 999px; }
.note { margin-top: 48px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---- page headings (admin, account) ---- */
h1 { margin: 0 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
h2 { margin: 40px 0 14px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
main > p { margin: 0 0 28px; color: var(--fg-2); }

/* ---- login (ai.demonsnet.com) ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(440px, 100%); padding: 40px 36px 36px; border-radius: 22px; }
.login .logo { display: block; width: 100%; height: auto; margin: 0 auto 10px; }
.login h1 { text-align: center; font-size: 22px; font-weight: 500; margin: 18px 0 8px; }
.login label { font-size: 15px; }
.login input[type=text], .login input[type=password] { border-radius: 12px; padding: 13px 16px; font-size: 16px; }
.pw { display: flex; align-items: center; gap: 10px; }
.pw input { flex: 1; }
.pw button { background: none; border: 0; padding: 4px; color: var(--fg); cursor: pointer; width: auto; margin: 0; line-height: 0; }
.pw button:hover { color: var(--red); background: none; }

/* ---- forms ---- */
.card { background: var(--surface); border: 1px solid var(--card-line); border-radius: 16px; padding: 28px; }
label { display: block; font-size: 14px; font-weight: 500; margin: 16px 0 6px; }
input[type=text], input[type=password] {
  width: 100%; padding: 10px 14px; border: 1px solid var(--input-line); border-radius: 10px;
  background: var(--input); color: var(--fg); font: 400 15px var(--sans);
}
input::placeholder { color: #6e6b70; }
input:focus { outline: none; border-color: var(--red); }
input[type=checkbox] { accent-color: var(--btn); width: 16px; height: 16px; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; }

button {
  display: inline-block; padding: 11px 22px; border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  background: var(--btn); color: #fff; font: 600 15px var(--sans);
}
button:hover { background: var(--btn-hover); }
.card > form > button, .login button[type=submit] { margin-top: 26px; width: 100%; padding: 13px; font-size: 16px; }
button.ghost { background: transparent; color: var(--fg); border-color: var(--input-line); }
button.ghost:hover { border-color: var(--fg-2); background: var(--surface-hover); }
button.danger { background: transparent; color: var(--danger); border-color: var(--card-line); }
button.danger:hover { border-color: var(--danger); background: rgba(235, 81, 73, .08); }
button.small { padding: 6px 14px; font-size: 13px; }

.msg { padding: 10px 14px; margin: 0 0 18px; font-size: 14px; border: 1px solid currentColor; border-radius: 10px; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red-text); }

/* ---- user table ---- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
td form { display: inline-flex; gap: 6px; align-items: center; margin: 3px 6px 3px 0; }
td input[type=password] { width: 170px; padding: 6px 12px; font-size: 14px; border-radius: 999px; }
.badge { display: inline-block; padding: 2px 10px; font-size: 12px; font-weight: 600; color: var(--red); border: 1px solid var(--card-line); border-radius: 999px; }
.add { display: grid; gap: 14px; grid-template-columns: 1fr 1fr auto auto; align-items: end; }
.add label { margin: 0 0 6px; }
.add .check { margin: 0 0 12px; }
.add button { margin: 0; }

@media (max-width: 700px) {
  .add { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .hero { padding-top: 32px; }
  .hero h1 { font-size: 24px; }
}

/* ---- language controls ---- */
select {
  padding: 9px 36px 9px 14px; border: 1px solid var(--input-line); border-radius: 10px;
  background: var(--input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23c4c4c8' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--fg); font: 400 15px var(--sans); appearance: none; cursor: pointer;
}
select:focus { outline: none; border-color: var(--red); }
td select { padding: 5px 30px 5px 12px; font-size: 14px; border-radius: 999px; background-position: right 10px center; }
.add select { width: 100%; }
.add { grid-template-columns: 1fr 1fr auto auto auto; }
.narrow { max-width: 440px; }
.inline { display: flex; gap: 10px; align-items: center; }
.inline select { flex: 1; }
.lang-switch { margin: 22px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.lang-switch b { color: var(--fg); font-weight: 600; }
html:lang(ja) { --sans: "Inter", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif; }
@media (max-width: 700px) { .add { grid-template-columns: 1fr; } }
