.jms-form-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  font-size: .75rem;
}

.jms-form-container a {
  color: #006899;
}

.jms-form-container a:hover {
  color: #5bb4de;
}

.jms-form-container fieldset {
  border: none;
  padding: 0;
  margin-bottom: 2rem;
}

/* Title */
.jms-form-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--color-body);
  padding-bottom: 10px;
  border-bottom: 3px solid var(--color-common);
  margin-bottom: 30px;
}

/* Heading */
.jms-form-heading {
  font-size: 20px;
  font-weight: bold;
  color: var(--color-common);
  margin-bottom: 20px;
}

/* Intro Text */
.jms-form-intro {
  font-size: .875rem;
  color: var(--color-body);
  margin-bottom: 60px;
}

.jms-form {
  margin-bottom: 40px;
}

/* Form Sections */
.jms-form-section {
  margin-bottom: 30px;
}

.jms-form-section-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--color-body);
  margin-bottom: 15px;
  padding: 0;
  background-color: transparent;
  border: none;
}

.jms-form-section-content {
  padding: 0;
  background-color: transparent;
  border: none;
}

.jms-form-required-notice {
  font-size: .8125rem;
  color: var(--color-body);
  margin-bottom: 20px;
  padding: 0;
  background-color: transparent;
  border: none;
}

.jms-form-asterisk {
  color: #dc3545;
  margin-right: 2px;
}

/* Override component form styles */
.jms-form-section-content .jms-form {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
}

.jms-form-section-content .jms-form-title {
  font-size: 16px;
  font-weight: bold;
  margin: 20px 0 15px 0;
  padding: 0;
  background-color: transparent;
  color: var(--color-common);
  border: none;
}

