:root {
  --ink: #24313a;
  --muted: #66747c;
  --paper: #fffdf9;
  --line: #e7ded4;
  --green: #d98fa2;
  --green-dark: #b65f78;
  --coral: #c7788a;
  --gold: #b9877d;
  --mist: #fff3f6;
  --rose: #ffe9ef;
  --white: #ffffff;
  --shadow: 0 16px 38px rgba(45, 55, 58, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(255, 253, 249, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand,
.header-nav,
.hero-actions,
.mail-actions,
.contact-list {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--white);
  background: var(--green);
  border-radius: 8px;
}

.header-nav a {
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
}

.header-nav a:hover {
  color: var(--green-dark);
}

.hero {
  position: relative;
  min-height: 72svh;
  display: grid;
  align-items: center;
  padding: 78px clamp(20px, 6vw, 84px);
  overflow: hidden;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(255, 248, 250, 0.97) 0%, rgba(255, 248, 250, 0.84) 43%, rgba(255, 248, 250, 0.18) 78%),
    linear-gradient(0deg, rgba(84, 52, 61, 0.14), rgba(84, 52, 61, 0.02));
}

.hero-content {
  position: relative;
  max-width: 690px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 1.14;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1.25;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.08rem;
}

.hero-lead {
  max-width: 620px;
  color: #3e4c53;
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: var(--white);
  background: var(--green-dark);
}

.button.secondary {
  color: var(--green-dark);
  background: var(--white);
  border-color: var(--green);
}

.button.full {
  width: 100%;
}

.event-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.event-strip div {
  padding: 18px clamp(18px, 3vw, 34px);
  background: var(--white);
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.section {
  padding: 72px clamp(18px, 5vw, 72px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

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

.course-card,
.apply-form,
.payment-box,
.completion,
.legal-list,
.admin-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(45, 55, 58, 0.07);
}

.course-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.course-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.course-no {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--white);
  background: var(--coral);
  border-radius: 8px;
  font-weight: 700;
}

.course-card h3 {
  margin: 0;
  line-height: 1.45;
}

.pill-row,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 4px 10px;
  color: var(--green-dark);
  background: var(--mist);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
}

.pill.alert {
  color: #8a3429;
  background: var(--rose);
}

.meta-row span {
  padding: 8px 10px;
  background: #f7f3ed;
  border-radius: 8px;
  font-size: 0.92rem;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: 28px;
  align-items: start;
  background: #fff7f9;
}

.form-intro {
  position: sticky;
  top: 84px;
}

dl,
dd {
  margin: 0;
}

.legal-list div {
  display: grid;
  grid-template-columns: 11em 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.legal-list div:last-child {
  border-bottom: 0;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

.apply-form {
  padding: clamp(18px, 4vw, 34px);
}

fieldset {
  min-width: 0;
  margin: 0 0 28px;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 14px;
  font-size: 1.12rem;
  font-weight: 700;
}

label {
  display: grid;
  gap: 7px;
  color: #33444c;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #d6ccc0;
  border-radius: 8px;
  font: inherit;
}

textarea {
  resize: vertical;
}

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

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

.choice-grid label,
.check-line {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.choice-grid input,
.check-line input {
  width: auto;
  min-height: auto;
}

.course-select-list {
  display: grid;
  gap: 12px;
}

.course-option {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.course-option-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.course-option-main strong {
  min-width: 0;
}

.course-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: auto;
  flex: 0 0 auto;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-left: 30px;
}

.method-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.method-grid input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: auto;
  flex: 0 0 auto;
}

.method-grid span {
  min-width: 0;
  white-space: nowrap;
}

.method-grid input:disabled + span {
  color: var(--muted);
}

.field-help,
.course-status,
.agreement p {
  color: var(--muted);
  font-size: 0.93rem;
}

.notice,
.warning {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  font-weight: 700;
}

.notice {
  background: var(--mist);
  border: 1px solid #c7ddd2;
}

.warning {
  background: var(--rose);
  border: 1px solid #edc4bb;
  color: #7d3329;
}

.total-panel {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 16px 18px;
  color: var(--white);
  background: var(--green-dark);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.total-panel strong {
  font-size: 1.8rem;
}

.hidden {
  display: none !important;
}

.completion {
  max-width: 920px;
  margin: 72px auto;
}

.completion dl {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.completion dl div {
  display: grid;
  grid-template-columns: 9em 1fr;
  gap: 10px;
}

.bank-copy {
  padding: 18px;
  background: #f7f3ed;
  border-radius: 8px;
}

.contact-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--white);
  background: var(--green-dark);
}

.contact-list {
  flex-wrap: wrap;
}

.contact-list a {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  text-decoration: none;
}

.legal-list {
  padding: 18px;
}

.admin-section {
  background: #fff7f9;
}

.admin-login {
  max-width: 520px;
  padding: 24px;
}

.admin-login form {
  display: grid;
  gap: 14px;
}

.login-error {
  margin: 12px 0 0;
  color: #9b3143;
  font-weight: 700;
}

.admin-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.admin-title-row h2 {
  margin: 0;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 0 20px 20px;
}

.admin-stat {
  min-width: 110px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-stat strong {
  font-size: 1.4rem;
}

.course-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
}

.course-count-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.course-count-card strong {
  line-height: 1.45;
}

.course-count-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.course-count-card div {
  padding: 8px;
  background: var(--white);
  border-radius: 8px;
  text-align: center;
}

.course-count-card dt {
  font-size: 0.82rem;
}

.course-count-card dd {
  font-size: 1.2rem;
  font-weight: 700;
}

.capacity-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 20px;
}

.capacity-item {
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  background: var(--paper);
}

td select {
  min-width: 110px;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(36, 49, 58, 0.48);
}

.dialog-close {
  float: right;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--mist);
  cursor: pointer;
  font-size: 1.2rem;
}

#mailPreview {
  margin-bottom: 14px;
}

footer {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--white);
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .site-header,
  .contact-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: 78svh;
    padding-top: 60px;
  }

  .hero-overlay {
    background: linear-gradient(0deg, rgba(255, 248, 250, 0.98) 0%, rgba(255, 248, 250, 0.9) 56%, rgba(255, 248, 250, 0.38) 100%);
  }

  .event-strip,
  .course-grid,
  .split-section,
  .field-grid,
  .course-counts,
  .capacity-list {
    grid-template-columns: 1fr;
  }

  .form-intro {
    position: static;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 54px 16px;
  }

  .hero-actions,
  .mail-actions,
  .choice-grid,
  .method-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .method-grid {
    padding-left: 0;
  }

  .method-grid label {
    width: 100%;
    justify-content: flex-start;
  }

  .course-option-main {
    grid-template-columns: auto 1fr;
  }

  .course-option-main .pill {
    grid-column: 2;
    width: fit-content;
  }

  .total-panel {
    position: static;
  }

  .legal-list div,
  .completion dl div {
    grid-template-columns: 1fr;
  }
}
