/* ================================================================
   Simple Form Builder - MYoACT dark form style
   ================================================================ */

:root {
  --sfb-bg-base: #0a0f17;
  --sfb-bg-panel: rgba(7, 11, 18, 0.92);
  --sfb-bg-field: #1e1e1f;
  --sfb-border: rgba(255, 255, 255, 0.1);
  --sfb-text: #ffffff;
  --sfb-text-soft: rgba(255, 255, 255, 0.8);
  --sfb-text-muted: rgba(255, 255, 255, 0.45);
  --sfb-accent: #20ffbe;
  --sfb-accent-2: #1f92ff;
  --sfb-danger: #ff6767;
  --sfb-gradient-main: linear-gradient(90deg, #1794e8 0%, #19d0d3 45%, #15ff9a 100%);
  --sfb-gradient-bg:
    radial-gradient(circle at 50% 72%, rgba(31, 146, 255, 0.34), transparent 28%),
    radial-gradient(circle at 82% 48%, rgba(21, 255, 154, 0.22), transparent 34%),
    radial-gradient(circle at 20% 24%, rgba(21, 255, 154, 0.08), transparent 24%),
    linear-gradient(180deg, #0b0f17 0%, #091019 100%);
  --sfb-radius-lg: 18px;
  --sfb-radius-md: 14px;
  --sfb-radius-pill: 999px;
  --sfb-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  --sfb-font-jp: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}

.sfb-open-btn:not(.box_btn),
.sfb-wrapper,
.sfb-modal {
  font-family: var(--sfb-font-jp);
}

.sfb-open-btn:not(.box_btn) {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  min-height: 64px;
  padding: 16px 64px 16px 28px;
  border: 0;
  border-radius: var(--sfb-radius-pill);
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 151, 255, 0.24);
  transition: transform .24s ease, box-shadow .24s ease;
}

.sfb-open-btn:not(.box_btn)::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 200%;
  background: var(--sfb-gradient-main);
  z-index: -2;
  transition: transform .32s cubic-bezier(.33, 1, .68, 1);
}

.sfb-open-btn:not(.box_btn)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 22px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7f8a99 0%, #d5d9df 100%);
  transform: translateY(-50%);
}

.sfb-open-btn:not(.box_btn):hover {
  transform: translateY(-1px);
  box-shadow: 0 0 34px rgba(0, 170, 255, 0.34);
}

.sfb-open-btn:not(.box_btn):hover::before {
  transform: translateX(50%);
}

.sfb-open-btn.box_btn {
  width: 32rem;
  max-width: 100%;
}

.sfb-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(3, 6, 12, 0.82);
  backdrop-filter: blur(10px);
  z-index: 99999;
  opacity: 0;
  transition: opacity .24s ease;
}

.sfb-overlay[hidden] {
  display: none !important;
}

.sfb-overlay--open {
  opacity: 1;
}

.sfb-overlay--closing {
  opacity: 0;
  pointer-events: none;
}

body.sfb-no-scroll {
  overflow: hidden;
}

.sfb-modal {
  position: relative;
  width: min(100%, 560px);
  border-radius: 28px;
  background: transparent;
  box-shadow: var(--sfb-shadow);
  transform: translateY(16px) scale(.985);
  transition: transform .24s ease;
}

.sfb-overlay--open .sfb-modal {
  transform: translateY(0) scale(1);
}

.sfb-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background .2s ease, border-color .2s ease;
}

.sfb-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.sfb-modal-body {
  padding: 0;
}

.sfb-wrapper {
  max-width: 100%;
  margin: 0 auto;
  color: var(--sfb-text);
}

.sfb-form-page,
.sfb-thankyou-page {
  padding: 36px 28px 28px;
  border-radius: 28px;
  background: var(--sfb-gradient-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sfb-form-title {
  margin: 0 0 16px;
  color: var(--sfb-text);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.sfb-form-title::after {
  display: none;
}

.sfb-form-description {
  margin: 0 0 28px;
  color: var(--sfb-text-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
  text-align: left;
}

.sfb-field {
  margin-bottom: 14px;
}

.sfb-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.sfb-required {
  color: var(--sfb-danger);
  background: transparent;
  padding: 0;
  font-size: inherit;
  font-weight: 700;
}

.sfb-input,
.sfb-textarea,
.sfb-select {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--sfb-border);
  border-radius: var(--sfb-radius-md);
  background: var(--sfb-bg-field);
  color: var(--sfb-text);
  font-size: 15px;
  line-height: 1.5;
  box-sizing: border-box;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.sfb-input::placeholder,
.sfb-textarea::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

.sfb-input:focus,
.sfb-textarea:focus,
.sfb-select:focus {
  outline: none;
  border-color: rgba(32, 255, 190, 0.5);
  box-shadow: 0 0 0 4px rgba(32, 255, 190, 0.08);
}

.sfb-textarea {
  min-height: 90px;
  resize: vertical;
}

.sfb-select {
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.72) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.72) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 14px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.sfb-select option {
  color: #111;
}

.sfb-radio-group,
.sfb-checkbox-group {
  display: grid;
  gap: 14px;
}

.sfb-radio-label,
.sfb-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 18px 22px;
  border: 1px solid var(--sfb-border);
  border-radius: var(--sfb-radius-md);
  background: rgba(30, 30, 31, 0.94);
  color: var(--sfb-text-soft);
  font-size: 18px;
  cursor: pointer;
}

.sfb-radio-label input[type="radio"],
.sfb-checkbox-label input[type="checkbox"],
.sfb-privacy-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--sfb-accent);
}

