/* =====================================================================
   TotalPCB standard RFQ section (shared by all landing pages)
   Load site-wide, or append to each landing page stylesheet.
   Elementor structure:
     outer flexbox  - ID: tpcb-rfq, width 100%, padding 0, no classes
       left flexbox  - Shortcode widget [tpcb_rfq_panel title="..."]
                       (or an HTML widget with tpcb-rfq-panel.html)
       right flexbox - Shortcode widget (Contact Form 7)
   Columns are identified by content (.tpcb-rfq-panel / .wpcf7),
   so the widget type in each column does not matter.
   Per-page overrides: in the page stylesheet, redefine only the tokens
   that change, using "body #tpcb-rfq" so the override wins regardless of
   load order. Do not edit this file or the form for a single page.
   Example (gold submit button, links and focus stay brand blue):
     body #tpcb-rfq {
       --tpcb-rfq-button: #fbbf24;
       --tpcb-rfq-button-hover: #f59e0b;
       --tpcb-rfq-on-button: #0d2a52;
     }
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------- */
#tpcb-rfq {
  --tpcb-rfq-heading: #0d2a52;
  --tpcb-rfq-text: #3d4859;
  --tpcb-rfq-muted: #5b6576;
  /* Links, focus borders, file button text: stay readable on white */
  --tpcb-rfq-primary: #1565c0;
  --tpcb-rfq-primary-dark: #0f4c97;
  --tpcb-rfq-focus-ring: rgba(21, 101, 192, 0.15);
  /* Submit button: follows the primary color unless a page overrides it */
  --tpcb-rfq-button: var(--tpcb-rfq-primary);
  --tpcb-rfq-button-hover: var(--tpcb-rfq-primary-dark);
  --tpcb-rfq-on-button: #fff;
  --tpcb-rfq-sky: #40a0ff;
  --tpcb-rfq-tint: #eaf2fb;
  --tpcb-rfq-field: #c9d5e4;
  --tpcb-rfq-error: #c93a3a;
  --tpcb-rfq-radius: 6px;
  --tpcb-rfq-radius-sm: 4px;
  --tpcb-rfq-section-y: 75px;
  --tpcb-rfq-gap: 60px;
  /* Deeper alternative: linear-gradient(150deg, #0a1f40 0%, #0c2b57 55%, #0f4a94 100%) */
  --tpcb-rfq-bg: linear-gradient(150deg, #0b2246 0%, #0d3269 50%, #1155a8 100%);
}


/* ---------------------------------------------------------------------
   2. Scoped reset
   --------------------------------------------------------------------- */
#tpcb-rfq,
#tpcb-rfq *,
#tpcb-rfq *::before,
#tpcb-rfq *::after {
  box-sizing: border-box;
}

#tpcb-rfq .tpcb-rfq-panel h2,
#tpcb-rfq .tpcb-rfq-panel p,
#tpcb-rfq .tpcb-rfq-panel dl,
#tpcb-rfq .tpcb-rfq-panel dd {
  margin: 0;
}

#tpcb-rfq a:focus-visible {
  outline: 3px solid var(--tpcb-rfq-sky);
  outline-offset: 3px;
  border-radius: 2px;
}


/* ---------------------------------------------------------------------
   3. Section layout
   Full-width background; the side padding limits content to 1230px.
   --------------------------------------------------------------------- */
#tpcb-rfq {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--tpcb-rfq-gap);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--tpcb-rfq-section-y) max(20px, calc((100% - 1230px) / 2));
  overflow-x: clip;
  background: var(--tpcb-rfq-bg);
  color: #fff;
  scroll-margin-top: 96px;
}

/* Columns: text 40%, form takes the rest */
#tpcb-rfq > :has(.elementor-widget) {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0;
}

#tpcb-rfq > :has(.tpcb-rfq-panel) {
  flex: 0 1 40%;
}

#tpcb-rfq > :has(.wpcf7) {
  flex: 1 1 0%;
}

#tpcb-rfq .elementor-widget-html,
#tpcb-rfq .elementor-widget-shortcode {
  width: 100%;
  margin: 0;
}


/* ---------------------------------------------------------------------
   4. Left panel (text on the gradient)
   --------------------------------------------------------------------- */
.tpcb-rfq-panel {
  color: #fff;
  overflow-wrap: break-word;
}

#tpcb-rfq .tpcb-rfq-panel > :not(:first-child) {
  margin-top: 18px;
}