/* Form fields - horizontal layout */
/* Target fieldset > label structure from components */
.jms-form-section-content fieldset > label {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.jms-form-section-content .jms-form-field {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.jms-form-section-content .jms-form-field:last-child {
  border-bottom: none;
}

/* Label styling */
.jms-form-section-content .jms-label-with-required {
  min-width: 180px;
  font-size: .875rem;
  color: var(--color-body);
  flex-shrink: 0;
  padding-top: 8px;
  display: block;
}

.jms-form-section-content .jms-label {
  min-width: 180px;
  font-size: .875rem;
  color: var(--color-body);
  flex-shrink: 0;
  padding-top: 8px;
}

.jms-form-section-content .jms-required,
.jms-form-section-content .jms-required-mark {
  color: #dc3545;
  margin-left: 2px;
}

/* Input and container  styling */
.jms-form-section-content .jms-input-container,
.jms-form-section-content .jms-inline-inputs {
  flex: 1;
  gap: 1rem;
}

.jms-form-section-content .jms-input,
.jms-form-section-content input[type="text"],
.jms-form-section-content input[type="email"],
.jms-form-section-content input[type="tel"],
.jms-form-section-content input[type="number"],
.jms-form-section-content input[type="url"],
.jms-form-section-content input[type="password"],
.jms-form-section-content input[type="file"],
.jms-form-section-content select,
.jms-form-section-content textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: .875rem;
  background-color: var(--color-white);
  box-sizing: border-box;
}

.jms-form-section-content .jms-input:disabled,
.jms-form-section-content input[type="text"]:disabled,
.jms-form-section-content input[type="email"]:disabled,
.jms-form-section-content input[type="tel"]:disabled,
.jms-form-section-content input[type="number"]:disabled,
.jms-form-section-content input[type="url"]:disabled,
.jms-form-section-content input[type="password"]:disabled,
.jms-form-section-content input[type="file"]:disabled,
.jms-form-section-content select:disabled,
.jms-form-section-content textarea:disabled,
.jms-form-section-content .jms-input[disabled] {
  /* subtle disabled background */
  background-color: #f5f5f5;
  color: #888;
  cursor: not-allowed;
}

/* Utility class to visually mark an element as disabled without the disabled attribute */
.jms-form-section-content .is-disabled {
  background-color: #f5f5f5;
  color: #888;
  cursor: not-allowed;
  pointer-events: none;
}

/* Inputs inside inline-inputs */
.jms-form-section-content .jms-inline-inputs input[type="text"],
.jms-form-section-content .jms-inline-inputs input[type="email"],
.jms-form-section-content .jms-inline-inputs input[type="tel"],
.jms-form-section-content .jms-inline-inputs input[type="number"],
.jms-form-section-content .jms-inline-inputs input[type="url"],
.jms-form-section-content .jms-inline-inputs input[type="password"],
.jms-form-section-content .jms-inline-inputs select,
.jms-form-section-content .jms-inline-inputs textarea {
  flex: 1;
  width: auto;
}

.jms-form-section-content select {
  background-color: var(--color-white);
}

.jms-form-section-content .jms-input:focus,
.jms-form-section-content input:focus,
.jms-form-section-content select:focus,
.jms-form-section-content textarea:focus {
  outline: none;
  border-color: var(--color-common);
}

.jms-form-section-content .jms-field-error,
.jms-form-section-content input.jms-field-error,
.jms-form-section-content select.jms-field-error,
.jms-form-section-content textarea.jms-field-error {
  border-color: #dc3545;
  background-color: #fff5f5;
}

/* Help text */
.jms-form-section-content .jms-help-text,
.jms-form-section-content .danger-label {
  font-size: .75rem;
  color: #dc3545;
  margin-top: 5px;
  display: block;
  line-height: 1.4;
}

.jms-form-section-content .jms-mini-label {
  font-size: .8125rem;
  color: #666;
}

/* Buttons inside sections (like 反映 button) */
.jms-form-section-content .jms-btn,
.jms-form-section-content button[type="button"] {
  background-color: var(--color-white);
  color: var(--color-body);
  border: 1px solid #ccc;
  padding: 6px 20px;
  border-radius: 4px;
  font-size: .8125rem;
  cursor: pointer;
}

.jms-form-section-content .jms-btn:hover,
.jms-form-section-content button[type="button"]:hover {
  background-color: #f5f5f5;
}

/* Checkboxes and radios */
.jms-form-section-content input[type="checkbox"],
.jms-form-section-content input[type="radio"] {
  width: 24px;
  height: 24px;
  cursor: pointer;
  margin: 0;
}

.jms-form-section-content .jms-checkbox-item,
.jms-form-section-content .jms-radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 20px;
}

/* Submit Button */
.jms-form-button-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 40px;
  margin-bottom: 40px;
}

.jms-form-submit-btn {
  background-color: var(--color-common);
  color: var(--color-white);
  border: none;
  padding: 8px 24px;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 400;
  min-width: 100px;
}

.jms-form-submit-btn:hover {
  background-color: #006F01;
}

.jms-form-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.jms-form-secondary-btn {
  background-color: var(--color-white);
  color: var(--color-common);
  border: 2px solid var(--color-common);
  padding: 8px 24px;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 400;
  min-width: 100px;
}

.jms-form-secondary-btn:hover {
  background-color: var(--color-common);
  color: var(--color-white);
}