.sfb-wrapper .sfb-checkbox-label input[type="checkbox"],
.sfb-wrapper .sfb-privacy-label input[type="checkbox"] {
  position: static !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  flex: 0 0 20px;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  border: 1px solid rgba(255, 255, 255, 0.42) !important;
  border-radius: 5px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18) !important;
}

.sfb-wrapper .sfb-checkbox-label input[type="checkbox"]:checked,
.sfb-wrapper .sfb-privacy-label input[type="checkbox"]:checked {
  border-color: rgba(32, 255, 190, 0.72) !important;
  background: rgba(32, 255, 190, 0.12) !important;
}

.sfb-wrapper .sfb-checkbox-label input[type="checkbox"]:focus-visible,
.sfb-wrapper .sfb-privacy-label input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(32, 255, 190, 0.12) !important;
}

.sfb-wrapper .sfb-privacy-label {
  justify-content: center !important;
}

.sfb-wrapper .sfb-privacy-label input[type="checkbox"] + a {
  margin-left: 6px;
}

.sfb-field--privacy {
  margin-top: 4px;
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.sfb-privacy-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--sfb-text-muted);
  font-size: 13px;
  line-height: 1.8;
  cursor: pointer;
}

.sfb-privacy-label a {
  color: #7bb6ff;
  text-decoration: none;
}

.sfb-field--submit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 0;
}

.sfb-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 14px 28px;
  border: 0;
  border-radius: var(--sfb-radius-md);
  background: var(--sfb-gradient-main);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease, filter .2s ease;
}

.sfb-btn.is-loading {
  color: transparent;
}

.sfb-btn::before {
  display: none;
}

.sfb-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.sfb-btn:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

.sfb-loading {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sfb-spin .6s linear infinite;
  pointer-events: none;
}

.sfb-loading--active {
  display: inline-block;
}

@keyframes sfb-spin {
  to { transform: rotate(360deg); }
}

.sfb-error {
  display: none;
  margin-top: 8px;
  color: #ff9494;
  font-size: 13px;
  line-height: 1.5;
}

.sfb-general-error {
  display: none;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 103, 103, 0.22);
  border-radius: 12px;
  background: rgba(255, 103, 103, 0.08);
  color: #ffd7d7;
  font-size: 14px;
  line-height: 1.7;
}

.sfb-field:has(.sfb-error:not(:empty)) .sfb-input,
.sfb-field:has(.sfb-error:not(:empty)) .sfb-textarea,
.sfb-field:has(.sfb-error:not(:empty)) .sfb-select {
  border-color: rgba(255, 103, 103, 0.5);
}

.sfb-thankyou-page h2 {
  margin: 0 0 14px;
  color: var(--sfb-text);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
}

.sfb-thankyou-page p,
.sfb-thankyou-page li {
  color: var(--sfb-text-soft);
  font-size: 2rem;
  line-height: 1.9;
}

.sfb-thankyou-page a {
  color: #7bb6ff;
}

@media (max-width: 767px) {
  .sfb-overlay {
    padding: 16px 12px;
    align-items: center;
  }

  .sfb-modal {
    width: 100%;
    max-height: calc(100vh - 32px);
    border-radius: 20px;
    overflow: hidden;
  }

  .sfb-form-page,
  .sfb-thankyou-page {
    padding: 24px 14px 16px;
    border-radius: 18px;
  }

  .sfb-form-title {
    margin-bottom: 8px;
    font-size: 20px;
  }

  .sfb-form-description {
    margin-bottom: 14px;
    font-size: 12px;
    line-height: 1.6;
  }

  .sfb-label {
    margin-bottom: 2px;
    font-size: 14px;
  }

  .sfb-field {
    margin-bottom: 10px;
  }

  .sfb-input,
  .sfb-textarea,
  .sfb-select {
    min-height: 42px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .sfb-textarea {
    min-height: 72px;
  }

  .sfb-field--privacy {
    margin-top: 0;
    margin-bottom: 10px;
  }

  .sfb-privacy-label {
    gap: 8px;
    font-size: 12px;
    line-height: 1.6;
  }

  .sfb-btn {
    min-height: 46px;
    font-size: 14px;
  }

  .sfb-thankyou-page p,
  .sfb-thankyou-page li {
    font-size: 1.4rem;
  }
}
