/*
 * DITA Public Portal — スタンドアロンDITブランドスタイル。
 * 配色は DITA_Persona/DITA_View_Style_Guide.md 準拠。
 */

:root {
  --dit-white:      #ffffff;
  --dit-near-black: #111111;
  --dit-dark-gray:  #333333;
  --dit-light-gray: #e6e8ee;
  --dit-deep-red:   #cc0000;
  --dit-navy:       #071827;
  --dit-tech-blue:  #0b5f9e;

  --surface:  #eef1f6;
  --surface2: #e2e6ee;
  --border:   #dde1e8;
  --text-dim: #6a737d;

  --status-good:    #0ca30c;
  --status-warning: #8a6100;
  --status-serious: var(--dit-deep-red);

  --frame-right: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Yu Gothic", "Noto Sans JP", Meiryo, system-ui, "Segoe UI", sans-serif;
  background: var(--dit-white);
  color: var(--dit-near-black);
  font-size: 14px;
}

header {
  position: fixed; top: 0; left: 0; right: 0; height: 60px;
  background: var(--dit-white); border-bottom: 2px solid var(--dit-navy);
  display: flex; align-items: center; padding: 0 calc(180px + var(--frame-right)) 0 24px;
  z-index: 10;
}
header h1 { font-size: 16px; font-weight: 700; margin: 0; }
header img { position: absolute; top: 15px; right: 16px; height: 28px; }

body::before, body::after {
  content: ""; position: fixed; top: 0; bottom: 0; right: 0;
  pointer-events: none; z-index: 20;
}
body::before { width: 6px; background: var(--dit-near-black); opacity: 0.85; }
body::after  { width: 2px; right: 6px; background: var(--dit-tech-blue); }

main {
  padding: 84px calc(24px + var(--frame-right)) 24px 24px;
  max-width: 1080px; margin: 0 auto;
}

/* ログイン/セットアップ用の中央カード */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 32px 28px;
}
.auth-card .logo { display: block; height: 32px; margin: 0 auto 20px; }
.auth-card h2 { font-size: 17px; text-align: center; margin: 0 0 4px; }
.auth-card .sub { font-size: 12px; color: var(--text-dim); text-align: center; margin-bottom: 20px; }
.auth-card label { display: block; font-size: 12px; color: var(--text-dim); margin: 12px 0 4px; }
.auth-card input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 14px; background: var(--dit-white);
}
.auth-card input:focus { outline: none; border-color: var(--dit-tech-blue); }
.auth-card button {
  width: 100%; margin-top: 20px; padding: 10px; border: none; border-radius: 4px;
  background: var(--dit-tech-blue); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
}
.auth-card button:hover { opacity: 0.9; }
.auth-card .error {
  margin-top: 12px; padding: 8px 12px; border-radius: 4px; font-size: 12px;
  background: #fbe3e3; color: var(--status-serious); display: none;
}
.auth-card .error.show { display: block; }

/* ダッシュボード: アプリ一覧 */
.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
@media (max-width: 700px) { .app-grid { grid-template-columns: 1fr; } }

.app-card {
  border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px;
  background: var(--surface); display: flex; flex-direction: column; gap: 8px;
}
.app-card .row1 { display: flex; align-items: center; justify-content: space-between; }
.app-card .name { font-weight: 700; font-size: 14px; }
.app-card .desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.app-card .actions { display: flex; gap: 8px; margin-top: 4px; }

.url-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--dit-white); border: 1px solid var(--border); border-radius: 4px;
  padding: 5px 8px;
}
.url-row .url-text {
  flex: 1; font-size: 11px; color: var(--dit-tech-blue); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.btn-copy { background: var(--surface2); color: var(--dit-near-black); padding: 4px 10px; flex-shrink: 0; }

.badge { font-size: 11px; padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.badge-running { background: #e3f7e3; color: var(--status-good); }
.badge-stopped { background: var(--surface2); color: var(--text-dim); }
.badge-error   { background: #fbe3e3; color: var(--status-serious); }

.btn {
  padding: 6px 14px; border: none; border-radius: 4px; font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.btn-start { background: var(--dit-tech-blue); color: #fff; }
.btn-stop  { background: #fbe3e3; color: #8a1414; }
.btn-open  { background: var(--surface2); color: var(--dit-near-black); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar .logout { font-size: 12px; color: var(--text-dim); cursor: pointer; text-decoration: underline; }
.btn-copy-all {
  background: var(--dit-tech-blue); color: #fff; padding: 6px 14px; border-radius: 4px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}

.dita-footer {
  font-size: 11px; color: var(--text-dim); text-align: center; padding: 24px 0 8px; opacity: 0.85;
}
