@font-face {
  font-family: "yugothib-500";
  src: url("../fonts/YuGothic-Medium-01.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: "yugothib-600";
  src: url("../fonts/YuGothic-Bold-01.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: "yugothib-500";
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  background-color: #fdeced;
  min-height: 100vh;
  align-items: center;
  justify-content: flex-start;
}

/* Page container */
.page-container {
  width: 100%;
  min-height: 100vh;
  background-color: #fdeced;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* Banner section */
.banner-section {
  width: 100%;
  padding: 64px 16px 32px 16px;
}

.banner-container {
  max-width: 1024px;
  margin: 0 auto;
}

.banner-image {
  height: auto;
  width: 100%;
  border-radius: 8px;
  display: block;
  object-fit: contain;
}
/* Form section */
.form-section {
  width: 100%;
  padding: 0 16px 64px 16px;
}

.form-container {
  max-width: 1024px;
  margin: 0 auto;
}

.form-card {
  background-color: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Form title */
.form-title {
  margin-bottom: 32px;
}

.form-title h1 {
  color: #d80c18;
  font-size: 20px;
  font-weight: bold;
  line-height: 1.2;
}

.mufg-text {
  letter-spacing: -0.48px;
  font-family: "yugothib-600";
}

.seminar-text {
  letter-spacing: 0.64px;
  font-family: "yugothib-600";
}

/* Form fields */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
}

.field-row-start {
  align-items: start;
}

.field-label {
  grid-column: 1;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 4px;
}

.field-label label {
  color: #333333;
  font-size: 14px;
  font-weight: bold;
  font-family: "yugothib-600";
}

.multiline-label {
  line-height: 21px;
}

.field-label-top {
  padding-top: 8px;
}

.field-badge {
  grid-column: 1;
  display: flex;
  justify-content: flex-start;
}

.field-badge-top {
  padding-top: 8px;
}

.required-badge {
  background-color: #d80c18;
  color: white;
  font-size: 14px;
  padding: 0 8px;
  border-radius: 2px;
  font-weight: bold;
  height: 24px;
  display: flex;
  align-items: center;
  text-wrap: nowrap;
}

.optional-badge {
  background-color: #333333;
  color: white;
  font-size: 14px;
  padding: 0 8px;
  border-radius: 2px;
  font-weight: bold;
  height: 24px;
  display: flex;
  align-items: center;
}

.field-input {
  grid-column: 2;
}

.field-input-vertical {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-input-top {
  padding-top: 8px;
}

.text-input {
  width: 100%;
  height: 36px;
  border: 1px solid #bebebe;
  border-radius: 3px;
  padding: 0 12px;
  background-color: white;
  font-size: 14px;
}

.text-input:focus {
  border-color: #0352d0;
  outline: none;
}

.name-input {
  max-width: 384px;
}

.furigana-button-with-text {
  display: flex;
  flex-direction: row;
  gap: 5px;
}
.furigana-label {
  color: #ff0000;
  font-size: 14px;
  font-family: "yugothib-600";
}

.text-bold-label {
  font-family: initial;
  font-weight: 700;
  font-size: 16px;
}
.add-companion-btn {
  background-color: #f7f7f7;
  border: 1px solid #bebebe;
  border-radius: 2px;
  height: 36px;
  padding: 1px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333333;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  align-self: flex-start;
  display: flex;
  align-items: center;
  justify-content: center;
  text-wrap: nowrap;
}

.add-companion-btn:hover {
  background-color: #eeeeee;
}
#extraFields {
  display: none;
}
.companion-form-box {
  width: 100%;
  background-color: #f7f7f7;
  border: 1px solid #bebebe;
  border-radius: 5px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: flex-start;
  gap: 20px;
  padding: 20px;
}
/* Add vertical spacing between inputs inside companion form */
.companion-form-box .text-input {
  margin-bottom: 12px; /* adjust to taste */
}

/* Optional: only apply to last input remove margin */
.companion-form-box .text-input:last-child {
  margin-bottom: 0;
}

.companion-button-icon {
  font-size: 32px;
  font-weight: 200;
  color: #707070;
}
.companion-form-title {
  font-size: 14px;
  font-family: "yugothib-600";
  color: #333333;
}

.email-confirm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.email-confirm-label {
  color: #333333;
  font-size: 14px;
  font-weight: bold;
  display: block;
  margin-bottom: 8px;
}

.custom-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Style the label to look like a checkbox */
.custom-radio label {
  display: inline-flex;
  align-items: center; /* vertical centering ✅ */
  gap: 6px; /* spacing between box + text */
  cursor: pointer;
  user-select: none;
  line-height: 1.2;
}

/* Add custom box */
.custom-radio label::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid #999;
  border-radius: 3px;
  background: white;
  flex-shrink: 0; /* box stays square */
  display: inline-block;
}

/* When radio is checked, show checkmark */
.custom-radio input[type="radio"]:checked + label::before {
  background: #0352d0;
  border-color: #0352d0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 10.8L3.2 8 2 9.2l4 4 8-8L12.8 4 6 10.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.radio-input {
  width: 16px;
  height: 16px;
  accent-color: #0352d0;
  background-color: white;
}

.radio-label span,
.radio-label {
  color: #333333;
  font-size: 14px;
  font-weight: bold;
  font-family: "yugothib-600";
}

/* Divider */
.divider-section {
  margin: 32px 0;
}

.divider-line {
  width: 100%;
  height: 1px;
  background-color: #707070;
}

/* Privacy policy section */
.privacy-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.privacy-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.privacy-title-container {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}

.red-line {
  width: 2px;
  height: 40px;
  background-color: #e70013;
  top: 0;
  left: 0;
}

.grey-line {
  width: 2px;
  height: 40px;
  background-color: #999999;
  top: 0;
  left: 0;
}

.privacy-title {
  padding-left: 20px;
  font-family: "yugothib-600";
}

.privacy-title h3 {
  color: #2f2f2f;
  font-size: 16px;
  font-weight: bold;
}

.privacy-title span {
  letter-spacing: -0.48px;
}

.privacy-content {
  text-align: center;
}

.privacy-text {
  color: #333333;
  font-size: 14px;
  line-height: 21px;
  letter-spacing: -0.39px;
  margin-bottom: 16px;
  font-family: "yugothib-600";
}

.privacy-link-container {
  display: inline-block;
}

.privacy-link {
  color: #333333;
  font-family: "yugothib-600";
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: black;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
}

.privacy-checkbox {
  display: flex;
  justify-content: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-input {
  width: 16px;
  height: 16px;
  border: 1px solid #bebebe;
  border-radius: 2px;
  background-color: white;
  accent-color: #0352d0;
}

.checkbox-input:focus {
  outline: 2px solid #0352d0;
  outline-offset: 2px;
  outline-color: rgba(3, 82, 208, 0.5);
}

.checkbox-label span {
  color: #333333;
  font-family: "yugothib-600";
  font-size: 14px;
  font-weight: bold;
}

/* Submit button */
.submit-section {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.submit-button {
  background-color: #0352d0;
  color: white;
  border-radius: 10px;
  height: 69px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: "yugothib-600";
  font-weight: bold;
  font-size: 16.3px;
  min-width: 340px;
  justify-content: center;
  border: none;
  cursor: pointer;
}
.submit-button:disabled {
  background-color: #333333;
  cursor: not-allowed;
}

.submit-button:hover:not(:disabled) {
  background-color: #0341b8;
}

/* Footer */
.footer {
  text-align: center;
  padding: 32px 0;
}

.footer p {
  color: black;
  font-size: 14px;
  letter-spacing: -0.24px;
}

.success-page .page-container {
  padding-top: 50px;
}
.success-form-section {
  flex: 1;
  display: flex;
  align-items: flex-start; /* vertically center */
  justify-content: center;
  padding: 0 16px; /* remove extra 64px bottom padding */
}

.success-title {
  font-size: 24px;
  color: #333333;
  font-family: "yugothib-600";
}
.success-message {
  font-size: 16px;
  color: #333333;
  font-family: "yugothib-600";
}

.success-card {
  background-color: white;
  border-radius: 20px;
  padding: 24px 16px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  width: 100%;
  box-sizing: border-box;
}
/* Responsive design */
@media (min-width: 640px) {
  .banner-section {
    padding: 16px 8px;
  }

  /* .banner-image {
    height: 120px;
  } */

  .form-section {
    padding: 0 32px 64px 32px;
  }

  .form-card {
    padding: 32px;
  }

  .form-title h1 {
    font-size: 24px;
  }

  .privacy-header {
    flex-direction: row;
    align-items: center;
  }
}
/* for small phones */
@media (max-width: 400px) {
  .submit-button {
    min-width: 100px;
  }
}
@media (min-width: 768px) {
  /* .banner-image {
    height: 120px;
  } */
}

@media (min-width: 1024px) {
  .banner-section {
    padding: 64px 64px 32px 64px;
  }

  /* .banner-image {
    height: 288px;
  } */

  .form-section {
    padding: 0 64px 64px 64px;
  }

  .form-card {
    padding: 48px;
  }

  .form-title {
    margin-bottom: 48px;
  }

  .form-title h1 {
    font-size: 25px;
  }

  .form-fields {
    gap: 32px;
  }

  .field-row {
    grid-template-columns: 4fr 8fr;
    align-items: flex-start;
  }

  .field-row-start {
    align-items: start;
  }

  .field-label {
    grid-column: 1;
  }

  .field-badge {
    grid-column: 2;
    justify-content: center;
  }

  .field-input {
    grid-column: 2;
  }

  .field-label-top {
    padding-top: 8px;
  }

  .field-badge-top {
    padding-top: 8px;
  }

  .divider-section {
    margin: 48px 0;
  }

  .submit-section {
    margin-top: 48px;
  }
}

@media (min-width: 1280px) {
  .banner-section {
    padding: 64px 128px 32px 128px;
  }

  /* .banner-image {
    height: 290px;
  } */

  .form-section {
    padding: 0 128px 64px 128px;
  }
}

/* Icon swap logic */
.add-companion-btn .icon-minus {
  display: none;
}
.add-companion-btn.is-open .icon-plus {
  display: none;
}
.add-companion-btn.is-open .icon-minus {
  display: inline;
}

/* Optional: align icons nicely with the label */
.add-companion-btn svg {
  flex-shrink: 0;
}

/* Smartphone & iPad: label (left) + badge (right) on one row, input below */
@media (max-width: 1023px) {
  .field-row {
    display: grid;
    grid-template-columns: 1fr auto; /* label grows, badge hugs right */
    align-items: center;
    column-gap: 8px; /* small space between label/badge */
    row-gap: 8px; /* space between header row & input */
  }

  .field-label {
    grid-column: 1;
    justify-content: flex-start;
    gap: 10px;
    align-items: center;
  }
  .label-align {
    width: 100px;
  }
  .label-align-companion {
    width: 75px;
  }
  .field-badge {
    grid-column: 2;
    justify-content: flex-end; /* right-align the badge relative to label row */
    display: flex;
  }
  .required-badge {
    font-size: 12px;
  }

  /* Input row spans full width below */
  .field-input {
    grid-column: 1 / -1;
    width: 100%;
  }

  /* Ensure inputs truly fill on small screens */
  .text-input {
    width: 100%;
  }
  .name-input {
    max-width: 100%;
  } /* override the 384px cap for small screens */
}

/* ----- Email validation states ----- */
.error-text {
  color: #d80c18; /* MUFG red */
  font-size: 12px;
  line-height: 1.4;
  margin-top: 6px;
}

.text-input.input-error {
  border-color: #d80c18 !important;
  outline: none;
}

.text-input.input-valid {
  border-color: #22a447; /* subtle green */
  outline: none;
}
.custom-underline {
  text-decoration: underline;
  text-decoration-color: currentColor; /* match text */
  text-decoration-thickness: 1px; /* slim */
  text-underline-offset: 1px; /* move line down */
  text-decoration-color: #2f2f2f;
  font-size: 12px;
}

@media (max-width: 768px) {
  .banner-section {
    padding: 16px 8px !important; /* trims the big top/bottom gap on phones */
  }
  .banner-image {
    height: 120px;
  }
  .furigana-button-with-text {
    flex-direction: column;
  }
}

/* --- Success page: keep banner, remove scroll --- */

/* Use the small/dynamic viewport to avoid extra height on mobile */
body.success-page .page-container {
  min-height: 100svh;
}
@supports (height: 100dvh) {
  body.success-page .page-container {
    min-height: 100dvh;
  }
}

/* Keep the banner, but make it compact on the success page */
body.success-page .banner-section {
  padding: 8px 8px 0 8px; /* trim top/bottom padding */
}
body.success-page .banner-image {
  height: 100px; /* smaller banner height on phones */
  background-size: contain; /* keep your existing contain behavior */
}

/* Center the success card without extra vertical padding */
body.success-page .success-form-section {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 16px; /* no extra top/bottom padding */
}

/* Slightly tighter card spacing to save a few pixels */
body.success-page .success-card {
  gap: 16px;
  padding: 20px 12px;
}

/* Keep footer visible but lighter so it doesn’t force scroll */
body.success-page .footer {
  margin-top: auto; /* push to bottom within flex layout */
  padding: 12px 0; /* less vertical padding */
}

/* -------- Success page desktop adjustments -------- */
@media (min-width: 1024px) {
  body.success-page .banner-image {
    height: 280px; /* larger banner on desktop */
    background-size: cover; /* fill width nicely */
  }

  body.success-page .success-card {
    padding: 48px 40px; /* more breathing room */
    gap: 40px;
  }

  body.success-page .success-title {
    font-size: 32px; /* bigger heading */
  }

  body.success-page .success-message {
    font-size: 20px; /* larger message text */
    line-height: 1.6;
    text-align: center;
  }

  body.success-page .footer {
    padding: 32px 0; /* restore normal footer size */
  }
}
/* -------- Success page tablet (iPad) adjustments -------- */
@media (min-width: 768px) and (max-width: 1023px) {
  body.success-page .banner-image {
    height: 200px; /* bigger than phone, smaller than PC */
    background-size: cover; /* fill width */
  }

  body.success-page .success-card {
    padding: 36px 28px;
    gap: 32px;
  }

  body.success-page .success-title {
    font-size: 28px;
  }

  body.success-page .success-message {
    font-size: 18px;
    line-height: 1.5;
    text-align: center;
  }

  body.success-page .footer {
    padding: 24px 0;
  }
}

/* -------- Success page desktop adjustments -------- */
@media (min-width: 1024px) {
  body.success-page .banner-image {
    height: 280px;
    background-size: cover;
  }

  body.success-page .success-card {
    padding: 48px 40px;
    gap: 40px;
  }

  body.success-page .success-title {
    font-size: 32px;
  }

  body.success-page .success-message {
    font-size: 20px;
    line-height: 1.6;
    text-align: center;
  }

  body.success-page .footer {
    padding: 32px 0;
  }
}