#tpcb-rfq .tpcb-rfq-panel__title {
  color: #fff;
  font-size: clamp(26px, 2.3vw, 32px);
  line-height: 1.3;
}

#tpcb-rfq .tpcb-rfq-panel__intro {
  color: rgba(255, 255, 255, 0.88);
}

/* Files, confidentiality and NDA as three compact rows */
#tpcb-rfq .tpcb-rfq-panel > .tpcb-rfq-panel__points {
  margin-top: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.tpcb-rfq-panel__point {
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

#tpcb-rfq .tpcb-rfq-panel__point dt {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
}

#tpcb-rfq .tpcb-rfq-panel__point dd {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

#tpcb-rfq .tpcb-rfq-panel > .tpcb-rfq-panel__nda {
  margin-top: 24px;
}

#tpcb-rfq .tpcb-rfq-panel__nda,
#tpcb-rfq .tpcb-rfq-panel__nda:visited {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--tpcb-rfq-radius-sm);
  color: #fff;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

#tpcb-rfq .tpcb-rfq-panel__nda:hover {
  border-color: var(--tpcb-rfq-sky);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.tpcb-rfq-panel__nda-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.tpcb-rfq-panel__nda span {
  min-width: 0;
  overflow-wrap: anywhere;
}


/* ---------------------------------------------------------------------
   5. Form card (Contact Form 7)
   --------------------------------------------------------------------- */
#tpcb-rfq .wpcf7 {
  padding: 32px;
  border: 0;
  border-radius: var(--tpcb-rfq-radius);
  background: #fff;
  box-shadow: 0 18px 40px rgba(3, 15, 40, 0.28);
  color: var(--tpcb-rfq-text);
}

#tpcb-rfq .wpcf7-form {
  margin: 0;
}

/* Defensive: ignore stray autop markup if the filter is not active */
#tpcb-rfq .tpcb-rfq-form__grid > br,
#tpcb-rfq .tpcb-rfq-form__field > br,
#tpcb-rfq .wpcf7-form p:empty {
  display: none;
}

#tpcb-rfq .tpcb-rfq-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

#tpcb-rfq .tpcb-rfq-form__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  margin: 0;
}

#tpcb-rfq .tpcb-rfq-form__field--full {
  grid-column: 1 / -1;
}

#tpcb-rfq label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--tpcb-rfq-heading);
}

#tpcb-rfq .tpcb-rfq-form__req {
  color: var(--tpcb-rfq-error);
}

#tpcb-rfq .tpcb-rfq-form__hint {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--tpcb-rfq-muted);
}

#tpcb-rfq .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
  min-width: 0;
}

/* Text inputs, select and textarea */
#tpcb-rfq input[type="text"],
#tpcb-rfq input[type="email"],
#tpcb-rfq input[type="tel"],
#tpcb-rfq select,
#tpcb-rfq textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid var(--tpcb-rfq-field);
  border-radius: var(--tpcb-rfq-radius-sm);
  background: #fff;
  box-shadow: none;
  color: #1f2a3a;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#tpcb-rfq select {
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b6576' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

#tpcb-rfq textarea {
  min-height: 128px;
  resize: vertical;
}

#tpcb-rfq input::placeholder,
#tpcb-rfq textarea::placeholder {
  color: #8a96a8;
  opacity: 1;
}

#tpcb-rfq input[type="text"]:focus,
#tpcb-rfq input[type="email"]:focus,
#tpcb-rfq input[type="tel"]:focus,
#tpcb-rfq select:focus,
#tpcb-rfq textarea:focus {
  border-color: var(--tpcb-rfq-primary);
  box-shadow: 0 0 0 3px var(--tpcb-rfq-focus-ring);
  outline: none;
}

/* File inputs */
#tpcb-rfq input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 7px;
  border: 1px dashed #b7c8de;
  border-radius: var(--tpcb-rfq-radius-sm);
  background: #f8fafd;
  color: var(--tpcb-rfq-muted);
  font: inherit;
  font-size: 13px;
  overflow-wrap: anywhere;
  cursor: pointer;
}

#tpcb-rfq input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 12px;
  border: 0;
  border-radius: var(--tpcb-rfq-radius-sm);
  background: var(--tpcb-rfq-tint);
  color: var(--tpcb-rfq-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#tpcb-rfq input[type="file"]::-webkit-file-upload-button {
  margin-right: 12px;
  padding: 7px 12px;
  border: 0;
  border-radius: var(--tpcb-rfq-radius-sm);
  background: var(--tpcb-rfq-tint);
  color: var(--tpcb-rfq-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#tpcb-rfq input[type="file"]:focus-visible {
  outline: 3px solid var(--tpcb-rfq-sky);
  outline-offset: 2px;
}

/* Checkbox */
#tpcb-rfq .wpcf7-checkbox,
#tpcb-rfq .wpcf7-list-item {
  display: block;
  margin: 0;
}

