/* ===================================================
   MANDA AI Tools — 共通スタイルシート
   全ツールページで読み込む統一デザインシステム
   =================================================== */

/* ─── Design Tokens ─── */
:root {
  --green:       #34a853;
  --green-dark:  #2a8040;
  --green-light: #e8f5e9;
  --bg:          #f5f5f5;
  --white:       #ffffff;
  --border:      #dddddd;
  --text:        #1a1a1a;
  --muted:       #666666;
  --req:         #e53935;
  --shadow:      0 2px 12px rgba(0,0,0,0.08);
  --radius:      12px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Body ─── */
body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ─── Main ─── */
.main { max-width: 860px; margin: 0 auto; padding: 32px 20px 60px; }

/* ─── Hero ─── */
.hero { text-align: center; margin-bottom: 24px; }
.hero h1 { font-size: 1.7rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.hero p  { font-size: 0.95rem; color: var(--muted); max-width: 640px; margin: 0 auto; }

/* ─── Card ─── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

/* ─── Step Header ─── */
.step-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 20px; }
.step-badge {
  background: var(--green);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.8rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* ─── Form ─── */
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text); }
.label-note { font-weight: 400; font-size: 11px; color: var(--muted); }
.req { background: var(--req); color: #fff; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; margin-left: 4px; vertical-align: middle; }

input[type=text],
input[type=url],
input[type=number],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}
input[type=text]:focus,
input[type=url]:focus,
input[type=number]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(52,168,83,.12);
}
textarea { resize: vertical; }

/* ─── Upload ─── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--green-light);
  transition: border-color .2s, background .2s;
}
.upload-area:hover, .upload-area.dragover { border-color: var(--green); background: #d4f0dc; }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-sub  { font-size: 11px; color: var(--muted); }

/* ─── File List ─── */
.file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.file-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--green-light); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 12px; font-size: 13px;
}
.file-item-name   { flex: 1; color: var(--text); font-weight: 500; }
.file-item-size   { color: var(--muted); font-size: 11px; }
.file-item-remove { cursor: pointer; color: #aaa; font-size: 16px; line-height: 1; border: none; background: none; padding: 0 2px; }
.file-item-remove:hover { color: var(--req); }

/* ─── Buttons ─── */
.submit-area { text-align: center; margin-top: 8px; }

.btn-generate {
  width: 100%; padding: 15px;
  background: var(--green); color: #fff;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(52,168,83,.28);
}
.btn-generate:hover:not(:disabled) { background: var(--green-dark); box-shadow: 0 6px 18px rgba(42,128,64,.35); transform: translateY(-1px); }
.btn-generate:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

.btn-primary {
  padding: 10px 20px;
  background: var(--green); color: #fff;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .2s;
}
.btn-primary:hover:not(:disabled) { background: var(--green-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-secondary {
  padding: 10px 18px;
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .2s, border-color .2s;
}
.btn-secondary:hover { background: var(--white); border-color: #aaa; }

/* ─── Info Cards ─── */
.info-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 4px; }
.info-card  {
  background: var(--white); border-radius: 10px;
  padding: 18px 16px; text-align: center;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.info-icon  { font-size: 26px; margin-bottom: 8px; }
.info-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.info-body  { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ─── Error ─── */
.error-msg {
  background: #fff0f0; border: 1px solid #ffb3b3;
  border-radius: 8px; padding: 10px 14px;
  color: #c0392b; font-size: 13px; margin-top: 12px;
}

/* ─── Loading ─── */
.loading-card {
  background: var(--white); border-radius: var(--radius);
  padding: 60px 32px; box-shadow: var(--shadow);
  border: 1px solid var(--border); text-align: center;
}
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.loading-sub   { font-size: 13px; color: var(--muted); }
.loading-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; max-width: 340px; margin-left: auto; margin-right: auto; }
.loading-step  { padding: 9px 14px; border-radius: 8px; background: var(--bg); font-size: 0.88rem; color: var(--muted); transition: all 0.3s; text-align: left; }
.loading-step.active { background: var(--green); color: #fff; font-weight: 600; transform: scale(1.02); }
.loading-step.done   { background: #d1fae5; color: #065f46; }

/* ─── Report ─── */
.report-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px; gap: 16px; flex-wrap: wrap;
}
.report-title    { font-size: 20px; font-weight: 700; color: var(--text); }
.report-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }
.report-actions  { display: flex; gap: 10px; flex-shrink: 0; }
.report-wrapper  {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden;
}
.report-frame { width: 100%; height: 920px; border: none; display: block; }

/* ─── Utility ─── */
.hidden { display: none !important; }

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .form-row    { grid-template-columns: 1fr; }
  .info-cards  { grid-template-columns: 1fr; }
  .card        { padding: 20px 16px; }
  .report-header { flex-direction: column; }
  .report-frame  { height: 700px; }
}
