/* ARIF — スタイルシート（外部 CDN 依存なし） */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #dde2f0;
  --accent: #1a237e;
  --accent-light: #3949ab;
  --accent-dim: #e8eaf6;
  --text: #1a1a2e;
  --muted: #6b7280;
  --success: #1b5e20;
  --warning: #e65100;
  --error: #b71c1c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
}

/* ─── ヘッダー ─────────────────────────────────────────── */
header {
  background: var(--accent);
  color: white;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-brand { display: flex; align-items: baseline; gap: 0.6rem; }
.header-brand a {
  color: white;
  text-decoration: none;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.badge-beta {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  position: relative;
  top: -4px;
}
.header-subtitle {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  letter-spacing: 0.02em;
}

header nav { display: flex; align-items: center; gap: 1.2rem; font-size: 0.85rem; }
header nav span { color: rgba(255,255,255,0.75); }
header nav button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.85);
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: background 0.15s;
}
header nav button:hover { background: rgba(255,255,255,0.1); }

/* ─── ログインページ（Dark Glassmorphism 2026） ─────────── */
body:has(.login-page) {
  background: linear-gradient(135deg, #050818 0%, #0d1440 55%, #1a1b4b 100%);
  min-height: 100vh;
}
body:has(.login-page) header {
  background: rgba(8, 12, 36, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
body:has(.login-page) footer { display: none; }

.login-page {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow:
    0 8px 48px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 2.5rem 3rem 3rem;
  width: 100%;
  max-width: 420px;
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.login-brand-logo {
  font-size: 2.6rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.18em;
  line-height: 1;
  margin-bottom: 1.1rem;
  text-shadow:
    0 0 28px rgba(129, 140, 248, 0.7),
    0 0 60px rgba(129, 140, 248, 0.25);
}

/* A・R・I・F 縦4段アクログラフィー */
.login-brand-acro {
  display: inline-block;
  text-align: left;
}
.login-brand-acro div { line-height: 1.65; }
.acro-letter {
  display: inline-block;
  width: 0.9rem;
  color: #818cf8;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0;
}
.acro-rest {
  color: rgba(255, 255, 255, 0.38);
  font-weight: 300;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.login-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.4rem;
}

.login-card p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 1.5rem;
}

.login-card label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.login-card input[type="email"] {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: white;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  margin-bottom: 1.2rem;
}
.login-card input[type="email"]::placeholder { color: rgba(255, 255, 255, 0.2); }
.login-card input[type="email"]:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(255, 255, 255, 0.1);
}

.login-card button[type="submit"] {
  width: 100%;
  background: linear-gradient(135deg, #3730a3 0%, #6366f1 100%);
  color: white;
  border: none;
  padding: 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.5);
}
.login-card button[type="submit"]:hover {
  opacity: 0.9;
  box-shadow: 0 6px 28px rgba(79, 70, 229, 0.65);
}
.login-card button[type="submit"]:active { transform: scale(0.98); }
.login-card button[type="submit"]:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

#login-message {
  margin-top: 1rem;
  font-size: 0.85rem;
  text-align: center;
}

/* ─── メインコンテンツ ─────────────────────────────────── */
main { max-width: 960px; margin: 2rem auto; padding: 0 1.5rem; }

footer {
  text-align: center;
  padding: 2.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

/* ─── フォーム（入力画面） ──────────────────────────────── */
.input-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2.5rem; margin-bottom: 2rem; box-shadow: 0 2px 12px rgba(26,35,126,0.06); }
.input-box h2 { color: var(--accent); margin-bottom: 1.5rem; font-size: 1.3rem; }
.field { margin-bottom: 1.3rem; }
label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.88rem; }
input[type="text"], input[type="email"], textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fafbff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(57,73,171,0.1);
  background: white;
}
textarea { resize: vertical; }
.mode-select { display: flex; gap: 1.5rem; }
.mode-select label { font-weight: normal; display: flex; align-items: center; gap: 0.4rem; }

button[type="submit"] {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.8rem 2.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.15s;
}
button[type="submit"]:hover { background: var(--accent-light); }

.htmx-indicator { display: none; margin-left: 1rem; color: var(--muted); }
.htmx-request .htmx-indicator { display: inline; }

/* ─── 熟議画面 ──────────────────────────────────────────── */
.deliberation h2 { color: var(--accent); margin-bottom: 0.5rem; }
.question-text { font-size: 1.05rem; font-style: italic; color: var(--muted); margin-bottom: 0.5rem; }
.mode-badge { display: inline-block; background: var(--accent); color: white; font-size: 0.72rem; padding: 0.2rem 0.6rem; border-radius: 4px; margin-bottom: 1.5rem; letter-spacing: 0.05em; }

.status-bar { padding: 0.75rem 1rem; background: var(--accent-dim); border-radius: 6px; margin-bottom: 1.5rem; font-size: 0.88rem; color: var(--accent); }

.deliberation h3 { color: var(--accent); border-bottom: 2px solid var(--border); padding-bottom: 0.4rem; margin: 1.5rem 0 1rem; }

.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.agent-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.2rem; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.agent-card h4 { color: var(--accent); font-size: 0.88rem; margin-bottom: 0.5rem; font-weight: 700; }
.agent-content { font-size: 0.88rem; line-height: 1.65; white-space: pre-wrap; }
.agent-content.waiting { color: var(--muted); font-style: italic; }

.round-summary { background: #fffde7; border-left: 3px solid var(--warning); padding: 1rem 1.2rem; border-radius: 0 8px 8px 0; margin-bottom: 1.5rem; font-size: 0.88rem; }

/* 第三の解 */
#synthesis-area { background: var(--surface); border: 2px solid var(--accent); border-radius: 10px; padding: 1.8rem; margin: 1.5rem 0; box-shadow: 0 4px 16px rgba(26,35,126,0.1); }
#synthesis-area h3 { color: var(--accent); }
#premortem-area { background: #fff8f0; border-left: 3px solid var(--warning); padding: 1rem 1.2rem; margin-bottom: 1rem; border-radius: 0 8px 8px 0; }
#complete-banner { background: #f1f8e9; border: 1px solid #a5d6a7; color: var(--success); padding: 1rem 1.2rem; border-radius: 8px; font-weight: 600; }

/* セッション一覧 */
.session-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.8rem; }
.session-list h3 { color: var(--accent); margin-bottom: 1rem; }

/* 免責文言 */
.disclaimer { color: var(--muted); font-size: 0.78rem; border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 0.75rem; }
