/* Modern form design - works with the existing contact.html markup */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

h1 {
  width: min(860px, calc(100% - 32px));
  margin: 32px auto 0;
  padding: 18px 24px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(135deg, #0f4cbd, #1769e0);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 28px rgba(15, 76, 189, 0.14);
}

#wrap {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 42px 42px;
  background: #fff;
  border: 1px solid #e7ebf2;
  border-top: 0;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  text-align: left;
}

.waku {
  width: 100%;
}

h2 {
  margin: 0 0 18px;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 2px solid #1769e0;
  background: none;
  color: #0f2557;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

h3 {
  margin: 28px 0 10px;
  color: #0f2557;
  font-size: 18px;
  font-weight: 700;
}

p {
  margin: 12px 0;
}

/* Intro copy */
.waku > p {
  color: #4b5563;
}

.waku > p[style*="font-weight"] {
  display: inline-block;
  margin: 8px 0 16px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eef5ff;
  color: #0f4cbd;
  font-weight: 700 !important;
}

/* Form card */
form#FO {
  margin-top: 30px;
}

form#FO table {
  width: 100%;
  margin: 0;
  border: 1px solid #e5e9f0;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

form#FO tr {
  border: 0;
}

form#FO tr + tr th,
form#FO tr + tr td {
  border-top: 1px solid #e9edf3;
}

form#FO th,
form#FO td {
  padding: 20px;
  vertical-align: top;
}

form#FO th {
  width: 190px;
  background: #f8faff;
  color: #24324a;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

form#FO td {
  background: #fff;
  color: #6b7280;
  font-size: 13px;
  text-align: left;
}

form#FO th font[color="red"] {
  display: inline-block;
  margin-left: 6px;
  color: #e11d48 !important;
  font-size: 13px;
  font-weight: 800;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #cfd6e3;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: #111827;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: #1769e0;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 105, 224, 0.11);
}

.formWidth,
.textAreaSize {
  width: 100%;
  max-width: none;
}

.textAreaSize {
  min-height: 220px;
  height: 220px;
  resize: vertical;
}

/* Submit area */
form#FO > p {
  text-align: center;
}

input[type="submit"] {
  width: min(100%, 460px);
  margin: 12px auto 4px;
  padding: 15px 28px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #1769e0, #0f4cbd);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(23, 105, 224, 0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 24px rgba(23, 105, 224, 0.3);
  filter: brightness(1.03);
}

input[type="submit"]:active {
  transform: translateY(0);
}

/* Existing inline red note */
form#FO > p[style*="color: red"] {
  max-width: 640px;
  margin: 10px auto 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff7f7;
  color: #c62828 !important;
  font-size: 12px !important;
  line-height: 1.7;
  text-align: left;
}

.error {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #f2b8b5;
  border-radius: 8px;
  background: #fff7f7;
  color: #b42318;
}

.error p {
  margin: 0;
  font-size: 13px;
}

.foot {
  margin: 20px 0 30px;
  padding: 0 16px;
  color: #7c8798;
  text-align: center;
  font-size: 12px;
}

/* Keep validation messages above surrounding elements */
.formError {
  z-index: 9999 !important;
}

@media screen and (max-width: 750px) {
  body {
    font-size: 15px;
  }

  h1 {
    width: calc(100% - 24px);
    margin-top: 12px;
    padding: 15px 18px;
    border-radius: 12px 12px 0 0;
    font-size: 16px;
  }

  #wrap {
    width: calc(100% - 24px);
    padding: 24px 18px 30px;
    border-radius: 0 0 12px 12px;
  }

  h2 {
    margin-bottom: 16px;
    font-size: 22px;
  }

  .waku > p {
    font-size: 14px;
  }

  form#FO {
    margin-top: 24px;
  }

  form#FO table,
  form#FO tbody,
  form#FO tr,
  form#FO th,
  form#FO td {
    display: block;
    width: 100%;
  }

  form#FO table {
    border-radius: 10px;
  }

  form#FO tr + tr th,
  form#FO tr + tr td {
    border-top: 0;
  }

  form#FO tr + tr {
    border-top: 1px solid #e9edf3;
  }

  form#FO th {
    padding: 16px 16px 7px;
    background: #fff;
    white-space: normal;
  }

  form#FO td {
    padding: 0 16px 17px;
    font-size: 12px;
  }

  input[type="text"],
  input[type="email"],
  select,
  textarea {
    font-size: 16px; /* prevents zoom on iPhone */
  }

  .textAreaSize {
    min-height: 180px;
    height: 180px;
  }

  input[type="submit"] {
    width: 100%;
    padding: 15px 20px;
    font-size: 17px;
  }

  form#FO > p[style*="color: red"] {
    font-size: 11px !important;
  }
}


.mail-notice {
  margin: 24px 0;
  padding: 18px 22px;
  background: #fffbea;
  border: 1px solid #f1df9a;
  border-radius: 10px;
  color: #444;
  font-size: 14px;
  line-height: 1.8;
}

.mail-notice p {
  margin: 0 0 10px;
}

.mail-notice ul {
  margin: 0;
  padding-left: 1.5em;
}

.mail-notice li {
  margin-bottom: 8px;
}

.mail-notice li:last-child {
  margin-bottom: 0;
}