/* 情報漏洩対策ツール クラウド版 送る人の画面(資料ガードの管理画面のスタイルを引き継ぎ) */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1d2330;
  --muted: #5d6576;
  --line: #d9dde5;
  --accent: #1f5fbf;
  --accent-hover: #184c99;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --ok: #1a7f37;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --card: #1d2128;
    --text: #e8eaee;
    --muted: #9aa2b1;
    --line: #333944;
    --accent: #5b9cff;
    --accent-hover: #7cb0ff;
    --danger: #ff8a80;
    --danger-bg: #3a1d1b;
    --warn: #ffd27a;
    --warn-bg: #3a2f14;
    --ok: #6fdc8c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

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

.card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
}

.brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 4px;
}

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

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px; /* スマホで勝手に拡大されない大きさ */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.code-input {
  font-size: 22px !important;
  letter-spacing: 0.2em;
  text-align: center;
}

button {
  width: 100%;
  margin-top: 20px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.6; cursor: default; }

button.secondary {
  width: auto;
  margin: 0;
  padding: 7px 14px;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}

button.secondary:hover { background: var(--bg); }

.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}

.error {
  margin: 16px 0 0;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 8px;
}

.notice {
  padding: 10px 12px;
  font-size: 14px;
  color: var(--warn);
  background: var(--warn-bg);
  border-radius: 8px;
}

.link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  width: auto;
  cursor: pointer;
  text-decoration: underline;
}

.link:hover { background: none; color: var(--accent-hover); }

[hidden] { display: none !important; }

/* ---- ログイン後の画面 ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.topbar .brand { margin: 0; }

.topbar .who {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.main {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 16px;
}

.main h1 { margin-bottom: 12px; }

.panel {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.panel p { margin: 0; color: var(--muted); }

/* ---- 手順6:一覧と新規作成 ---- */
.brand-link { color: inherit; text-decoration: none; }

.secondary-link {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
}
.secondary-link:hover { text-decoration: underline; }

.heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.heading-row h1 { margin: 0; }

.button-link {
  display: inline-block;
  padding: 9px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  text-decoration: none;
}
.button-link:hover { background: var(--accent-hover); }

h2 { font-size: 17px; margin: 0 0 8px; }

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

table.docs {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}
table.docs th,
table.docs td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
table.docs th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.docs tr:last-child td { border-bottom: none; }

.st-active { color: var(--ok); font-weight: 600; }
.st-muted { color: var(--muted); }
.st-danger { color: var(--danger); font-weight: 600; }

/* 入力フォーム */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
}
.form-grid .wide { grid-column: 1 / -1; }
.form-grid label { margin-top: 8px; }
.form-grid button[type="submit"] { width: auto; padding-left: 28px; padding-right: 28px; }
.half-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

select,
input[type="file"] {
  width: 100%;
  padding: 9px 10px;
  font-size: 16px; /* 16px未満だと、iPhone で押したときに勝手に拡大される */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* プレビュー */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.preview-grid figure { margin: 0; }
.preview-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.preview-grid figcaption {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}
.actions button { width: auto; margin: 0; padding-left: 24px; padding-right: 24px; }
.actions button.secondary { padding: 11px 20px; }

/* 発行結果 */
.copy-row {
  display: flex;
  gap: 8px;
}
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.copy-row button { flex: none; }
.code-display { font-size: 20px !important; letter-spacing: 0.12em; }

label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-weight: 400;
  font-size: 15px;
}

/* ---- 手順9:詳細画面 ---- */
.row-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.row-link:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  padding: 3px 12px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.section-title { margin: 28px 0 0; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 24px;
  margin: 0;
}
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }

.revoke-area { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.revoke-area .hint { margin-bottom: 8px; }

button.danger {
  width: auto;
  margin: 0;
  padding: 9px 18px;
  background: var(--danger);
}
button.danger:hover { background: var(--danger); filter: brightness(0.92); }

.actions.left { justify-content: flex-start; margin-top: 8px; }

.ev-info { color: var(--accent); font-weight: 600; }
.ev-warn { color: var(--warn); font-weight: 600; }
.ev-danger { color: var(--danger); font-weight: 600; }

/* ===== クラウド版で足したもの ===== */
.card.wide-card { max-width: 460px; }
.card h1 { margin-bottom: 4px; }
.card .lead { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.card form { display: grid; gap: 4px; }
.card button[type="submit"], .card .primary-btn { margin-top: 16px; width: 100%; }
.under-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 16px; font-size: 14px; }
.under-links a { color: var(--accent); text-decoration: none; }
.under-links a:hover { text-decoration: underline; }

input[type="text"], input[type="email"], select {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
select { appearance: auto; }
.turnstile { min-height: 70px; margin-top: 12px; }

/* 復旧用キー・予備コード(紙に書き写すもの) */
.secret-box {
  margin: 12px 0;
  padding: 16px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 20px;
  letter-spacing: 0.06em;
  text-align: center;
  background: var(--bg);
  border: 2px dashed var(--line);
  border-radius: 10px;
  overflow-wrap: anywhere;
  user-select: all;
}
.code-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 17px; text-align: left; }
.qr { display: flex; justify-content: center; margin: 12px 0; }
.qr svg { width: 200px; height: 200px; background: #fff; border-radius: 8px; }
.manual-key { font-family: ui-monospace, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
.steps { margin: 0 0 8px; padding-left: 20px; color: var(--muted); font-size: 14px; }
.toggle-link { margin-top: 10px; background: none; border: none; padding: 0; width: auto; color: var(--accent); font-size: 14px; cursor: pointer; }
.toggle-link:hover { background: none; color: var(--accent-hover); text-decoration: underline; }

.usage { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.usage strong { color: var(--text); }
.menu-btn { width: auto; margin: 0; padding: 6px 14px; font-size: 14px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.ua { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.busy { color: var(--muted); font-size: 14px; }