#tpcb-rfq .wpcf7-list-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}

#tpcb-rfq input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--tpcb-rfq-primary);
}

#tpcb-rfq .wpcf7-list-item-label {
  min-width: 0;
}

/* Quiz (spam check): question and a short answer box on one line */
#tpcb-rfq .tpcb-rfq-form__field--quiz {
  padding-top: 14px;
  border-top: 1px solid #e6ecf3;
}

#tpcb-rfq .tpcb-rfq-form__field--quiz label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

#tpcb-rfq .wpcf7-quiz-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--tpcb-rfq-heading);
}

#tpcb-rfq .tpcb-rfq-form__field--quiz input.wpcf7-quiz {
  flex: 0 0 90px;
  width: 90px;
  height: 34px;
  min-height: 34px;
  padding: 4px 10px;
}

/* Submit and privacy notice */
#tpcb-rfq .tpcb-rfq-form__actions {
  position: relative;
  margin-top: 20px;
}

#tpcb-rfq .wpcf7-submit {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--tpcb-rfq-radius-sm);
  background: var(--tpcb-rfq-button);
  color: var(--tpcb-rfq-on-button);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#tpcb-rfq .wpcf7-submit:hover,
#tpcb-rfq .wpcf7-submit:focus-visible {
  background: var(--tpcb-rfq-button-hover);
  color: var(--tpcb-rfq-on-button);
}

#tpcb-rfq .wpcf7-submit:focus-visible {
  outline: 3px solid var(--tpcb-rfq-sky);
  outline-offset: 2px;
}

#tpcb-rfq .wpcf7-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spinner sits inside the button area instead of adding a row below it */
#tpcb-rfq .wpcf7-spinner {
  position: absolute;
  top: 50%;
  right: 14px;
  margin: 0;
  transform: translateY(-50%);
}

#tpcb-rfq .tpcb-rfq-form__privacy {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--tpcb-rfq-muted);
}

#tpcb-rfq .tpcb-rfq-form__privacy a {
  color: var(--tpcb-rfq-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Validation and response messages */
#tpcb-rfq .wpcf7-not-valid {
  border-color: var(--tpcb-rfq-error);
}

#tpcb-rfq .wpcf7-not-valid-tip {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--tpcb-rfq-error);
}

#tpcb-rfq .wpcf7 form .wpcf7-response-output {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-width: 1px;
  border-radius: var(--tpcb-rfq-radius-sm);
  font-size: 14px;
  line-height: 1.5;
}

#tpcb-rfq .wpcf7 form.sent .wpcf7-response-output {
  border-color: #2e8b57;
  background: #f0f9f4;
  color: #1f5f3b;
}

#tpcb-rfq .wpcf7 form.invalid .wpcf7-response-output,
#tpcb-rfq .wpcf7 form.unaccepted .wpcf7-response-output,
#tpcb-rfq .wpcf7 form.failed .wpcf7-response-output,
#tpcb-rfq .wpcf7 form.spam .wpcf7-response-output,
#tpcb-rfq .wpcf7 form.aborted .wpcf7-response-output {
  border-color: var(--tpcb-rfq-error);
  background: #fdf3f3;
  color: #8a2525;
}


/* ---------------------------------------------------------------------
   6. Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1024px) {
  #tpcb-rfq {
    --tpcb-rfq-section-y: 64px;
    --tpcb-rfq-gap: 40px;
    flex-direction: column;
    align-items: stretch;
  }

  #tpcb-rfq > :has(.tpcb-rfq-panel),
  #tpcb-rfq > :has(.wpcf7) {
    flex: 0 0 auto;
    width: 100%;
  }

  .tpcb-rfq-panel {
    max-width: 720px;
  }
}

@media (max-width: 767px) {
  #tpcb-rfq {
    --tpcb-rfq-section-y: 52px;
    --tpcb-rfq-gap: 32px;
  }

  #tpcb-rfq .wpcf7 {
    padding: 24px 20px;
  }

  #tpcb-rfq .tpcb-rfq-form__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  #tpcb-rfq *,
  #tpcb-rfq *::before,
  #tpcb-rfq *::after {
    transition: none !important;
  }
}