.jms-form-secondary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Confirmation page button row (入力に戻る / 登録) */
.jms-profile-view-button-row {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  margin-bottom: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.jms-profile-view-btn {
  background-color: var(--color-white);
  color: var(--color-common);
  border: 2px solid var(--color-common);
  padding: 10px 30px;
  border-radius: 25px;
  font-size: .875rem;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.jms-profile-view-btn:hover {
  background-color: var(--color-common);
  color: var(--color-white);
}

.jms-profile-view-btn-icon {
  color: var(--color-white);
  font-size: .75rem;
  font-weight: bold;
  background-color: var(--color-common);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  margin: 0;
}

/* Messages */
.success-message {
  background-color: #d4edda;
  color: #155724;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
}

.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
}

.jms-status-banner {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-size: inherit;
  font-weight: 400;
  line-height: 1.5;
}

.jms-status-pending {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

.jms-status-returned {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

/* Error states */
.jms-error-message {
  color: #dc3545;
  font-size: .8125rem;
  margin-top: 5px;
  display: block;
}

/* Hide nested submit buttons from components */
.jms-form-section-content form .jms-submit-btn,
.jms-form-section-content form button[type="submit"] {
  display: none !important;
}

/* layouts */
.jms-input-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.jms-hint-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
}

.jms-hint-text {
  font-size: 1rem;
  color: #d63638;
  margin-bottom: 0.5rem;
  margin-left: 10px;
  padding-top: 6px;
}

/* Inline inputs styling for multiple input fields in one row */
.jms-inline-inputs {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-width: 0;
  align-items: center;
  padding-top: 8px;
}

.jms-inline-group input {
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* Stack radio groups vertically and align items */
.jms-inline-inputs .jms-radio-group {
  /* allow radio items to be side-by-side */
  display: flex;
  gap: 2rem;
  margin-bottom: 8px;
}

.jms-wide-gap {
  gap: 3rem;
}

.jms-inline-group {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.jms-mini-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-body);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: auto;
  width: auto;
  padding: 0;
  background: none !important;
  border-radius: 0 !important;
}

.jms-input-small {
  max-width: 100px !important;
  flex: 0 0 auto !important;
}

/* Graduation year/month row: avoid clipping when radio options take horizontal space */
.jms-graduation-inline {
  flex-wrap: wrap;
  row-gap: 0.75rem;
}

.jms-graduation-year-month-group {
  flex: 0 0 auto;
  min-width: fit-content;
  white-space: nowrap;
}

.jms-graduation-year {
  width: 100px;
  max-width: 100px !important;
}

.jms-graduation-month {
  width: 80px;
  max-width: 80px !important;
}

/* Label with required mark */
.jms-label-with-required {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 180px;
  max-width: 180px;
}

.jms-radio-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.jms-radio-item input[type="radio"] {
  margin-top: 3px;
}

.jms-radio-item span {
  display: inline-block;
}

.jms-form-field {
  display: flex;
  align-items: center;
  margin-top: 5px;
  margin-bottom: 5px;
  max-width: 100%;
  overflow: hidden;
}

.jms-form-hint {
  font-size: 13px;
  color: #666;
  margin: 4px 0;
}

.jms-field-error {
  border: 2px solid #ff0000 !important;
  background-color: #ffe6e6 !important;
  box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

.jms-field-error:focus {
  outline: 2px solid #ff0000;
  outline-offset: 2px;
}

/* Divider */
.divider {
  color: #e0e0e0;
}

.progress-divider {
  width: 72px;
  color: var(--color-common);
  border: 1px solid var(--color-common);
}

/* Responsive Design */
@media (max-width: 768px) {
  .jms-form-title {
    font-size: 20px;
  }

  .jms-form-steps {
    flex-direction: column;
    gap: 10px;
  }

  .jms-form-step {
    width: 100%;
    min-width: auto;
  }

  .jms-form-step-arrow {
    transform: rotate(90deg);
  }

  .jms-form-section-content .jms-form-field {
    flex-direction: column;
    gap: 10px;
  }

  .jms-form-section-content .jms-label {
    min-width: auto;
    padding-top: 0;
  }

  .jms-form-section-content .jms-input,
  .jms-form-section-content input,
  .jms-form-section-content select,
  .jms-form-section-content textarea {
    width: 100%;
    max-width: 100%;
  }

  .jms-form-submit-btn {
    width: 100%;
    min-width: auto;
  }

  .jms-btn {
    width: 100%;
    padding: 1rem;
  }

  .jms-radio-group {
    margin-left: 0;
    gap: 1rem;
  }

  .jms-label-sub {
    width: 100% !important;
    max-width: 100% !important;
  }

  .jms-label-with-required {
    width: 100%;
    max-width: 100%;
  }

  .jms-inline-inputs {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .jms-alert {
    border-width: 2px;
  }

  .progress-divider {
    width: 20px;
    transform: rotate(90deg);
  }
}

@media (max-width: 420px) {
  .jms-btn.jms-btn-small {
    font-size: .625rem;
    /* slightly smaller */
    padding: 6px 8px;
  }
}

@media (max-width: 320px) {
  .jms-btn.jms-btn-small {
    font-size: 8px;
    padding: 5px 6px;
  }
}

.jms-input-text-display {
  padding: 5px 10px;
}

.jms-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* colors */
.danger-label {
  color: #d63638;
  font-weight: 600;
  display: inline-block;
}

/* JMS Forms - Alert & Error Styles */
.jms-alert {
  box-sizing: border-box;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 0 0 16px 0;
  font-size: .875rem;
  line-height: 1.4;
}

.jms-alert-error {
  /* very light red */
  background-color: #fff4f4;
  /* soft red border */
  border: 1px solid #f5c6cb;
  /* dark red text */
  color: #7a141a;
}

.jms-alert-success {
  /* very light green */
  background-color: #f6ffef;
  /* soft green border */
  border: 1px solid #c3e6cb;
  /* dark green text */
  color: #0f6b16;
}

/* small utility for input error state */
.jms-input-error {
  border-color: #d9534f !important;
  box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.06);
}

/* Form title - green color */
.jms-form-title-sub {
  font-size: 20px;
  font-weight: bold;
  color: var(--color-common);
  margin: 20px 0 15px 0;
  padding: 8px 12px;
  background-color: #e8e8d0;
  border: none;
}

/* Custom Datepicker Styles */
.jms-datepicker-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.jms-datepicker-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  width: 90%;
  max-width: 400px;
  overflow: hidden;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.jms-datepicker-header {
  background: linear-gradient(135deg, #6b21a8 0%, #7c3aed 100%);
  color: var(--color-white);
  padding: 20px;
}

.jms-datepicker-header-label {
  font-size: .875rem;
  opacity: 0.9;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.jms-datepicker-header-date {
  font-size: 28px;
  font-weight: 500;
}

.jms-datepicker-body {
  padding: 16px;
}

.jms-datepicker-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.jms-datepicker-nav-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px 12px;
  color: #666;
  border-radius: 4px;
  transition: background 0.2s;
}

.jms-datepicker-nav-btn:hover {
  background: #f0f0f0;
}

.jms-datepicker-nav-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-body);
}

.jms-datepicker-calendar {
  margin-top: 12px;
}

.jms-datepicker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.jms-datepicker-weekday {
  text-align: center;
  font-size: .75rem;
  font-weight: 600;
  color: #666;
  padding: 8px 0;
}

.jms-datepicker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.jms-datepicker-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
  position: relative;
}

.jms-datepicker-day:not(.empty):not(.disabled):hover {
  background: #f0f0f0;
}

.jms-datepicker-day.selected {
  background: #7c3aed;
  color: var(--color-white);
  font-weight: 600;
}

.jms-datepicker-day.today:not(.selected) {
  border: 2px solid #7c3aed;
  font-weight: 600;
}

.jms-datepicker-day.disabled {
  color: #ccc;
  cursor: not-allowed;
}

.jms-datepicker-day.empty {
  cursor: default;
}

.jms-datepicker-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #e0e0e0;
}

.jms-datepicker-btn {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.jms-datepicker-btn.cancel {
  color: #666;
}

.jms-datepicker-btn.cancel:hover {
  background: #f0f0f0;
}

.jms-datepicker-btn.ok {
  color: #7c3aed;
}

.jms-datepicker-btn.ok:hover {
  background: rgba(124, 58, 237, 0.1);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .jms-datepicker-container {
    width: 95%;
  }

  .jms-datepicker-header-date {
    font-size: 24px;
  }
}
