/* ============================================================
   バナーメーカー — ベーススタイル（フレームワーク不使用・Node不要）
   ============================================================ */

:root {
  --brand: #5b4be8;
  --brand-ink: #4536c4;
  --brand-weak: #eeecfd;
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #1b1b24;
  --muted: #616175;
  --border: #e6e6ef;
  --ring: rgba(91, 75, 232, 0.28);
  --good: #1f9d55;
  --good-weak: #e6f6ec;
  --warn: #b7791f;
  --warn-weak: #fbf3e2;
  --danger: #d64545;
  --danger-weak: #fcecec;
  --shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 8px 24px rgba(20, 20, 40, 0.06);
  --radius: 14px;
  --radius-sm: 9px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #9a8cff;
    --brand-ink: #b3a7ff;
    --brand-weak: #221f3a;
    --bg: #121218;
    --surface: #1b1b24;
    --text: #ececf3;
    --muted: #a2a2b4;
    --border: #2c2c3a;
    --ring: rgba(154, 140, 255, 0.30);
    --good: #4cc38a;
    --good-weak: #17301f;
    --warn: #e0a44a;
    --warn-weak: #33280f;
    --danger: #f06d6d;
    --danger-weak: #3a1c1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.7;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; text-wrap: balance; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: .01em;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #8b7bff);
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 900;
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--brand-weak); text-decoration: none; }

.main { padding: 32px 0 72px; }

/* ---------- Auth (guest) ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px 28px;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-brand .mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #8b7bff);
  display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 900;
}
.auth-title { font-size: 20px; font-weight: 800; text-align: center; margin: 0 0 4px; }
.auth-sub { color: var(--muted); font-size: 13.5px; text-align: center; margin: 0 0 22px; }
.auth-foot { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--muted); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.input {
  width: 100%; padding: 11px 13px; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); opacity: .7; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

textarea.input { min-height: 60px; resize: vertical; line-height: 1.6; }
input[type="file"].input { padding: 8px 10px; font-size: 13.5px; cursor: pointer; }
input[type="file"].input::file-selector-button {
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--brand-weak); color: var(--brand-ink);
  border-radius: 7px; padding: 5px 10px; margin-right: 10px;
}
input[type="number"].input { -moz-appearance: textfield; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--muted); }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }

.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; font-size: 15px; font-weight: 700; font-family: inherit;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--brand-weak); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 13px; font-size: 13.5px; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); padding: 12px 15px; font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.alert-success { background: var(--good-weak); color: var(--good); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.alert-error { background: var(--danger-weak); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-info { background: var(--brand-weak); color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.stack > * + * { margin-top: 14px; }
.divider { height: 1px; background: var(--border); border: 0; margin: 22px 0; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
