/* Image-to-Video — スタイルシート */

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

:root {
  --bg:        rgba(255,255,255,0.05);
  --surface:   rgba(255,255,255,0.10);
  --border:    rgba(255,255,255,0.20);
  --text:      #f1f5f9;
  --muted:     #e9d5ff;
  --accent:    #a78bfa;
  --accent-dk: #7c3aed;
  --green:     #34d399;
  --red:       #f87171;
  --radius:    16px;
  --blur:      blur(10px);
}

html, body {
  height: 100%;
  font-family: 'Noto Sans JP', sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #4a044e 50%, #0f172a 100%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ===== ヘッダー ===== */
header {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-bottom: none;
  padding: 0 1.5rem; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.header-left { display: flex; align-items: center; gap: 0.75rem; }
.header-logo  { font-size: 1.1rem; font-weight: 700; color: #fff; }
.header-back  {
  font-size: 0.8rem; color: rgba(255,255,255,0.8); text-decoration: none;
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.7rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.3);
  transition: background 0.2s, color 0.2s;
}
.header-back:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ===== メインレイアウト ===== */
main { max-width: 860px; margin: 0 auto; padding: 2rem 1.5rem; }
h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.25rem; }
.subtitle { color: var(--muted); font-size: 0.88rem; margin-bottom: 2rem; }

/* ===== カード ===== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.card-title { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin-bottom: 1rem; }

/* ===== モデル情報 ===== */
.model-info { display: flex; align-items: center; gap: 0.75rem; }
.model-badge {
  display: inline-flex; align-items: center;
  padding: 0.3rem 0.8rem; border-radius: 99px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff; font-size: 0.82rem; font-weight: 700;
}
.model-detail { font-size: 0.82rem; color: var(--muted); }
.required { color: var(--red); }

/* ===== フォーム部品 ===== */
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
textarea, select {
  width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 0.6rem 0.9rem; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s;
}
textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
select option { background: #1e293b; }

/* ラジオグループ */
.radio-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radio-btn { display: none; }
.radio-label {
  cursor: pointer; padding: 0.35rem 0.9rem; border-radius: 8px;
  font-size: 0.85rem; border: 1px solid var(--border); background: rgba(0,0,0,0.2);
  transition: all 0.15s;
}
.radio-btn:checked + .radio-label { background: var(--accent-dk); border-color: var(--accent); color: #fff; }

/* 画像アップロード */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 540px) { .upload-grid { grid-template-columns: 1fr; } }

.upload-area {
  border: 2px dashed var(--border); border-radius: 10px; padding: 1rem;
  text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s;
  position: relative; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
}
.upload-area:hover { border-color: var(--accent); background: rgba(167,139,250,0.08); }
.upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-area .upload-icon { font-size: 1.6rem; }
.upload-area .upload-label { font-size: 0.82rem; color: var(--muted); }
.upload-area .upload-sub   { font-size: 0.75rem; color: rgba(196,181,253,0.5); }
.upload-preview { max-width: 100%; max-height: 140px; border-radius: 6px; object-fit: contain; display: none; }
.upload-clear {
  display: none; position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.6); border: none; color: #fff; border-radius: 50%;
  width: 22px; height: 22px; cursor: pointer; font-size: 0.75rem; line-height: 22px; text-align: center;
}
.upload-area.has-image .upload-preview { display: block; }
.upload-area.has-image .upload-icon, .upload-area.has-image .upload-label, .upload-area.has-image .upload-sub { display: none; }
.upload-area.has-image .upload-clear { display: block; }
.upload-area.has-image input[type="file"] { display: none; }

/* ===== 生成ボタン ===== */
.btn-generate {
  width: 100%; padding: 0.85rem; border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff; font-size: 0.95rem; font-weight: 700;
  border: none; cursor: pointer; letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(102,126,234,0.35);
}
.btn-generate:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn-generate:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ===== 進捗表示 ===== */
.progress-card { display: none; }
.progress-card.visible { display: block; }
.progress-bar-wrap { height: 6px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; margin: 0.75rem 0; }
.progress-bar-fill  { height: 100%; background: linear-gradient(90deg, #667eea, var(--green)); border-radius: 99px; transition: width 1s linear; width: 0%; }
.status-text { font-size: 0.85rem; color: var(--muted); }

/* ===== 結果エリア ===== */
.result-card { display: none; }
.result-card.visible { display: block; }
.video-wrap { border-radius: 10px; overflow: hidden; background: #000; margin-bottom: 1rem; }
.video-wrap video { width: 100%; display: block; max-height: 480px; }
.btn-download {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.2rem; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-size: 0.88rem; text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.btn-download:hover { background: rgba(255,255,255,0.12); border-color: var(--accent); }

/* ===== エラーバナー ===== */
.error-banner {
  display: none; padding: 0.75rem 1rem; border-radius: 8px;
  background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.3);
  color: var(--red); font-size: 0.88rem; margin-bottom: 1rem;
}
.error-banner.visible { display: block; }

footer { border-top: 1px solid var(--border); padding: 1.25rem; text-align: center; font-size: 0.78rem; color: rgba(196,181,253,0.4); }
