:root {
  --background: #f4f8ff;
  --background-strong: #e7effb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #172033;
  --muted: #637086;
  --border: #d8e1ef;
  --border-strong: #b8c6da;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #e8f0ff;
  --accent: #0ea5e9;
  --danger: #b42318;
  --shadow: 0 18px 46px rgba(23, 32, 51, 0.11);
  --shadow-soft: 0 10px 24px rgba(23, 32, 51, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.16), transparent 30rem),
    linear-gradient(135deg, var(--background) 0%, var(--background-strong) 100%);
  color: var(--text);
  font-family: "Noto Sans JP", Meiryo, "Hiragino Sans", "Yu Gothic UI", "Segoe UI", sans-serif;
  font-size: 16px;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.page {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 48px 20px;
}

.page-header {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.eyebrow {
  width: fit-content;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.lead,
.section-copy {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
}

.lead {
  font-size: 1.02rem;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(184, 198, 218, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.panel::before {
  display: block;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  content: "";
}

.panel > h2,
.panel > .section-copy,
.panel > form,
.panel > .result-block,
.panel > .actions {
  margin-right: clamp(18px, 4vw, 34px);
  margin-left: clamp(18px, 4vw, 34px);
}

.panel > h2 {
  margin-top: 28px;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.section-copy {
  margin-bottom: 24px;
}

form {
  padding-bottom: 30px;
}

.form-note,
.badge-panel {
  display: grid;
  gap: 4px;
  margin: 16px 0 0;
  padding: 16px 18px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  line-height: 1.7;
}

.form-note strong,
.badge-panel strong {
  color: var(--primary-hover);
  font-size: 0.95rem;
}

.form-note span {
  font-size: 0.92rem;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.badge-list a {
  display: inline-flex;
}

.badge-list img {
  display: block;
  max-width: 100%;
  height: 28px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #253047;
  font-size: 0.94rem;
  font-weight: 700;
}

.required-label {
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 800;
}

.optional-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

input {
  min-height: 48px;
  padding: 11px 13px;
}

textarea {
  min-height: 132px;
  padding: 12px 13px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #8a978f;
}

input:hover,
textarea:hover {
  border-color: var(--border-strong);
  background: #ffffff;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
  outline: none;
}

button:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.38);
  outline-offset: 3px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 20px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.2);
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

button:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.24);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.secondary-button {
  border-color: var(--border-strong);
  background: #ffffff;
  color: var(--text);
  box-shadow: none;
}

.secondary-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-hover);
  box-shadow: none;
}

.result-block {
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.result-block:first-of-type {
  margin-top: 24px;
}

.result-block h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.result-block h3::before {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.result-text {
  margin-bottom: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 1.02rem;
  line-height: 1.85;
}

.reflection-list {
  margin: 0;
  padding-left: 24px;
}

.reflection-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 1.02rem;
  line-height: 1.8;
}

.behavior-item {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.behavior-item h4 {
  margin-bottom: 0;
  color: var(--primary-hover);
  font-size: 0.95rem;
}

.behavior-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.75;
}

.result-actions {
  justify-content: flex-end;
  margin-top: 4px;
  padding-top: 22px;
  padding-bottom: 30px;
  border-top: 1px solid var(--border);
}

.result-actions button {
  min-width: 132px;
}

.result-actions #copyBtn {
  min-width: 156px;
}

.result-actions .secondary-button {
  border-color: var(--border-strong);
  background: #ffffff;
  color: var(--primary-hover);
  box-shadow: 0 8px 16px rgba(23, 32, 51, 0.08);
}

.result-actions .secondary-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-hover);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
}

#errorMsg {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  background: #fff4f2;
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 700;
}

@media (min-width: 720px) {
  .page {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .page-header {
    margin-bottom: 30px;
  }

  .field {
    margin-bottom: 20px;
  }

  .result-block:nth-of-type(3) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .result-block:nth-of-type(3) h3 {
    grid-column: 1 / -1;
  }

  .behavior-item {
    margin-bottom: 0;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 28px 14px;
  }

  h1 {
    font-size: 2rem;
  }

  .panel > h2,
  .panel > .section-copy,
  .panel > form,
  .panel > .result-block,
  .panel > .actions {
    margin-right: 16px;
    margin-left: 16px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions button {
    width: 100%;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions button {
    min-width: 0;
  }
}
