/* 汎用アンケートシステム 共通スタイル */

:root {
  --ink: #1b1f2b;
  --ink-soft: #565f72;
  --paper: #f6f7fa;
  --surface: #ffffff;
  --line: #dee2ea;
  --accent: #3450c7;
  --accent-ink: #24379a;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 1px 2px rgba(27, 31, 43, 0.04), 0 8px 24px -12px rgba(27, 31, 43, 0.12);
}

.card h1 {
  font-size: 20px;
  margin: 0 0 6px;
}

.card .lede {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0 0 24px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  display: block;
  width: 100%;
  padding: 13px 16px;
  font-size: 15.5px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-ink);
}

.btn:active {
  transform: translateY(1px);
}

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 18px;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f2c6c2;
}

.hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 8px;
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 18px;
}

.placeholder-box {
  text-align: center;
}

.placeholder-box .icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.link-out {
  color: var(--accent);
  text-decoration: none;
}

.link-out:hover {
  text-decoration: underline;
}

/* ============================================================
   管理画面 共通レイアウト (Phase 2: アンケート/ページ/設問管理)
   ============================================================ */

.alert-success {
  background: #e8f5ec;
  color: #1e7a3c;
  border: 1px solid #bfe3c9;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.app-header .brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
}

.app-header .who {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

.app-header .who a {
  color: var(--ink-soft);
  text-decoration: none;
}

.app-header .who a:hover {
  color: var(--accent);
}

.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.breadcrumb {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.page-head h1 {
  font-size: 21px;
  margin: 0 0 4px;
}

.page-head .sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 16px;
  margin: 0 0 16px;
}

.btn-inline {
  display: inline-block;
  width: auto;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.btn-inline:hover {
  background: var(--accent-ink);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: var(--paper);
}

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid #f2c6c2;
}

.btn-danger:hover {
  background: var(--danger-bg);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 6px;
}

.btn-disabled,
.btn-inline[aria-disabled="true"] {
  background: var(--line);
  color: var(--ink-soft);
  cursor: not-allowed;
  pointer-events: none;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
}

.badge-draft {
  background: #eceef3;
  color: #565f72;
}

.badge-published {
  background: #e3f3e8;
  color: #1e7a3c;
}

.badge-closed {
  background: #f3e6e6;
  color: #9a3b34;
}

.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: #9a6b1f;
  background: #fdf3e0;
  border: 1px solid #f0dcae;
  padding: 3px 9px;
  border-radius: 999px;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 560px;
}

table.admin-table th,
table.admin-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.admin-table th {
  background: var(--paper);
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 700;
}

table.admin-table tr:last-child td {
  border-bottom: none;
}

table.admin-table .row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

table.admin-table .num {
  text-align: right;
  color: var(--ink-soft);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 90px;
}

.field input[type="number"],
.field input[type="date"],
.field input[type="datetime-local"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.field input[type="color"] {
  width: 64px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  vertical-align: middle;
  margin-right: 10px;
}

.field-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.field-row > .field {
  flex: 1 1 200px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink);
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.option-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.option-row .del {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--danger);
  white-space: nowrap;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.form-actions .btn-inline {
  min-width: 140px;
  text-align: center;
}

.type-guide {
  font-size: 12px;
  color: var(--ink-faint, var(--ink-soft));
  margin-top: -10px;
  margin-bottom: 18px;
}

.current-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.current-logo img {
  max-width: 120px;
  max-height: 60px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 4px;
}

@media (max-width: 640px) {
  .app-main {
    padding: 18px 14px 48px;
  }

  .panel {
    padding: 18px 16px;
  }

  .page-head {
    flex-direction: column;
  }

  table.admin-table .row-actions {
    justify-content: flex-start;
  }
}
