/* 応募ページ(公開側)。色はキャンペーンのデザイン設定(CSS変数)で上書きされる */
:root {
  --bg: #fdf6e3;
  --content-bg: #ffffff;
  --primary: #b71c1c;
  --button: #2e7d32;
  --button-label: #ffffff;
}
* { box-sizing: border-box; }
body.entry-body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  background: var(--bg);
  color: #2b2b2b;
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

.preview-banner {
  background: #1f2937;
  color: #fbbf24;
  text-align: center;
  padding: 8px;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 10;
}

.entry-container { max-width: 920px; margin: 0 auto; padding: 0 0 72px; }

.main-visual {
  width: 100%;
  display: block;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}
.main-visual-placeholder {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000));
  color: #fff;
  text-align: center;
  padding: 96px 16px;
  font-size: 34px;
  font-weight: bold;
  letter-spacing: 0.08em;
  border-radius: 0 0 18px 18px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.entry-content { padding: 28px 20px 0; }

.description {
  white-space: pre-wrap;
  margin: 0 0 24px;
  background: var(--content-bg);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.privacy-box {
  background: var(--content-bg);
  border-left: 5px solid var(--primary);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 28px;
  white-space: pre-wrap;
  font-size: 13.5px;
  color: #555;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.draft-file-box {
  background: #f7f7f5;
  border: 1px dashed #ccc;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #666;
}
.draft-file-box p { margin: 0 0 8px; }

.phase-message {
  background: var(--content-bg);
  border-radius: 14px;
  text-align: center;
  padding: 64px 20px;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.entry-form {
  background: var(--content-bg);
  border-radius: 14px;
  padding: 12px 24px 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.form-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 4px;
  border-bottom: 1px solid #eee;
}
.form-row:last-of-type { border-bottom: none; }
.form-label {
  width: 240px;
  min-width: 190px;
  text-align: right;
  font-weight: 600;
  font-size: 14px;
  color: #444;
}
.required-mark {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: bold;
  border-radius: 999px;
  padding: 1px 9px;
  margin-left: 8px;
  vertical-align: 1px;
}
.form-input { flex: 1; }
.form-input input, .form-input select, .form-input textarea {
  width: 100%;
  max-width: 460px;
  padding: 11px 14px;
  border: 1.5px solid #dcdcdc;
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input input:focus, .form-input select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.form-input input[type="file"] {
  border: 1.5px dashed #c9c9c9;
  border-radius: 4px;
  background: #fafafa;
  padding: 14px;
  cursor: pointer;
}
.form-input input[type="file"]:hover { border-color: var(--primary); }

.birthdate-selects { display: flex; gap: 8px; max-width: 460px; }
.birthdate-selects select { flex: 1; min-width: 0; }
.birthdate-selects .bd-year { flex: 1.8; }

/* 階層選択(大区分>中区分>小区分)の連動プルダウン */
.cascade-select { display: flex; gap: 8px; max-width: 460px; }
.cascade-select select { flex: 1; min-width: 0; }
.cascade-select select:disabled { background: #f3f3f3; color: #999; }

/* トグル(項目ごとに独立したカード型ボタン) */
.toggle-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.toggle-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-option span {
  display: inline-block;
  padding: 10px 28px;
  font-size: 14.5px;
  cursor: pointer;
  color: #555;
  background: #fff;
  border: 1.5px solid #dcdcdc;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.toggle-option span:hover { border-color: var(--primary); }
.toggle-option input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: bold;
}
.toggle-option input:focus-visible + span {
  outline: 2px solid color-mix(in srgb, var(--primary) 50%, transparent);
  outline-offset: 2px;
}

/* エラー表示 */
.form-error-box {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #991b1b;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0;
  font-weight: 600;
}
.form-row.has-error .form-input input,
.form-row.has-error .form-input select { border-color: #dc2626; }
.field-error { color: #dc2626; font-size: 13px; margin: 6px 0 0; }

/* honeypot(botだけが見る) */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 確認画面・完了画面 */
.confirm-title { font-size: 22px; margin: 20px 0 6px; }
.confirm-lead { margin: 0 0 18px; color: #555; }
.confirm-card {
  background: var(--content-bg);
  border-radius: 14px;
  padding: 8px 24px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.confirm-table { width: 100%; border-collapse: collapse; }
.confirm-table th, .confirm-table td { padding: 12px 8px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
.confirm-table td { white-space: pre-wrap; }
.confirm-table th { width: 220px; color: #444; font-size: 14px; }
.confirm-table tr:last-child th, .confirm-table tr:last-child td { border-bottom: none; }
.confirm-empty { color: #aaa; }
.confirm-receipts h2 { font-size: 15px; margin: 18px 0 10px; }
.confirm-receipt-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.confirm-receipt-grid img {
  max-width: 200px;
  max-height: 260px;
  border: 1px solid #ddd;
  border-radius: 8px;
  object-fit: contain;
  background: #fafafa;
}
.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 28px 0 8px;
  flex-wrap: wrap;
}
.back-button {
  background: #fff;
  color: #555;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  padding: 14px 40px;
  cursor: pointer;
}
.back-button:hover { background: #f5f5f5; }
.complete-message { font-size: 17px; }
.phase-title { font-size: 22px; font-weight: bold; margin-bottom: 10px; }
.phase-visual { max-width: 100%; max-height: 320px; border-radius: 10px; margin-bottom: 18px; }
.complete-check {
  width: 64px;
  height: 64px;
  line-height: 64px;
  border-radius: 50%;
  background: var(--button);
  color: var(--button-label);
  font-size: 32px;
  margin: 0 auto 16px;
}

@media (max-width: 640px) {
  .confirm-table th { width: auto; display: block; border-bottom: none; padding-bottom: 0; }
  .confirm-table td { display: block; padding-top: 4px; }
  .confirm-actions form { width: 100%; }
  .confirm-actions button { width: 100%; }
}

.submit-row { text-align: center; padding: 36px 0 8px; }
.submit-button {
  background: var(--button);
  color: var(--button-label);
  border: none;
  border-radius: 6px;
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 0.1em;
  padding: 15px 88px;
  cursor: pointer;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--button) 45%, transparent);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--button) 55%, transparent);
}
.submit-button:active { transform: translateY(0); }
.submit-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.save-note { text-align: center; font-size: 12px; color: #888; margin: 14px 0 0; }
.save-note a { color: #888; }

.draft-save-button {
  margin-top: 8px;
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  font-size: 13px;
  padding: 8px 18px;
  cursor: pointer;
}
.draft-save-button:hover { background: color-mix(in srgb, var(--primary) 8%, #fff); }

@media (max-width: 640px) {
  .form-row { flex-direction: column; align-items: stretch; gap: 8px; padding: 14px 0; }
  .form-label { width: auto; min-width: 0; text-align: left; }
  .form-input input, .form-input select, .birthdate-selects, .cascade-select { max-width: none; }
  .entry-content { padding: 16px 12px 0; }
  .main-visual, .main-visual-placeholder { border-radius: 0; }
  .submit-button { width: 100%; padding: 15px 0; }
}
