/* =========
   App Shell
   ========= */

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f3f4f6;
}

body {
  -webkit-font-smoothing: antialiased;
}

.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #111827;
  color: #f9fafb;
  gap: 12px;
}

.app-title h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.app-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.8;
}

.app-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
}

.app-column {
  min-height: 0;
}

.app-column-left {
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
}

.form-scroll {
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 16px 16px 80px;
}

.app-column-right {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =========
   Panels & Form
   ========= */

.panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 14px 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
  margin-bottom: 12px;
}

.panel-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-note {
  margin: 4px 0 10px;
  font-size: 11px;
  color: #6b7280;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.field-group label {
  font-size: 11px;
  font-weight: 500;
  color: #374151;
}

.field-group input,
.field-group textarea,
.field-group select {
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
  background: #ffffff;
}

.field-group-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.toggle-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
  font-size: 12px;
}

.toggle-list label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.file-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-button input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* =========
   Buttons
   ========= */

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.btn-secondary:hover {
  background: #030712;
  border-color: #030712;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.4);
  transform: translateY(-1px);
}

.btn-switch {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #4b5563;
}

.btn-switch.is-active {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.btn-switch:not(.is-active):hover {
  background: #e5e7eb;
}

/* =========
   Preview
   ========= */

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preview-toggle {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: #e5e7eb;
}

.preview-meta {
  font-size: 11px;
  color: #6b7280;
}

.preview-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding-top: 4px;
}

.preview-frame {
  background: #111827;
  border-radius: 24px;
  padding: 12px;
  box-shadow:
    0 20px 40px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(15, 23, 42, 0.7);
  overflow: auto;
}

.preview-frame-mobile {
  width: 390px;
  max-width: 100%;
  height: calc(100vh - 120px);
}

.preview-frame-desktop {
  width: 1280px;
  max-width: 100%;
  height: calc(100vh - 120px);
}

.lp-preview-root {
  background: #f9fafb;
  min-height: 100%;
}

/* =========
   Responsive (App Shell)
   ========= */

@media (max-width: 1024px) {
  .app-main {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 860px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-column-left {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .form-scroll {
    max-height: none;
  }

  .preview-frame-mobile,
  .preview-frame-desktop {
    height: 520px;
  }
}

/* =========
   Generated LP Styles (used only for preview/export)
   NOTE: 同じ内容は script.js の CSS 生成ロジックにも反映されます。
   ここではプレビュー表示のために最低限のデフォルトを定義します。
   ========= */

.lp-page {
  min-height: 100%;
  background: #f9fafb;
  color: #111827;
}

.lp-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.lp-hero {
  padding: 32px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #f9fafb;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lp-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.lp-hero-title {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.lp-hero-subtext {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 16px;
}

.lp-hero-image {
  border-radius: 16px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.75);
}

.lp-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.lp-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  background: #f9fafb;
  color: #111827;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.lp-section {
  padding: 24px 0;
  border-bottom: 1px solid #e5e7eb;
}

.lp-section-header {
  margin-bottom: 16px;
}

.lp-section-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.lp-section-title {
  font-size: 20px;
  margin: 4px 0 0;
}

.lp-list-grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.lp-list-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.lp-card {
  padding: 14px 14px 16px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
}

.lp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  margin-bottom: 4px;
}

.lp-flow-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.lp-flow-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.lp-flow-step {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #111827;
  color: #f9fafb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-top: 2px;
}

.lp-price-box {
  padding: 18px 18px 20px;
  border-radius: 16px;
  background: #111827;
  color: #f9fafb;
}

.lp-price-amount {
  font-size: 26px;
  font-weight: 700;
  margin: 6px 0 4px;
}

.lp-price-desc {
  font-size: 13px;
  opacity: 0.9;
}

.lp-faq-item {
  padding: 10px 0;
  border-top: 1px solid #e5e7eb;
}

.lp-faq-q {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.lp-faq-a {
  font-size: 13px;
  color: #4b5563;
  overflow-wrap: break-word;
  word-break: break-word;
}

.lp-cta-section {
  padding: 26px 20px 28px;
  border-radius: 16px;
  background: #111827;
  color: #f9fafb;
  text-align: center;
  margin-top: 24px;
}

.lp-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  font-size: 11px;
  color: #6b7280;
}

.lp-footer-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.lp-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

@media (min-width: 768px) {
  .lp-inner {
    padding: 48px 24px 72px;
  }

  .lp-hero {
    padding: 40px 32px;
  }

  .lp-hero-title {
    font-size: 36px;
  }

  .lp-list-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lp-list-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-flow-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-footer-top {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

