/*
 * TPB Discovery
 * Scoped under .tpbdc-card and #tpb-discovery.
 */

.tpbdc-card,
#tpb-discovery {
  --tpbdc-ink: #0C3B4E;
  --tpbdc-text: #1A2B32;
  --tpbdc-muted: #5F7179;
  --tpbdc-btn: #0B3F56;
  --tpbdc-btn-hover: #082E3F;
  --tpbdc-btn-disabled: #E5E7EB;
  --tpbdc-btn-disabled-text: #6B7280;
  --tpbdc-border: #C4D0D6;
  --tpbdc-border-focus: #0B3F56;
  --tpbdc-bg: #FFFFFF;
  --tpbdc-danger: #A63A2B;
  --tpbdc-font: "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tpbdc-card,
.tpbdc-card *,
.tpbdc-card *::before,
.tpbdc-card *::after {
  box-sizing: border-box;
}

.tpbdc-card [hidden] {
  display: none !important;
}

.tpbdc-card {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: var(--tpbdc-bg);
  border-radius: 24px;
  padding: 36px 32px 30px;
  font-family: var(--tpbdc-font);
  color: var(--tpbdc-text);
  box-shadow: 0 24px 60px -20px rgba(11, 63, 86, 0.25);
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.tpbdc-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tpbdc-ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.tpbdc-close:hover {
  background: rgba(12, 59, 78, 0.08);
}

.tpbdc-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  color: #091E26;
}

.tpbdc-lede {
  margin: 0 0 22px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--tpbdc-muted);
}

.tpbdc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.tpbdc-field {
  margin-bottom: 16px;
}

.tpbdc-grid .tpbdc-field {
  margin-bottom: 0;
}

.tpbdc-field label {
  display: block;
  margin: 0 0 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--tpbdc-ink);
}

.tpbdc-opt-label {
  font-weight: 400;
  color: var(--tpbdc-muted);
}

.tpbdc-field input[type="text"],
.tpbdc-field input[type="email"],
.tpbdc-field input[type="tel"],
.tpbdc-field select {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--tpbdc-text);
  background: #FFFFFF;
  border: 1px solid var(--tpbdc-border);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.tpbdc-field input::placeholder {
  color: #8E9CA2;
}

.tpbdc-field input:focus,
.tpbdc-field select:focus {
  border-color: var(--tpbdc-border-focus);
  box-shadow: 0 0 0 3px rgba(11, 63, 86, 0.12);
}

.tpbdc-select-wrap {
  position: relative;
}

.tpbdc-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  cursor: pointer;
}

.tpbdc-select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.8px solid var(--tpbdc-ink);
  border-bottom: 1.8px solid var(--tpbdc-ink);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.tpbdc-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--tpbdc-muted);
}

.tpbdc-field--check {
  margin: 6px 0 22px;
}

.tpbdc-check {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin: 0 !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: var(--tpbdc-ink) !important;
}

.tpbdc-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--tpbdc-btn);
  cursor: pointer;
  flex: 0 0 auto;
}

.tpbdc-error {
  display: none;
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--tpbdc-danger);
}

.tpbdc-field.tpbdc-has-error input,
.tpbdc-field.tpbdc-has-error select {
  border-color: var(--tpbdc-danger);
}

.tpbdc-field.tpbdc-has-error .tpbdc-error {
  display: block;
}

.tpbdc-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.tpbdc-formerror {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #FBEDEA;
  color: var(--tpbdc-danger);
  font-size: 13.5px;
  text-align: center;
}

.tpbdc-btn {
  width: 100%;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--tpbdc-btn);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.tpbdc-btn:hover:not(:disabled) {
  background: var(--tpbdc-btn-hover);
  color: #FFFFFF;
}

.tpbdc-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.tpbdc-btn--muted,
.tpbdc-btn[disabled] {
  background: var(--tpbdc-btn-disabled);
  color: var(--tpbdc-btn-disabled-text);
  cursor: default;
  transform: none;
}

.tpbdc-btn--ghost {
  background: transparent;
  color: var(--tpbdc-ink);
  border: 1px solid var(--tpbdc-border);
  margin-top: 20px;
}

.tpbdc-btn--ghost:hover:not(:disabled) {
  background: #F4F7F8;
  color: var(--tpbdc-ink);
}

.tpbdc-footer-hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--tpbdc-muted);
}

.tpbdc-trigger {
  font-family: var(--tpbdc-font);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  background: #0B3F56;
  color: #FFFFFF;
  cursor: pointer;
}

/* Success */
.tpbdc-success {
  text-align: center;
  padding: 18px 8px;
}

.tpbdc-success-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
}

.tpbdc-success-badge svg {
  width: 100%;
  height: 100%;
}

.tpbdc-success-badge circle {
  fill: #E6F2F0;
}

.tpbdc-success-badge path {
  fill: none;
  stroke: #0B3F56;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tpbdc-success-copy {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--tpbdc-muted);
}

/* Modal overlay */
#tpb-discovery.tpbdc-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(12, 26, 32, 0.58);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

#tpb-discovery.tpbdc-overlay.tpbdc-is-open {
  opacity: 1;
  visibility: visible;
}

#tpb-discovery .tpbdc-modal {
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 24px;
}

@media (max-width: 560px) {
  .tpbdc-card {
    padding: 28px 20px 24px;
    border-radius: 20px;
  }

  .tpbdc-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}