/* ==========================================================================
   JuiceBrix — Sample Request Form (shared across all pages)
   Include in <head>:  <link rel="stylesheet" href="sample-form.css?v=6">
   Include before </body>:  <script src="sample-form.js"></script>
   Trigger: add  data-open-form  to any <button> or <a>
   ========================================================================== */

/* ---------- MODAL ---------- */
.jb-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  overflow-y: auto;
  padding: 24px;
  background: rgba(7, 16, 9, .88);
  opacity: 0;
  transition: opacity .25s ease;
}
.jb-modal-mask.show { display: flex; }
.jb-modal-mask.visible { opacity: 1; }

.jb-modal-panel {
  position: relative;
  margin: auto;
  width: 100%;
  max-width: 640px;
  background: #0d1b11;
  border: 1px solid rgba(145, 216, 74, .22);
  border-radius: 18px;
  padding: 38px 38px 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
  opacity: 0;
  transition: opacity .25s ease;
  font-family: Inter, Arial, sans-serif;
  color: #edf3e9;
}
.jb-modal-mask.visible .jb-modal-panel { opacity: 1; }

.jb-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.jb-modal-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .05);
}
.jb-modal-close svg { width: 16px; height: 16px; }

/* ---------- HEAD ---------- */
.jb-modal-head { padding-right: 44px; margin-bottom: 28px; }
.jb-modal-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #91d84a;
  margin-bottom: 10px;
}
.jb-modal-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.7px;
  color: #fff;
  margin-bottom: 8px;
}
.jb-modal-sub {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .55);
}

/* ---------- FORM ---------- */
.jb-form { display: flex; flex-direction: column; gap: 18px; }
.jb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.jb-form-field { display: flex; flex-direction: column; gap: 7px; }
.jb-form-field label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}
.jb-form-field input,
.jb-form-field select,
.jb-form-field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 14.5px;
  font-family: Inter, Arial, sans-serif;
  color: #fff;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  transition: border-color .2s ease, background .2s ease;
  outline: none;
}
.jb-form-field input::placeholder,
.jb-form-field textarea::placeholder { color: rgba(255, 255, 255, .28); }
.jb-form-field input:focus,
.jb-form-field select:focus,
.jb-form-field textarea:focus {
  border-color: #91d84a;
  background: rgba(145, 216, 74, .04);
}
.jb-form-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2391d84a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5L6 6.5L11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 11px 7px;
  padding-right: 40px;
  cursor: pointer;
}
.jb-form-field select option { background: #0d1b11; color: #fff; }
.jb-form-field textarea { resize: vertical; min-height: 80px; line-height: 1.55; }

.jb-form-actions { margin-top: 6px; }
.jb-form-actions .jb-btn-main {
  width: 100%;
  justify-content: center;
  padding: 15px 24px;
  font-size: 15px;
}

.jb-form-message {
  display: none;
  padding: 14px 18px;
  border-left: 3px solid #91d84a;
  border-radius: 0 9px 9px 0;
  background: rgba(145, 216, 74, .08);
  color: rgba(255, 255, 255, .85);
  font-size: 14px;
  line-height: 1.6;
}
.jb-form-message.show { display: block; }
.jb-form-message.is-error {
  border-left-color: #d84a4a;
  background: rgba(216, 74, 74, .08);
}

/* ---------- BUTTON (self-contained — works on any page) ---------- */
.jb-btn-main {
  border: 0;
  border-radius: 10px;
  padding: 17px 30px;
  color: #071009;
  background: #91d84a;
  font-size: 16px;
  font-weight: 900;
  font-family: Inter, Arial, sans-serif;
  box-shadow: 0 11px 28px rgba(145, 216, 74, .25);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background .2s ease;
}
.jb-btn-main:hover { background: #a4e35b; }
.jb-btn-main:disabled { opacity: .65; cursor: wait; }

/* ---------- SUCCESS VIEW ---------- */
.jb-modal-success { display: none; text-align: center; padding: 30px 10px 20px; }
.jb-modal-success.show { display: block; }
.jb-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(145, 216, 74, .15);
  border: 1.5px solid #91d84a;
  display: grid;
  place-items: center;
  color: #91d84a;
}
.jb-success-icon svg { width: 26px; height: 26px; }
.jb-modal-success h3 {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.jb-modal-success p {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .65);
  max-width: 420px;
  margin: 0 auto 24px;
}

/* ---------- MOBILE — 一屏完整显示，无底部留白 ---------- */
@media (max-width: 760px) {
  /* 关键：手机端把 mask 改成 block，避免 flex 拉伸 panel */
  .jb-modal-mask { padding: 0; background: #0d1b11; }
  .jb-modal-mask.show { display: block; }

  .jb-modal-panel {
    max-width: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 22px 18px 22px;
    min-height: auto;
    margin: 0;
  }

  .jb-modal-close { top: 12px; right: 12px; width: 30px; height: 30px; }
  .jb-modal-close svg { width: 13px; height: 13px; }

  /* Head */
  .jb-modal-head { padding-right: 34px; margin-bottom: 16px; }
  .jb-modal-label { font-size: 9px; letter-spacing: 1.5px; margin-bottom: 6px; }
  .jb-modal-title { font-size: 18px; letter-spacing: -0.4px; margin-bottom: 4px; }
  .jb-modal-sub { font-size: 12px; line-height: 1.45; }

  /* Form */
  .jb-form { gap: 10px; }
  .jb-form-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .jb-form-field { gap: 4px; }
  .jb-form-field label { font-size: 8.5px; letter-spacing: 1px; }
  .jb-form-field input,
  .jb-form-field select,
  .jb-form-field textarea {
    padding: 9px 11px;
    font-size: 13px;
    border-radius: 8px;
  }
  .jb-form-field select {
    background-position: right 12px center;
    background-size: 9px 6px;
    padding-right: 30px;
  }
  .jb-form-field textarea { min-height: 58px; line-height: 1.45; }

  /* Submit button */
  .jb-form-actions { margin-top: 2px; }
  .jb-form-actions .jb-btn-main {
    padding: 12px 20px;
    font-size: 13.5px;
    border-radius: 9px;
  }

  /* Form message */
  .jb-form-message { padding: 10px 12px; font-size: 12.5px; border-radius: 0 8px 8px 0; }

  /* Success */
  .jb-modal-success { padding: 40px 6px 16px; }
  .jb-success-icon { width: 44px; height: 44px; margin-bottom: 14px; }
  .jb-success-icon svg { width: 20px; height: 20px; }
  .jb-modal-success h3 { font-size: 18px; margin-bottom: 8px; }
  .jb-modal-success p { font-size: 13px; line-height: 1.55; margin-bottom: 18px; }
}